diff --git a/.github/workflows/java-logging-ci.yaml b/.github/workflows/java-logging-ci.yaml new file mode 100644 index 000000000000..a13d2d00cdb7 --- /dev/null +++ b/.github/workflows/java-logging-ci.yaml @@ -0,0 +1,138 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# Github action job to test core java library features on +# downstream client libraries before they are released. +on: + push: + branches: + - main + pull_request: +name: java-logging ci +defaults: + run: + working-directory: java-logging +jobs: + filter: + runs-on: ubuntu-latest + outputs: + library: ${{ steps.filter.outputs.library }} + steps: + - uses: actions/checkout@v4 + - uses: dorny/paths-filter@v3 + id: filter + with: + filters: | + library: + - 'java-logging/**' + units: + needs: filter + if: ${{ needs.filter.outputs.library == 'true' }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + java: [11, 17, 21, 25] + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: ${{matrix.java}} + - run: java -version + - run: .kokoro/build.sh + env: + JOB_TYPE: test + units-java8: + needs: filter + if: ${{ needs.filter.outputs.library == 'true' }} + # Building using Java 17 and run the tests with Java 8 runtime + name: "units (8)" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + java-version: 8 + distribution: temurin + - name: "Set jvm system property environment variable for surefire plugin (unit tests)" + # Maven surefire plugin (unit tests) allows us to specify JVM to run the tests. + # https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#jvm + run: echo "SUREFIRE_JVM_OPT=-Djvm=${JAVA_HOME}/bin/java" >> $GITHUB_ENV + shell: bash + - uses: actions/setup-java@v4 + with: + java-version: 17 + distribution: temurin + - run: .kokoro/build.sh + env: + JOB_TYPE: test + windows: + needs: filter + if: ${{ needs.filter.outputs.library == 'true' }} + runs-on: windows-latest + steps: + - name: Support longpaths + run: git config --system core.longpaths true + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 8 + - run: java -version + - run: .kokoro/build.bat + env: + JOB_TYPE: test + dependencies: + needs: filter + if: ${{ needs.filter.outputs.library == 'true' }} + runs-on: ubuntu-latest + strategy: + matrix: + java: [17] + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: ${{matrix.java}} + - run: java -version + - run: .kokoro/dependencies.sh + javadoc: + needs: filter + if: ${{ needs.filter.outputs.library == 'true' }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 17 + - run: java -version + - run: .kokoro/build.sh + env: + JOB_TYPE: javadoc + lint: + needs: filter + if: ${{ needs.filter.outputs.library == 'true' }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 17 + - run: java -version + - run: .kokoro/build.sh + env: + JOB_TYPE: lint diff --git a/gapic-libraries-bom/pom.xml b/gapic-libraries-bom/pom.xml index e7937e306406..17fbe0423f67 100644 --- a/gapic-libraries-bom/pom.xml +++ b/gapic-libraries-bom/pom.xml @@ -789,6 +789,13 @@ pom import + + com.google.cloud + google-cloud-logging-bom + 3.23.10-SNAPSHOT + pom + import + com.google.cloud google-cloud-lustre-bom diff --git a/generation_config.yaml b/generation_config.yaml index 384924d16e84..11b97fe63690 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -2976,3 +2976,20 @@ libraries: GAPICs: - proto_path: google/cloud/workstations/v1 - proto_path: google/cloud/workstations/v1beta + +- api_shortname: logging + name_pretty: Cloud Logging + product_documentation: https://cloud.google.com/logging/docs + client_documentation: https://cloud.google.com/java/docs/reference/google-cloud-logging/latest/history + issue_tracker: https://issuetracker.google.com/savedsearches/559764 + release_level: stable + language: java + distribution_name: com.google.cloud:google-cloud-logging + api_id: logging.googleapis.com + transport: grpc + library_type: GAPIC_COMBO + api_description: allows you to store, search, analyze, monitor, and alert on log data and events from Google Cloud and Amazon Web Services. Using the BindPlane service, you can also collect this data from over 150 common application components, on-premises systems, and hybrid cloud systems. BindPlane is included with your Google Cloud project at no additional cost. + codeowner_team: '@googleapis/api-logging @googleapis/yoshi-java @googleapis/api-logging-partners' + recommended_package: com.google.cloud.logging + GAPICs: + - proto_path: google/logging/v2 diff --git a/java-logging/.OwlBot-hermetic.yaml b/java-logging/.OwlBot-hermetic.yaml new file mode 100644 index 000000000000..8da0916082de --- /dev/null +++ b/java-logging/.OwlBot-hermetic.yaml @@ -0,0 +1,35 @@ +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.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. + + +deep-remove-regex: +- "/java-logging/grpc-google-.*/src" +- "/java-logging/proto-google-.*/src" +- "/java-logging/google-.*/src" +- "/java-logging/samples/snippets/generated" + +deep-preserve-regex: +- "/java-logging/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java" + +deep-copy-regex: +- source: "/google/logging/(v.*)/.*-java/proto-google-.*/src" + dest: "/owl-bot-staging/java-logging/$1/proto-google-cloud-logging-$1/src" +- source: "/google/logging/(v.*)/.*-java/grpc-google-.*/src" + dest: "/owl-bot-staging/java-logging/$1/grpc-google-cloud-logging-$1/src" +- source: "/google/logging/(v.*)/.*-java/gapic-google-.*/src" + dest: "/owl-bot-staging/java-logging/$1/google-cloud-logging/src" +- source: "/google/logging/(v.*)/.*-java/samples/snippets/generated" + dest: "/owl-bot-staging/java-logging/$1/samples/snippets/generated" + +api-name: logging \ No newline at end of file diff --git a/java-logging/.cloudbuild/samples_build.yaml b/java-logging/.cloudbuild/samples_build.yaml new file mode 100644 index 000000000000..018fdd1fcf9c --- /dev/null +++ b/java-logging/.cloudbuild/samples_build.yaml @@ -0,0 +1,32 @@ +steps: +- name: gcr.io/cloud-devrel-public-resources/java8 + entrypoint: ls + args: [ + '-alt', + ] +- name: gcr.io/cloud-devrel-public-resources/java8 + entrypoint: curl + args: [ + '--header', + 'Metadata-Flavor: Google', + 'http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/email' + ] +- name: gcr.io/cloud-devrel-public-resources/java8 + entrypoint: pwd +- name: gcr.io/cloud-devrel-public-resources/java8 + entrypoint: bash + args: [ + '.kokoro/build.sh' + ] + env: + - 'JOB_TYPE=samples' + - 'GOOGLE_CLOUD_PROJECT=cloud-java-ci-sample' +- name: gcr.io/cloud-devrel-public-resources/java8 + entrypoint: echo + args: [ + 'Sample job succeeded', + ] +timeout: 3600s +options: + defaultLogsBucketBehavior: REGIONAL_USER_OWNED_BUCKET + diff --git a/java-logging/.github/ISSUE_TEMPLATE/bug_report.md b/java-logging/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 000000000000..eec48ee60ee9 --- /dev/null +++ b/java-logging/.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-logging/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. 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/java-logging/.github/ISSUE_TEMPLATE/feature_request.md b/java-logging/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 000000000000..754e30c68a00 --- /dev/null +++ b/java-logging/.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/java-logging/.github/ISSUE_TEMPLATE/support_request.md b/java-logging/.github/ISSUE_TEMPLATE/support_request.md new file mode 100644 index 000000000000..995869032125 --- /dev/null +++ b/java-logging/.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/java-logging/.github/PULL_REQUEST_TEMPLATE.md b/java-logging/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 000000000000..b7355248b915 --- /dev/null +++ b/java-logging/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,10 @@ +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/google-cloud-java/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 # ☕️ + +If you write sample code, please follow the [samples format]( +https://github.com/GoogleCloudPlatform/java-docs-samples/blob/main/SAMPLE_FORMAT.md). diff --git a/java-logging/.github/auto-label.yaml b/java-logging/.github/auto-label.yaml new file mode 100644 index 000000000000..4caef688b745 --- /dev/null +++ b/java-logging/.github/auto-label.yaml @@ -0,0 +1,15 @@ +# 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. +requestsize: + enabled: true diff --git a/java-logging/.github/dependabot.yml b/java-logging/.github/dependabot.yml new file mode 100644 index 000000000000..203f9eaccf13 --- /dev/null +++ b/java-logging/.github/dependabot.yml @@ -0,0 +1,19 @@ +version: 2 +updates: + - package-ecosystem: "maven" + directory: "/" + schedule: + interval: "daily" + # Disable version updates for Maven dependencies + # we use renovate-bot as well as shared-dependencies BOM to update maven dependencies. + ignore: + - dependency-name: "*" + - package-ecosystem: "pip" + directory: "/" + schedule: + interval: "daily" + # Disable version updates for pip dependencies + # If a security vulnerability comes in, we will be notified about + # it via template in the synthtool repository. + ignore: + - dependency-name: "*" diff --git a/java-logging/.github/generated-files-bot.yml b/java-logging/.github/generated-files-bot.yml new file mode 100644 index 000000000000..e58cdcbad65a --- /dev/null +++ b/java-logging/.github/generated-files-bot.yml @@ -0,0 +1,13 @@ +externalManifests: +- type: json + file: 'synth.metadata' + jsonpath: '$.generatedFiles[*]' +- type: json + file: '.github/readme/synth.metadata/synth.metadata' + jsonpath: '$.generatedFiles[*]' +ignoreAuthors: +- 'cloud-java-bot' +- 'renovate-bot' +- 'yoshi-automation' +- 'release-please[bot]' +- 'gcf-owl-bot[bot]' diff --git a/java-logging/.github/release-please.yml b/java-logging/.github/release-please.yml new file mode 100644 index 000000000000..8ca7f9cabc29 --- /dev/null +++ b/java-logging/.github/release-please.yml @@ -0,0 +1,3 @@ +bumpMinorPreMajor: true +handleGHRelease: true +releaseType: java-yoshi diff --git a/java-logging/.github/release-trigger.yml b/java-logging/.github/release-trigger.yml new file mode 100644 index 000000000000..243949edf769 --- /dev/null +++ b/java-logging/.github/release-trigger.yml @@ -0,0 +1,2 @@ +enabled: true +multiScmName: java-logging diff --git a/java-logging/.github/scripts/update_generation_config.sh b/java-logging/.github/scripts/update_generation_config.sh new file mode 100644 index 000000000000..92efcf881914 --- /dev/null +++ b/java-logging/.github/scripts/update_generation_config.sh @@ -0,0 +1,177 @@ +#!/bin/bash +set -ex +# This script should be run at the root of the repository. +# This script is used to update googleapis_commitish, gapic_generator_version, +# and libraries_bom_version in generation configuration at the time of running +# and create a pull request. + +# The following commands need to be installed before running the script: +# 1. git +# 2. gh +# 3. jq + +# Utility functions +# Get the latest released version of a Maven artifact. +function get_latest_released_version() { + local group_id=$1 + local artifact_id=$2 + group_id_url_path="$(sed 's|\.|/|g' <<< "${group_id}")" + url="https://repo1.maven.org/maven2/${group_id_url_path}/${artifact_id}/maven-metadata.xml" + xml_content=$(curl -s --fail "${url}") + latest=$(xmllint --xpath 'metadata/versioning/latest/text()' - <<< "${xml_content}") + if [[ -z "${latest}" ]]; then + echo "The latest version of ${group_id}:${artifact_id} is empty." + echo "The returned json from maven.org is invalid: ${json_content}" + exit 1 + else + echo "${latest}" + fi +} + +# Update a key to a new value in the generation config. +function update_config() { + local key_word=$1 + local new_value=$2 + local file=$3 + echo "Update ${key_word} to ${new_value} in ${file}" + sed -i -e "s/^${key_word}.*$/${key_word}: ${new_value}/" "${file}" +} + +# Update an action to a new version in GitHub action. +function update_action() { + local key_word=$1 + local new_value=$2 + local file=$3 + echo "Update ${key_word} to ${new_value} in ${file}" + # use a different delimiter because the key_word contains "/". + sed -i -e "s|${key_word}@v.*$|${key_word}@v${new_value}|" "${file}" +} + +# The parameters of this script is: +# 1. base_branch, the base branch of the result pull request. +# 2. repo, organization/repo-name, e.g., googleapis/google-cloud-java +# 3. [optional] generation_config, the path to the generation configuration, +# the default value is generation_config.yaml in the repository root. +# 4. [optional] workflow, the library generation workflow file, +# the default value is .github/workflows/hermetic_library_generation.yaml. +while [[ $# -gt 0 ]]; do +key="$1" +case "${key}" in + --base_branch) + base_branch="$2" + shift + ;; + --repo) + repo="$2" + shift + ;; + --generation_config) + generation_config="$2" + shift + ;; + --workflow) + workflow="$2" + shift + ;; + *) + echo "Invalid option: [$1]" + exit 1 + ;; +esac +shift +done + +if [ -z "${base_branch}" ]; then + echo "missing required argument --base_branch" + exit 1 +fi + +if [ -z "${repo}" ]; then + echo "missing required argument --repo" + exit 1 +fi + +if [ -z "${generation_config}" ]; then + generation_config="generation_config.yaml" + echo "Use default generation config: ${generation_config}" +fi + +if [ -z "${workflow}" ]; then + workflow=".github/workflows/hermetic_library_generation.yaml" + echo "Use default library generation workflow file: ${workflow}" +fi + +current_branch="generate-libraries-${base_branch}" +title="chore: Update generation configuration at $(date)" + +git checkout "${base_branch}" +# Try to find a open pull request associated with the branch +pr_num=$(gh pr list -s open -H "${current_branch}" -q . --json number | jq ".[] | .number") +# Create a branch if there's no open pull request associated with the +# branch; otherwise checkout the pull request. +if [ -z "${pr_num}" ]; then + git checkout -b "${current_branch}" + # Push the current branch to remote so that we can + # compare the commits later. + git push -u origin "${current_branch}" +else + gh pr checkout "${pr_num}" +fi + +# Only allow fast-forward merging; exit with non-zero result if there's merging +# conflict. +git merge -m "chore: merge ${base_branch} into ${current_branch}" "${base_branch}" + +mkdir tmp-googleapis +# Use partial clone because only commit history is needed. +git clone --filter=blob:none https://github.com/googleapis/googleapis.git tmp-googleapis +pushd tmp-googleapis +git pull +latest_commit=$(git rev-parse HEAD) +popd +rm -rf tmp-googleapis +update_config "googleapis_commitish" "${latest_commit}" "${generation_config}" + +# Update gapic-generator-java version to the latest +latest_version=$(get_latest_released_version "com.google.api" "gapic-generator-java") +update_config "gapic_generator_version" "${latest_version}" "${generation_config}" + +# Update composite action version to latest gapic-generator-java version +update_action "googleapis/sdk-platform-java/.github/scripts" \ + "${latest_version}" \ + "${workflow}" + +# Update libraries-bom version to the latest +latest_version=$(get_latest_released_version "com.google.cloud" "libraries-bom") +update_config "libraries_bom_version" "${latest_version}" "${generation_config}" + +git add "${generation_config}" "${workflow}" +changed_files=$(git diff --cached --name-only) +if [[ "${changed_files}" == "" ]]; then + echo "The latest generation config is not changed." + echo "Skip committing to the pull request." +else + git commit -m "${title}" +fi + +# There are potentially at most two commits: merge commit and change commit. +# We want to exit the script if no commit happens (otherwise this will be an +# infinite loop). +# `git cherry` is a way to find whether the local branch has commits that are +# not in the remote branch. +# If we find any such commit, push them to remote branch. +unpushed_commit=$(git cherry -v "origin/${current_branch}" | wc -l) +if [[ "${unpushed_commit}" -eq 0 ]]; then + echo "No unpushed commits, exit" + exit 0 +fi + +if [ -z "${pr_num}" ]; then + git remote add remote_repo https://cloud-java-bot:"${GH_TOKEN}@github.com/${repo}.git" + git fetch -q remote_repo + git push -f remote_repo "${current_branch}" + gh pr create --title "${title}" --head "${current_branch}" --body "${title}" --base "${base_branch}" +else + git push + gh pr edit "${pr_num}" --title "${title}" --body "${title}" +fi diff --git a/java-logging/.github/snippet-bot.yml b/java-logging/.github/snippet-bot.yml new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/java-logging/.github/sync-repo-settings.yaml b/java-logging/.github/sync-repo-settings.yaml new file mode 100644 index 000000000000..f1c3e6d096ba --- /dev/null +++ b/java-logging/.github/sync-repo-settings.yaml @@ -0,0 +1,65 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# 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 main branch protection +branchProtectionRules: +# Identifies the protection rule pattern. Name of the branch to be protected. +# Defaults to `main` +- pattern: main + # 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 (17)" + - "lint" + - "javadoc" + - "units (8)" + - "units (11)" + - "Kokoro - Test: Integration" + - "cla/google" + - "OwlBot Post Processor" + - "Kokoro - Test: Java GraalVM Native Image A" + - "Kokoro - Test: Java GraalVM Native Image B" + - "Kokoro - Test: Java GraalVM Native Image C" +# 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 +- team: java-samples-reviewers + permission: push + diff --git a/java-logging/.github/trusted-contribution.yml b/java-logging/.github/trusted-contribution.yml new file mode 100644 index 000000000000..88d3ac9bf1a7 --- /dev/null +++ b/java-logging/.github/trusted-contribution.yml @@ -0,0 +1,9 @@ +trustedContributors: +- renovate-bot +- gcf-owl-bot[bot] + +annotations: +- type: comment + text: "/gcbrun" +- type: label + text: "kokoro:force-run" diff --git a/java-logging/.github/workflows/approve-readme.yaml b/java-logging/.github/workflows/approve-readme.yaml new file mode 100644 index 000000000000..59f00b8eb6e6 --- /dev/null +++ b/java-logging/.github/workflows/approve-readme.yaml @@ -0,0 +1,69 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# Github action job to test core java library features on +# downstream client libraries before they are released. +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@v7 + 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/java-logging/.github/workflows/ci.yaml b/java-logging/.github/workflows/ci.yaml new file mode 100644 index 000000000000..b9b8be0c36db --- /dev/null +++ b/java-logging/.github/workflows/ci.yaml @@ -0,0 +1,123 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# Github action job to test core java library features on +# downstream client libraries before they are released. +on: + push: + branches: + - main + pull_request: +name: ci +jobs: + units: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + java: [11, 17, 21, 25] + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: ${{matrix.java}} + - run: java -version + - run: .kokoro/build.sh + env: + JOB_TYPE: test + units-java8: + # Building using Java 17 and run the tests with Java 8 runtime + name: "units (8)" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + java-version: 8 + distribution: temurin + - name: "Set jvm system property environment variable for surefire plugin (unit tests)" + # Maven surefire plugin (unit tests) allows us to specify JVM to run the tests. + # https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#jvm + run: echo "SUREFIRE_JVM_OPT=-Djvm=${JAVA_HOME}/bin/java" >> $GITHUB_ENV + shell: bash + - uses: actions/setup-java@v4 + with: + java-version: 17 + distribution: temurin + - run: .kokoro/build.sh + env: + JOB_TYPE: test + windows: + runs-on: windows-latest + steps: + - name: Support longpaths + run: git config --system core.longpaths true + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 8 + - run: java -version + - run: .kokoro/build.bat + env: + JOB_TYPE: test + dependencies: + runs-on: ubuntu-latest + strategy: + matrix: + java: [17] + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: ${{matrix.java}} + - run: java -version + - run: .kokoro/dependencies.sh + javadoc: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 17 + - run: java -version + - run: .kokoro/build.sh + env: + JOB_TYPE: javadoc + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 17 + - run: java -version + - run: .kokoro/build.sh + env: + JOB_TYPE: lint + clirr: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 8 + - run: java -version + - run: .kokoro/build.sh + env: + JOB_TYPE: clirr diff --git a/java-logging/.github/workflows/renovate_config_check.yaml b/java-logging/.github/workflows/renovate_config_check.yaml new file mode 100644 index 000000000000..47b9e87c98bb --- /dev/null +++ b/java-logging/.github/workflows/renovate_config_check.yaml @@ -0,0 +1,25 @@ +name: Renovate Bot Config Validation + +on: + pull_request: + paths: + - 'renovate.json' + +jobs: + renovate_bot_config_validation: + runs-on: ubuntu-24.04 + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '22' + + - name: Install Renovate and Config Validator + run: | + npm install -g npm@latest + npm install --global renovate + renovate-config-validator diff --git a/java-logging/.github/workflows/samples.yaml b/java-logging/.github/workflows/samples.yaml new file mode 100644 index 000000000000..186fd8bcfc51 --- /dev/null +++ b/java-logging/.github/workflows/samples.yaml @@ -0,0 +1,30 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# Github action job to test core java library features on +# downstream client libraries before they are released. +on: + pull_request: +name: samples +jobs: + checkstyle: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 17 + - name: Run checkstyle + run: mvn -P lint --quiet --batch-mode checkstyle:check + working-directory: samples/snippets diff --git a/java-logging/.github/workflows/update_generation_config.yaml b/java-logging/.github/workflows/update_generation_config.yaml new file mode 100644 index 000000000000..a7e14bb483c3 --- /dev/null +++ b/java-logging/.github/workflows/update_generation_config.yaml @@ -0,0 +1,47 @@ +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# GitHub action job to test core java library features on +# downstream client libraries before they are released. +name: Update generation configuration +on: + schedule: + - cron: '0 2 * * *' + workflow_dispatch: + +jobs: + update-generation-config: + runs-on: ubuntu-24.04 + env: + # the branch into which the pull request is merged + base_branch: main + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + token: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }} + - name: Install Dependencies + shell: bash + run: sudo apt-get update && sudo apt-get install -y libxml2-utils + - name: Update params in generation config to latest + shell: bash + run: | + set -x + [ -z "$(git config user.email)" ] && git config --global user.email "cloud-java-bot@google.com" + [ -z "$(git config user.name)" ] && git config --global user.name "cloud-java-bot" + bash .github/scripts/update_generation_config.sh \ + --base_branch "${base_branch}" \ + --repo ${{ github.repository }} + env: + GH_TOKEN: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }} + diff --git a/java-logging/.gitignore b/java-logging/.gitignore new file mode 100644 index 000000000000..caa9ca3d8138 --- /dev/null +++ b/java-logging/.gitignore @@ -0,0 +1,35 @@ +.gitignore + +# Packages +dist +bin +var +sdist +target + +# Unit test / coverage reports +.coverage +.tox +nosetests.xml + +# Translations +*.mo + +# Mr Developer +.mr.developer.cfg +.project +.pydevproject +*.iml +.idea +.settings +.DS_Store +.classpath + +# Built documentation +docs/ + +# Python utilities +*.pyc + +.flattened-pom.xml + diff --git a/java-logging/.gitmodules b/java-logging/.gitmodules new file mode 100644 index 000000000000..3ab2448e083f --- /dev/null +++ b/java-logging/.gitmodules @@ -0,0 +1,3 @@ +[submodule "env-tests-logging"] + path = env-tests-logging + url = https://github.com/googleapis/env-tests-logging diff --git a/java-logging/.kokoro/build.bat b/java-logging/.kokoro/build.bat new file mode 100644 index 000000000000..067cf4a4c489 --- /dev/null +++ b/java-logging/.kokoro/build.bat @@ -0,0 +1,18 @@ +:: Copyright 2022 Google LLC +:: +:: Licensed under the Apache License, Version 2.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. +:: Github action job to test core java library features on +:: downstream client libraries before they are released. +:: See documentation in type-shell-output.bat + +"C:\Program Files\Git\bin\bash.exe" %~dp0build.sh diff --git a/java-logging/.kokoro/build.sh b/java-logging/.kokoro/build.sh new file mode 100755 index 000000000000..7c267d2a6c43 --- /dev/null +++ b/java-logging/.kokoro/build.sh @@ -0,0 +1,135 @@ +#!/bin/bash +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +## 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) + echo "SUREFIRE_JVM_OPT: ${SUREFIRE_JVM_OPT}" + mvn test -B -ntp -Dfmt.skip=true -Dclirr.skip=true -Denforcer.skip=true ${SUREFIRE_JVM_OPT} + RETURN_CODE=$? + ;; +lint) + mvn com.spotify.fmt:fmt-maven-plugin:check -B -ntp + RETURN_CODE=$? + ;; +javadoc) + mvn javadoc:javadoc javadoc:test-javadoc -B -ntp -Dfmt.skip=true + RETURN_CODE=$? + ;; +integration) + mvn -B ${INTEGRATION_TEST_ARGS} \ + -ntp \ + -Penable-integration-tests \ + -DtrimStackTrace=false \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -Dcheckstyle.skip=true \ + -DskipUnitTests=true \ + -Dfmt.skip=true \ + -fae \ + verify + RETURN_CODE=$? + ;; +graalvm) + # Run Unit and Integration Tests with Native Image + mvn -B ${INTEGRATION_TEST_ARGS} -ntp -Pnative test -Dfmt.skip=true + 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 \ + -ntp \ + -DtrimStackTrace=false \ + -Dclirr.skip=true \ + -Denforcer.skip=true \ + -Dfmt.skip=true \ + -fae \ + verify + RETURN_CODE=$? + popd + else + echo "no sample pom.xml found - skipping sample tests" + fi + ;; +clirr) + mvn -B -ntp -Dfmt.skip=true -Denforcer.skip=true clirr:check + RETURN_CODE=$? + ;; +*) + ;; +esac + +if [ "${REPORT_COVERAGE}" == "true" ] +then + bash ${KOKORO_GFILE_DIR}/codecov.sh +fi + +# fix output location of logs +bash .kokoro/coerce_logs.sh + +if [[ "${ENABLE_FLAKYBOT}" == "true" ]] +then + chmod +x ${KOKORO_GFILE_DIR}/linux_amd64/flakybot + ${KOKORO_GFILE_DIR}/linux_amd64/flakybot -repo=googleapis/java-logging +fi + +echo "exiting with ${RETURN_CODE}" +exit ${RETURN_CODE} diff --git a/java-logging/.kokoro/coerce_logs.sh b/java-logging/.kokoro/coerce_logs.sh new file mode 100755 index 000000000000..46edbf7f2fcd --- /dev/null +++ b/java-logging/.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/java-logging/.kokoro/common.cfg b/java-logging/.kokoro/common.cfg new file mode 100644 index 000000000000..6ac75eb53f41 --- /dev/null +++ b/java-logging/.kokoro/common.cfg @@ -0,0 +1,33 @@ +# 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-logging/.kokoro/trampoline.sh" + +# Tell the trampoline which build file to use. +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-logging/.kokoro/build.sh" +} + + +############################################# +# this section merged from .kokoro/common_env_vars.cfg using owlbot.py + +env_vars: { + key: "PRODUCT_AREA_LABEL" + value: "observability" +} +env_vars: { + key: "PRODUCT_LABEL" + value: "logging" +} +env_vars: { + key: "LANGUAGE_LABEL" + value: "java" +} + +################################################### + diff --git a/java-logging/.kokoro/common.sh b/java-logging/.kokoro/common.sh new file mode 100644 index 000000000000..f8f957af1112 --- /dev/null +++ b/java-logging/.kokoro/common.sh @@ -0,0 +1,60 @@ +#!/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) $*"; } + +## Helper comment to trigger updated repo dependency release \ No newline at end of file diff --git a/java-logging/.kokoro/common_env_vars.cfg b/java-logging/.kokoro/common_env_vars.cfg new file mode 100644 index 000000000000..fd34bc54d39b --- /dev/null +++ b/java-logging/.kokoro/common_env_vars.cfg @@ -0,0 +1,19 @@ + +############################################# +# this section merged from .kokoro/common_env_vars.cfg using owlbot.py + +env_vars: { + key: "PRODUCT_AREA_LABEL" + value: "observability" +} +env_vars: { + key: "PRODUCT_LABEL" + value: "logging" +} +env_vars: { + key: "LANGUAGE_LABEL" + value: "java" +} + +################################################### + diff --git a/java-logging/.kokoro/continuous/common.cfg b/java-logging/.kokoro/continuous/common.cfg new file mode 100644 index 000000000000..72126fd24a6a --- /dev/null +++ b/java-logging/.kokoro/continuous/common.cfg @@ -0,0 +1,45 @@ +# 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-logging/.kokoro/trampoline.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-logging/.kokoro/build.sh" +} + +env_vars: { + key: "JOB_TYPE" + value: "test" +} + + +############################################# +# this section merged from .kokoro/common_env_vars.cfg using owlbot.py + +env_vars: { + key: "PRODUCT_AREA_LABEL" + value: "observability" +} +env_vars: { + key: "PRODUCT_LABEL" + value: "logging" +} +env_vars: { + key: "LANGUAGE_LABEL" + value: "java" +} + +################################################### + diff --git a/java-logging/.kokoro/continuous/java8.cfg b/java-logging/.kokoro/continuous/java8.cfg new file mode 100644 index 000000000000..495cc7bacd63 --- /dev/null +++ b/java-logging/.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/java-logging/.kokoro/continuous/propose_release.sh b/java-logging/.kokoro/continuous/propose_release.sh new file mode 100755 index 000000000000..73fc6561fc41 --- /dev/null +++ b/java-logging/.kokoro/continuous/propose_release.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail + +export NPM_CONFIG_PREFIX=/home/node/.npm-global + +if [ -f ${KOKORO_KEYSTORE_DIR}/73713_github-magic-proxy-url-release-please ]; then + # Groom the release PR as new commits are merged. + npx release-please release-pr --token=${KOKORO_KEYSTORE_DIR}/73713_github-magic-proxy-token-release-please \ + --repo-url=googleapis/java-logging \ + --package-name="logging" \ + --api-url=${KOKORO_KEYSTORE_DIR}/73713_github-magic-proxy-url-release-please \ + --proxy-key=${KOKORO_KEYSTORE_DIR}/73713_github-magic-proxy-key-release-please \ + --release-type=java-yoshi +fi diff --git a/java-logging/.kokoro/dependencies.sh b/java-logging/.kokoro/dependencies.sh new file mode 100755 index 000000000000..bd8960246f66 --- /dev/null +++ b/java-logging/.kokoro/dependencies.sh @@ -0,0 +1,59 @@ +#!/bin/bash +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eo pipefail +shopt -s nullglob + +## Get the directory of the build script +scriptDir=$(realpath $(dirname "${BASH_SOURCE[0]}")) +## cd to the parent directory, i.e. the root of the git repo +cd ${scriptDir}/.. + +# include common functions +source ${scriptDir}/common.sh + +# Print out Java +java -version +echo $JOB_TYPE + +function determineMavenOpts() { + local javaVersion=$( + # filter down to the version line, then pull out the version between quotes, + # then trim the version number down to its minimal number (removing any + # update or suffix number). + java -version 2>&1 | grep "version" \ + | sed -E 's/^.*"(.*?)".*$/\1/g' \ + | sed -E 's/^(1\.[0-9]\.0).*$/\1/g' + ) + + if [[ $javaVersion == 17* ]] + then + # MaxPermSize is no longer supported as of jdk 17 + echo -n "-Xmx1024m" + else + echo -n "-Xmx1024m -XX:MaxPermSize=128m" + fi +} + +export MAVEN_OPTS=$(determineMavenOpts) + +# this should run maven enforcer +retry_with_backoff 3 10 \ + mvn install -B -V -ntp \ + -DskipTests=true \ + -Dmaven.javadoc.skip=true \ + -Dclirr.skip=true + +mvn -B dependency:analyze -DfailOnWarning=true diff --git a/java-logging/.kokoro/environment/appengine_flex/common.cfg b/java-logging/.kokoro/environment/appengine_flex/common.cfg new file mode 100644 index 000000000000..e1dd4fedac24 --- /dev/null +++ b/java-logging/.kokoro/environment/appengine_flex/common.cfg @@ -0,0 +1,57 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + } +} + + +# Specify which tests to run +env_vars: { + key: "ENVIRONMENT" + value: "appengine_flex" +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "java-logging/.kokoro/trampoline.sh" + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/python-multi" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-logging/.kokoro/environment_tests.sh" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-it-service-account" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "gcloud-devel" +} + +# add labels to help with testgrid filtering +env_vars: { + key: "PRODUCT_AREA_LABEL" + value: "observability" +} +env_vars: { + key: "PRODUCT_LABEL" + value: "logging" +} +env_vars: { + key: "LANGUAGE_LABEL" + value: "java" +} + diff --git a/java-logging/.kokoro/environment/appengine_flex/continuous.cfg b/java-logging/.kokoro/environment/appengine_flex/continuous.cfg new file mode 100644 index 000000000000..8f43917d92fe --- /dev/null +++ b/java-logging/.kokoro/environment/appengine_flex/continuous.cfg @@ -0,0 +1 @@ +# Format: //devtools/kokoro/config/proto/build.proto \ No newline at end of file diff --git a/java-logging/.kokoro/environment/appengine_flex/presubmit.cfg b/java-logging/.kokoro/environment/appengine_flex/presubmit.cfg new file mode 100644 index 000000000000..18a4c35325b8 --- /dev/null +++ b/java-logging/.kokoro/environment/appengine_flex/presubmit.cfg @@ -0,0 +1 @@ +# Format: //devtools/kokoro/config/proto/build.proto diff --git a/java-logging/.kokoro/environment/appengine_standard/common.cfg b/java-logging/.kokoro/environment/appengine_standard/common.cfg new file mode 100644 index 000000000000..5c4b2ccba0d6 --- /dev/null +++ b/java-logging/.kokoro/environment/appengine_standard/common.cfg @@ -0,0 +1,57 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + } +} + + +# Specify which tests to run +env_vars: { + key: "ENVIRONMENT" + value: "appengine_standard" +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "java-logging/.kokoro/trampoline.sh" + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/python-multi" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-logging/.kokoro/environment_tests.sh" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-it-service-account" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "gcloud-devel" +} + +# add labels to help with testgrid filtering +env_vars: { + key: "PRODUCT_AREA_LABEL" + value: "observability" +} +env_vars: { + key: "PRODUCT_LABEL" + value: "logging" +} +env_vars: { + key: "LANGUAGE_LABEL" + value: "java" +} + diff --git a/java-logging/.kokoro/environment/appengine_standard/continuous.cfg b/java-logging/.kokoro/environment/appengine_standard/continuous.cfg new file mode 100644 index 000000000000..8f43917d92fe --- /dev/null +++ b/java-logging/.kokoro/environment/appengine_standard/continuous.cfg @@ -0,0 +1 @@ +# Format: //devtools/kokoro/config/proto/build.proto \ No newline at end of file diff --git a/java-logging/.kokoro/environment/appengine_standard/presubmit.cfg b/java-logging/.kokoro/environment/appengine_standard/presubmit.cfg new file mode 100644 index 000000000000..18a4c35325b8 --- /dev/null +++ b/java-logging/.kokoro/environment/appengine_standard/presubmit.cfg @@ -0,0 +1 @@ +# Format: //devtools/kokoro/config/proto/build.proto diff --git a/java-logging/.kokoro/environment/cloudrun/common.cfg b/java-logging/.kokoro/environment/cloudrun/common.cfg new file mode 100644 index 000000000000..12c4e7f6b817 --- /dev/null +++ b/java-logging/.kokoro/environment/cloudrun/common.cfg @@ -0,0 +1,57 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + } +} + + +# Specify which tests to run +env_vars: { + key: "ENVIRONMENT" + value: "cloudrun" +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "java-logging/.kokoro/trampoline.sh" + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/python-multi" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-logging/.kokoro/environment_tests.sh" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-it-service-account" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "gcloud-devel" +} + +# add labels to help with testgrid filtering +env_vars: { + key: "PRODUCT_AREA_LABEL" + value: "observability" +} +env_vars: { + key: "PRODUCT_LABEL" + value: "logging" +} +env_vars: { + key: "LANGUAGE_LABEL" + value: "java" +} + diff --git a/java-logging/.kokoro/environment/cloudrun/continuous.cfg b/java-logging/.kokoro/environment/cloudrun/continuous.cfg new file mode 100644 index 000000000000..8f43917d92fe --- /dev/null +++ b/java-logging/.kokoro/environment/cloudrun/continuous.cfg @@ -0,0 +1 @@ +# Format: //devtools/kokoro/config/proto/build.proto \ No newline at end of file diff --git a/java-logging/.kokoro/environment/cloudrun/presubmit.cfg b/java-logging/.kokoro/environment/cloudrun/presubmit.cfg new file mode 100644 index 000000000000..18a4c35325b8 --- /dev/null +++ b/java-logging/.kokoro/environment/cloudrun/presubmit.cfg @@ -0,0 +1 @@ +# Format: //devtools/kokoro/config/proto/build.proto diff --git a/java-logging/.kokoro/environment/compute/common.cfg b/java-logging/.kokoro/environment/compute/common.cfg new file mode 100644 index 000000000000..968e69107290 --- /dev/null +++ b/java-logging/.kokoro/environment/compute/common.cfg @@ -0,0 +1,57 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + } +} + + +# Specify which tests to run +env_vars: { + key: "ENVIRONMENT" + value: "compute" +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "java-logging/.kokoro/trampoline.sh" + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/python-multi" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-logging/.kokoro/environment_tests.sh" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-it-service-account" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "gcloud-devel" +} + +# add labels to help with testgrid filtering +env_vars: { + key: "PRODUCT_AREA_LABEL" + value: "observability" +} +env_vars: { + key: "PRODUCT_LABEL" + value: "logging" +} +env_vars: { + key: "LANGUAGE_LABEL" + value: "java" +} + diff --git a/java-logging/.kokoro/environment/compute/continuous.cfg b/java-logging/.kokoro/environment/compute/continuous.cfg new file mode 100644 index 000000000000..8f43917d92fe --- /dev/null +++ b/java-logging/.kokoro/environment/compute/continuous.cfg @@ -0,0 +1 @@ +# Format: //devtools/kokoro/config/proto/build.proto \ No newline at end of file diff --git a/java-logging/.kokoro/environment/compute/presubmit.cfg b/java-logging/.kokoro/environment/compute/presubmit.cfg new file mode 100644 index 000000000000..18a4c35325b8 --- /dev/null +++ b/java-logging/.kokoro/environment/compute/presubmit.cfg @@ -0,0 +1 @@ +# Format: //devtools/kokoro/config/proto/build.proto diff --git a/java-logging/.kokoro/environment/functions/common.cfg b/java-logging/.kokoro/environment/functions/common.cfg new file mode 100644 index 000000000000..ff79f018b931 --- /dev/null +++ b/java-logging/.kokoro/environment/functions/common.cfg @@ -0,0 +1,57 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + } +} + + +# Specify which tests to run +env_vars: { + key: "ENVIRONMENT" + value: "functions" +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "java-logging/.kokoro/trampoline.sh" + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/python-multi" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-logging/.kokoro/environment_tests.sh" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-it-service-account" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "gcloud-devel" +} + +# add labels to help with testgrid filtering +env_vars: { + key: "PRODUCT_AREA_LABEL" + value: "observability" +} +env_vars: { + key: "PRODUCT_LABEL" + value: "logging" +} +env_vars: { + key: "LANGUAGE_LABEL" + value: "java" +} + diff --git a/java-logging/.kokoro/environment/functions/continuous.cfg b/java-logging/.kokoro/environment/functions/continuous.cfg new file mode 100644 index 000000000000..8f43917d92fe --- /dev/null +++ b/java-logging/.kokoro/environment/functions/continuous.cfg @@ -0,0 +1 @@ +# Format: //devtools/kokoro/config/proto/build.proto \ No newline at end of file diff --git a/java-logging/.kokoro/environment/functions/presubmit.cfg b/java-logging/.kokoro/environment/functions/presubmit.cfg new file mode 100644 index 000000000000..18a4c35325b8 --- /dev/null +++ b/java-logging/.kokoro/environment/functions/presubmit.cfg @@ -0,0 +1 @@ +# Format: //devtools/kokoro/config/proto/build.proto diff --git a/java-logging/.kokoro/environment/kubernetes/common.cfg b/java-logging/.kokoro/environment/kubernetes/common.cfg new file mode 100644 index 000000000000..558cd6c4dba6 --- /dev/null +++ b/java-logging/.kokoro/environment/kubernetes/common.cfg @@ -0,0 +1,57 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + } +} + + +# Specify which tests to run +env_vars: { + key: "ENVIRONMENT" + value: "kubernetes" +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "java-logging/.kokoro/trampoline.sh" + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/python-multi" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-logging/.kokoro/environment_tests.sh" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-it-service-account" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "gcloud-devel" +} + +# add labels to help with testgrid filtering +env_vars: { + key: "PRODUCT_AREA_LABEL" + value: "observability" +} +env_vars: { + key: "PRODUCT_LABEL" + value: "logging" +} +env_vars: { + key: "LANGUAGE_LABEL" + value: "java" +} + diff --git a/java-logging/.kokoro/environment/kubernetes/continuous.cfg b/java-logging/.kokoro/environment/kubernetes/continuous.cfg new file mode 100644 index 000000000000..8f43917d92fe --- /dev/null +++ b/java-logging/.kokoro/environment/kubernetes/continuous.cfg @@ -0,0 +1 @@ +# Format: //devtools/kokoro/config/proto/build.proto \ No newline at end of file diff --git a/java-logging/.kokoro/environment/kubernetes/presubmit.cfg b/java-logging/.kokoro/environment/kubernetes/presubmit.cfg new file mode 100644 index 000000000000..18a4c35325b8 --- /dev/null +++ b/java-logging/.kokoro/environment/kubernetes/presubmit.cfg @@ -0,0 +1 @@ +# Format: //devtools/kokoro/config/proto/build.proto diff --git a/java-logging/.kokoro/environment_tests.sh b/java-logging/.kokoro/environment_tests.sh new file mode 100755 index 000000000000..cb2da72035b2 --- /dev/null +++ b/java-logging/.kokoro/environment_tests.sh @@ -0,0 +1,86 @@ +#!/bin/bash +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eox pipefail + +if [[ -z "${ENVIRONMENT:-}" ]]; then + echo "ENVIRONMENT not set. Exiting" + exit 1 +fi + +if [[ -z "${PROJECT_ROOT:-}" ]]; then + PROJECT_ROOT="${KOKORO_ARTIFACTS_DIR}/github/java-logging" +fi + +# make sure submodule is up to date +cd "$PROJECT_ROOT" +git config --global --add safe.directory '*' +git config --global --add safe.directory /tmpfs/src/github/java-logging +git submodule update --init --recursive +cd "${PROJECT_ROOT}/env-tests-logging" + +# Disable buffering, so that the logs stream through. +export PYTHONUNBUFFERED=1 + +# Setup service account credentials. +export GOOGLE_APPLICATION_CREDENTIALS=$KOKORO_GFILE_DIR/secret_manager/java-it-service-account +gcloud auth activate-service-account --key-file=$GOOGLE_APPLICATION_CREDENTIALS + +gcloud config get-value project + +# Setup project id. +gcloud config set project $GOOGLE_CLOUD_PROJECT + +# set a default zone. +gcloud config set compute/zone us-central1-b + +# authenticate docker +gcloud auth configure-docker -q + +# Remove old nox +python3 -m pip uninstall --yes --quiet nox-automation + +# Install nox +python3 -m pip install --upgrade --quiet nox +python3 -m nox --version + +# Install kubectl +if [[ "${ENVIRONMENT}" == "kubernetes" ]]; then + curl -LO https://dl.k8s.io/release/v1.20.0/bin/linux/amd64/kubectl + chmod +x kubectl + mkdir -p ~/.local/bin + mv ./kubectl ~/.local/bin + export PATH=$PATH:~/.local/bin + # install auth plugin + gcloud components install gke-gcloud-auth-plugin -q + export USE_GKE_GCLOUD_AUTH_PLUGIN=True +fi + +# create a unique id for this run +UUID=$(python -c 'import uuid; print(uuid.uuid1())' | head -c 7) +export ENVCTL_ID=ci-$UUID +echo $ENVCTL_ID + +# Run the specified environment test +set +e +python3 -m nox --session "tests(language='java', platform='$ENVIRONMENT')" +TEST_STATUS_CODE=$? + +# destroy resources +echo "cleaning up..." +${PROJECT_ROOT}/env-tests-logging/envctl/envctl java $ENVIRONMENT destroy + +# exit with proper status code +exit $TEST_STATUS_CODE diff --git a/java-logging/.kokoro/nightly/common.cfg b/java-logging/.kokoro/nightly/common.cfg new file mode 100644 index 000000000000..72126fd24a6a --- /dev/null +++ b/java-logging/.kokoro/nightly/common.cfg @@ -0,0 +1,45 @@ +# 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-logging/.kokoro/trampoline.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-logging/.kokoro/build.sh" +} + +env_vars: { + key: "JOB_TYPE" + value: "test" +} + + +############################################# +# this section merged from .kokoro/common_env_vars.cfg using owlbot.py + +env_vars: { + key: "PRODUCT_AREA_LABEL" + value: "observability" +} +env_vars: { + key: "PRODUCT_LABEL" + value: "logging" +} +env_vars: { + key: "LANGUAGE_LABEL" + value: "java" +} + +################################################### + diff --git a/java-logging/.kokoro/nightly/integration.cfg b/java-logging/.kokoro/nightly/integration.cfg new file mode 100644 index 000000000000..5a95c68284c4 --- /dev/null +++ b/java-logging/.kokoro/nightly/integration.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: "integration" +} +# 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: "ENABLE_FLAKYBOT" + value: "true" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "secret_manager/java-it-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-it-service-account" +} + diff --git a/java-logging/.kokoro/nightly/java11-integration.cfg b/java-logging/.kokoro/nightly/java11-integration.cfg new file mode 100644 index 000000000000..6a6ef94eff28 --- /dev/null +++ b/java-logging/.kokoro/nightly/java11-integration.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-public-resources/java11014" +} + +env_vars: { + key: "JOB_TYPE" + value: "integration" +} +# TODO: remove this after we've migrated all tests and scripts +env_vars: { + key: "GCLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "GOOGLE_CLOUD_PROJECT" + value: "gcloud-devel" +} + +env_vars: { + key: "ENABLE_FLAKYBOT" + value: "true" +} + +env_vars: { + key: "GOOGLE_APPLICATION_CREDENTIALS" + value: "secret_manager/java-it-service-account" +} + +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "java-it-service-account" +} + diff --git a/java-logging/.kokoro/nightly/java11.cfg b/java-logging/.kokoro/nightly/java11.cfg new file mode 100644 index 000000000000..709f2b4c73db --- /dev/null +++ b/java-logging/.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/java-logging/.kokoro/nightly/java7.cfg b/java-logging/.kokoro/nightly/java7.cfg new file mode 100644 index 000000000000..cb24f44eea3b --- /dev/null +++ b/java-logging/.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/java-logging/.kokoro/nightly/java8-osx.cfg b/java-logging/.kokoro/nightly/java8-osx.cfg new file mode 100644 index 000000000000..5a4767a0507a --- /dev/null +++ b/java-logging/.kokoro/nightly/java8-osx.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-logging/.kokoro/build.sh" diff --git a/java-logging/.kokoro/nightly/java8-win.cfg b/java-logging/.kokoro/nightly/java8-win.cfg new file mode 100644 index 000000000000..9c07dedcb5ac --- /dev/null +++ b/java-logging/.kokoro/nightly/java8-win.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-logging/.kokoro/build.bat" diff --git a/java-logging/.kokoro/nightly/java8.cfg b/java-logging/.kokoro/nightly/java8.cfg new file mode 100644 index 000000000000..495cc7bacd63 --- /dev/null +++ b/java-logging/.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/java-logging/.kokoro/nightly/samples.cfg b/java-logging/.kokoro/nightly/samples.cfg new file mode 100644 index 000000000000..9761fd8648cb --- /dev/null +++ b/java-logging/.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_FLAKYBOT" + value: "true" +} diff --git a/java-logging/.kokoro/populate-secrets.sh b/java-logging/.kokoro/populate-secrets.sh new file mode 100755 index 000000000000..f52514257ef0 --- /dev/null +++ b/java-logging/.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/java-logging/.kokoro/presubmit/clirr.cfg b/java-logging/.kokoro/presubmit/clirr.cfg new file mode 100644 index 000000000000..ec572442e2e7 --- /dev/null +++ b/java-logging/.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/java-logging/.kokoro/presubmit/common.cfg b/java-logging/.kokoro/presubmit/common.cfg new file mode 100644 index 000000000000..175dd1c83f89 --- /dev/null +++ b/java-logging/.kokoro/presubmit/common.cfg @@ -0,0 +1,54 @@ +# 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-logging/.kokoro/trampoline.sh" + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/java-logging/.kokoro/build.sh" +} + +env_vars: { + key: "JOB_TYPE" + value: "test" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "dpebot_codecov_token" + } + } +} + + +############################################# +# this section merged from .kokoro/common_env_vars.cfg using owlbot.py + +env_vars: { + key: "PRODUCT_AREA_LABEL" + value: "observability" +} +env_vars: { + key: "PRODUCT_LABEL" + value: "logging" +} +env_vars: { + key: "LANGUAGE_LABEL" + value: "java" +} + +################################################### + diff --git a/java-logging/.kokoro/presubmit/dependencies.cfg b/java-logging/.kokoro/presubmit/dependencies.cfg new file mode 100644 index 000000000000..7b28eb7a9de5 --- /dev/null +++ b/java-logging/.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-logging/.kokoro/dependencies.sh" +} diff --git a/java-logging/.kokoro/presubmit/graalvm-native-a.cfg b/java-logging/.kokoro/presubmit/graalvm-native-a.cfg new file mode 100644 index 000000000000..406018c48a5f --- /dev/null +++ b/java-logging/.kokoro/presubmit/graalvm-native-a.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-public-resources/graalvm_sdk_platform_a:3.54.2" # {x-version-update:google-cloud-shared-dependencies:current} +} + +env_vars: { + key: "JOB_TYPE" + value: "graalvm" +} + +# 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" +} + +env_vars: { + key: "IT_SERVICE_ACCOUNT_EMAIL" + value: "it-service-account@gcloud-devel.iam.gserviceaccount.com" +} \ No newline at end of file diff --git a/java-logging/.kokoro/presubmit/graalvm-native-b.cfg b/java-logging/.kokoro/presubmit/graalvm-native-b.cfg new file mode 100644 index 000000000000..60c82d4bf4fc --- /dev/null +++ b/java-logging/.kokoro/presubmit/graalvm-native-b.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-public-resources/graalvm_sdk_platform_b:3.54.2" # {x-version-update:google-cloud-shared-dependencies:current} +} + +env_vars: { + key: "JOB_TYPE" + value: "graalvm" +} + +# 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" +} + +env_vars: { + key: "IT_SERVICE_ACCOUNT_EMAIL" + value: "it-service-account@gcloud-devel.iam.gserviceaccount.com" +} \ No newline at end of file diff --git a/java-logging/.kokoro/presubmit/graalvm-native-c.cfg b/java-logging/.kokoro/presubmit/graalvm-native-c.cfg new file mode 100644 index 000000000000..60982adf5a35 --- /dev/null +++ b/java-logging/.kokoro/presubmit/graalvm-native-c.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-public-resources/graalvm_sdk_platform_c:3.54.2" # {x-version-update:google-cloud-shared-dependencies:current} +} + +env_vars: { + key: "JOB_TYPE" + value: "graalvm" +} + +# 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" +} + +env_vars: { + key: "IT_SERVICE_ACCOUNT_EMAIL" + value: "it-service-account@gcloud-devel.iam.gserviceaccount.com" +} \ No newline at end of file diff --git a/java-logging/.kokoro/presubmit/integration.cfg b/java-logging/.kokoro/presubmit/integration.cfg new file mode 100644 index 000000000000..5864c603e5ad --- /dev/null +++ b/java-logging/.kokoro/presubmit/integration.cfg @@ -0,0 +1,34 @@ +# 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/java-logging/.kokoro/presubmit/java11.cfg b/java-logging/.kokoro/presubmit/java11.cfg new file mode 100644 index 000000000000..709f2b4c73db --- /dev/null +++ b/java-logging/.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/java-logging/.kokoro/presubmit/java7.cfg b/java-logging/.kokoro/presubmit/java7.cfg new file mode 100644 index 000000000000..cb24f44eea3b --- /dev/null +++ b/java-logging/.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/java-logging/.kokoro/presubmit/java8-osx.cfg b/java-logging/.kokoro/presubmit/java8-osx.cfg new file mode 100644 index 000000000000..5a4767a0507a --- /dev/null +++ b/java-logging/.kokoro/presubmit/java8-osx.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-logging/.kokoro/build.sh" diff --git a/java-logging/.kokoro/presubmit/java8-win.cfg b/java-logging/.kokoro/presubmit/java8-win.cfg new file mode 100644 index 000000000000..9c07dedcb5ac --- /dev/null +++ b/java-logging/.kokoro/presubmit/java8-win.cfg @@ -0,0 +1,3 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +build_file: "java-logging/.kokoro/build.bat" diff --git a/java-logging/.kokoro/presubmit/java8.cfg b/java-logging/.kokoro/presubmit/java8.cfg new file mode 100644 index 000000000000..495cc7bacd63 --- /dev/null +++ b/java-logging/.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/java-logging/.kokoro/presubmit/linkage-monitor.cfg b/java-logging/.kokoro/presubmit/linkage-monitor.cfg new file mode 100644 index 000000000000..643c6041418e --- /dev/null +++ b/java-logging/.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-logging/.kokoro/linkage-monitor.sh" +} \ No newline at end of file diff --git a/java-logging/.kokoro/presubmit/lint.cfg b/java-logging/.kokoro/presubmit/lint.cfg new file mode 100644 index 000000000000..6d323c8ae768 --- /dev/null +++ b/java-logging/.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/java-logging/.kokoro/presubmit/samples.cfg b/java-logging/.kokoro/presubmit/samples.cfg new file mode 100644 index 000000000000..01e0960047b8 --- /dev/null +++ b/java-logging/.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/java-logging/.kokoro/readme.sh b/java-logging/.kokoro/readme.sh new file mode 100755 index 000000000000..0e4ce5bf1f97 --- /dev/null +++ b/java-logging/.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-logging + +# 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-logging \ + --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/java-logging/.kokoro/trampoline.sh b/java-logging/.kokoro/trampoline.sh new file mode 100644 index 000000000000..8b69b793c9ec --- /dev/null +++ b/java-logging/.kokoro/trampoline.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# Copyright 2018 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +set -eo pipefail +# Always run the cleanup script, regardless of the success of bouncing into +# the container. +function cleanup() { + chmod +x ${KOKORO_GFILE_DIR}/trampoline_cleanup.sh + ${KOKORO_GFILE_DIR}/trampoline_cleanup.sh + echo "cleanup"; +} +trap cleanup EXIT + +$(dirname $0)/populate-secrets.sh # Secret Manager secrets. +python3 "${KOKORO_GFILE_DIR}/trampoline_v1.py" diff --git a/java-logging/.readme-partials.yaml b/java-logging/.readme-partials.yaml new file mode 100644 index 000000000000..27cf6092f535 --- /dev/null +++ b/java-logging/.readme-partials.yaml @@ -0,0 +1,243 @@ +custom_content: | + #### Creating an authorized service object + + To make requests to Cloud Logging, you must create a service object with valid credentials. + You can then make API calls by calling methods on the Logging service object. + You can obtain credentials by using [Application Default Credentials](https://developers.google.com/identity/protocols/application-default-credentials). + Or you can use a [Service Account](https://cloud.google.com/iam/docs/service-accounts) which is a recommended way to obtain credentials. + The credentials can be automatically inferred from your [environment](https://cloud.google.com/docs/authentication/getting-started#setting_the_environment_variable). + Then you only need the following code to create your service object: + + ```java + import com.google.cloud.logging.Logging; + import com.google.cloud.logging.LoggingOptions; + + LoggingOptions options = LoggingOptions.getDefaultInstance(); + try(Logging logging = options.getService()) { + // use logging here + } + ``` + + For other options, see the [Authentication](https://github.com/googleapis/google-cloud-java#authentication) page. + The service object should be granted permissions to make API calls. + Each API call describes the permissions under Authorized Scopes section. + See [Logging API](https://cloud.google.com/logging/docs/reference/v2/rest) to find the required list of permissions or consult with [Access control guide](https://cloud.google.com/logging/docs/access-control) for predefined IAM roles that can be granted to the Logging service object. + + #### Creating a metric + With Logging you can create logs-based metrics. Logs-based metrics allow to keep track of the number + of log messages associated to specific events. Add the following imports at the top of your file: + + ```java + import com.google.cloud.logging.Metric; + import com.google.cloud.logging.MetricInfo; + ``` + + Then, to create the metric, use the following code: + + ```java + MetricInfo metricInfo = MetricInfo.newBuilder("test-metric", "severity >= ERROR") + .setDescription("Log entries with severity higher or equal to ERROR") + .build(); + logging.create(metricInfo); + ``` + + #### Writing log entries + For an interactive tutorial click + + [![Guide Me](_static/guide-me.svg)](https://console.cloud.google.com/?walkthrough_id=logging__logging-java) + + With Logging you can also write custom log entries. Add the following imports at the top of your + file: + + ```java + import com.google.cloud.MonitoredResource; + import com.google.cloud.logging.LogEntry; + import com.google.cloud.logging.Logging; + import com.google.cloud.logging.Payload.StringPayload; + + import java.util.Collections; + ``` + + Then, to write the log entries, use the following code: + + ```java + LogEntry firstEntry = LogEntry.newBuilder(StringPayload.of("message")) + .setLogName("test-log") + .setResource(MonitoredResource.newBuilder("global") + .addLabel("project_id", options.getProjectId()) + .build()) + .build(); + logging.write(Collections.singleton(firstEntry)); + ``` + + The library supports writing log entries synchronously and asynchronously. + In the synchronous mode each call to `write()` method results in a consequent call to Logging API to write a log entry. + In the asynchronous mode the call(s) to Logging API takes place asynchronously and few calls to `write()` method may be batched together to compose a single call to Logging API. + The default mode of writing is asynchronous. + It can be configured in the `java.util.logging` handler [configuration file](https://cloud.google.com/logging/docs/setup/java#javautillogging_configuration): + + ``` + com.google.cloud.logging.LoggingHandler.synchronicity=SYNC + ``` + + or in the code after initiating an instance of `Logging` by calling: + + ```java + logging.setWriteSynchronicity(Synchronicity.SYNC); + ``` + + NOTE: + > Writing log entries asynchronously in some Google Cloud managed environments (e.g. Cloud Functions) + > may lead to unexpected results such as absense of expected log entries or abnormal program execution. + > To avoid these unexpected results, it is recommended to use synchronous mode. + + #### Controlling the batching settings + As mentioned before, in the asynchronous mode the call(s) to Logging API takes place asynchronously and few calls to `write()` + method may be batched together to compose a single call to Logging API. In order to control the batching settings, the `LoggingOptions` + is enhanced with `BatchingSettings` which can be set as shown in example below: + + ```java + import com.google.api.gax.batching.BatchingSettings; + import com.google.api.gax.batching.FlowControlSettings; + import com.google.api.gax.batching.FlowController; + + LoggingOptions actual = + LoggingOptions.newBuilder() + .setBatchingSettings( + BatchingSettings.newBuilder() + .setIsEnabled(true) + .setElementCountThreshold(1000L) + .setRequestByteThreshold(1048576L) + .setDelayThreshold(Duration.ofMillis(50L)) + .setFlowControlSettings( + FlowControlSettings.newBuilder() + .setMaxOutstandingElementCount(100000L) + .setMaxOutstandingRequestBytes(10485760L) + .setLimitExceededBehavior( + FlowController.LimitExceededBehavior.ThrowException) + .build()) + .build()) + .setProjectId('Your project ID') + .build(); + ``` + + You can find more information about batching parameters see [BatchingSettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.batching.BatchingSettings). + + #### Listing log entries + + With Logging you can also list log entries that have been previously written. Add the following + imports at the top of your file: + + ```java + import com.google.api.gax.paging.Page; + import com.google.cloud.logging.LogEntry; + import com.google.cloud.logging.Logging.EntryListOption; + ``` + + Then, to list the log entries, use the following code: + + ``` java + Page entries = logging.listLogEntries( + EntryListOption.filter("logName=projects/" + options.getProjectId() + "/logs/test-log")); + while (entries != null) { + for (LogEntry logEntry : entries.iterateAll()) { + System.out.println(logEntry); + } + entries = entries.getNextPage(); + } + ``` + #### Add a Cloud Logging handler to a logger + + You can also register a `LoggingHandler` to a `java.util.logging.Logger` that publishes log entries + to Cloud Logging. Given the following logger: + + ```java + private final static Logger LOGGER = Logger.getLogger(MyClass.class.getName()); + ``` + + You can register a `LoggingHandler` with the code: + + ```java + LoggingHandler.addHandler(LOGGER, new LoggingHandler()); + ``` + + After that, logs generated using `LOGGER` will be also directed to Cloud Logging. + + Notice that you can also register a `LoggingHandler` via the `logging.properties` configuration + file. Adding, for instance, the following line: + + ``` + com.google.cloud.examples.logging.snippets.AddLoggingHandler.handlers=com.google.cloud.logging.LoggingHandler + ``` + + #### Alternative way to ingest logs in Google Cloud managed environments + + If you use Java logger with the Cloud Logging Handler, you can configure the handler to output logs to `stdout` using + the [structured logging Json format](https://cloud.google.com/logging/docs/structured-logging#special-payload-fields). + To do this, add `com.google.cloud.logging.LoggingHandler.redirectToStdout=true` to the logger configuration file. + You can use this configuration when running applications in Google Cloud managed environments such as AppEngine, Cloud Run, + Cloud Function or GKE. The logger agent installed on these environments can capture STDOUT and ingest it into Cloud Logging. + The agent can parse structured logs printed to STDOUT and capture additional log metadata beside the log payload. + The parsed information includes severity, source location, user labels, http request and tracing information. + + #### Auto-population of log entrys' metadata + + LogEntry object metadata information such as [monitored resource](https://cloud.google.com/logging/docs/reference/v2/rest/v2/MonitoredResource), + [Http request](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry#HttpRequest) or + [source location](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry#LogEntrySourceLocation) + are automatically populated with information that the library retrieves from the execution context. + The library populates only empty (set to `null`) LogEntry fields. + This behavior in the `Logging` instance can be opted out via `LoggingOptions`. + Call `LoggingOptions.Builder.setAutoPopulateMetadata(false)` to configure logging options to opt-out the metadata auto-population. + Cloud Logging handler can be configured to opt-out automatic population of the metadata using the logger configuration. + To disable the metadata auto-population add `com.google.cloud.logging.LoggingHandler.autoPopulateMetadata=false` + to the logger configuration file. + + The auto-population logic populates source location _only_ for log entries with `Severity.DEBUG` severity. + The execution context of the Http request and tracing information is maintained by `ContextHandler` class. + The context is managed in the scope of the thread. + If you do not use thread pools for multi-threading the `ContextHandler` can be configured to propagate the context + to the scope of the child threads. + To enable this add `com.google.cloud.logging.ContextHandler.useInheritedContext=true` to the logger configuration file. + The library provides two methods to update the context: + + * Manually set the context. You can use the following methods of the `Context.Builder` to set the context information. + Use the method `setRequest()` to setup the `HttpRequest` instance or `setRequestUrl()`, `setRequestMethod()`, + `setReferer() `, `setRemoteIp()` and `setServerIp()` to setup the fields of the `HttpRequest`. + The trace and span Ids can be set directly using `setTraceId()` and `setSpanId()` respectively. + Alternatively it can be parsed from the W3C tracing context header using `loadW3CTraceParentContext()` or + from the Google Cloud tracing context header using `loadCloudTraceContext()`. + + ```java + Context context = Context.newBuilder().setHttpRequest(request).setTrace(traceId).setSpanId(spanId).build(); + (new ContextHandler()).setCurrentContext(context); + ``` + + * Using [servlet initializer](https://github.com/googleapis/java-logging-servlet-initializer). + If your application uses a Web server based on Jakarta servlets (e.g. Jetty or Tomcat), you can add the servlet initializer + package to your WAR. The package implements a service provider interface (SPI) for + [javax.servlet.ServletContainerInitializer](https://docs.oracle.com/javaee/6/api/javax/servlet/ServletContainerInitializer.html) + and filters all servlet requests to automatically capture the execution context of the servlet request and store it using + `ContextHandler` class. The stored `Context` class instances are used to populate Http request and tracing information. + If you use Maven, to use the servlet initializer add the following dependency to your BOM: + + ```xml + + com.google.cloud + google-cloud-logging-servlet-initializer + + ``` + #### Population of Trace/Span ID fields in a LogEntry + Cloud Logging libraries use [trace fields within LogEntry](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry#FIELDS.trace) to capture trace contexts, which enables the [correlation of logs and traces](https://cloud.google.com/logging/docs/view/correlate-logs), and distributed tracing troubleshooting. + These tracing fields, including [trace](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry#FIELDS.trace), [spanId](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry#FIELDS.span_id), and [traceSampled](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry#FIELDS.trace_sampled), define the trace context for a `LogEntry`. + + Tracing information set manually takes precedence over information set by the following methods: + + * Auto-populate Trace/Span ID from OpenTelemetry Context + If you are using OpenTelemetry and there is an active span in the OpenTelemetry Context, the `trace`, `span_id`, and `trace_sampled` fields in the log entry are populated from the active span. More information about OpenTelemetry can be found [here](https://opentelemetry.io/docs/languages/java/). + + * Use the [servlet initializer](https://github.com/googleapis/java-logging-servlet-initializer) to Populate Trace/Span ID from HTTP Headers + If trace/span Id are not manually set or auto-populated from OpenTelemetry context, you can use the [servlet initializer](https://github.com/googleapis/java-logging-servlet-initializer) to populate trace/span Id from HTTP headers. + This package filters all servlet requests to automatically capture the execution context of the servlet request and stores it by using ContextHandler class. Http request and trace/span Id information are populated from the stored Context class instances. + Using this method, trace/span Id can be automatically populated from either the [W3C Traceparent](https://www.w3.org/TR/trace-context) or [X-Cloud-Trace-Context](https://cloud.google.com/trace/docs/trace-context#legacy-http-header) headers. + diff --git a/java-logging/.repo-metadata.json b/java-logging/.repo-metadata.json new file mode 100644 index 000000000000..e22a39fb0050 --- /dev/null +++ b/java-logging/.repo-metadata.json @@ -0,0 +1,19 @@ +{ + "api_shortname": "logging", + "name_pretty": "Cloud Logging", + "product_documentation": "https://cloud.google.com/logging/docs", + "api_description": "allows you to store, search, analyze, monitor, and alert on log data and events from Google Cloud and Amazon Web Services. Using the BindPlane service, you can also collect this data from over 150 common application components, on-premises systems, and hybrid cloud systems. BindPlane is included with your Google Cloud project at no additional cost.", + "client_documentation": "https://cloud.google.com/java/docs/reference/google-cloud-logging/latest/history", + "release_level": "stable", + "transport": "grpc", + "language": "java", + "repo": "googleapis/google-cloud-java", + "repo_short": "java-logging", + "distribution_name": "com.google.cloud:google-cloud-logging", + "api_id": "logging.googleapis.com", + "library_type": "GAPIC_COMBO", + "requires_billing": true, + "codeowner_team": "@googleapis/api-logging @googleapis/yoshi-java @googleapis/api-logging-partners", + "issue_tracker": "https://issuetracker.google.com/savedsearches/559764", + "recommended_package": "com.google.cloud.logging" +} \ No newline at end of file diff --git a/java-logging/CHANGELOG.md b/java-logging/CHANGELOG.md new file mode 100644 index 000000000000..b7587b85868b --- /dev/null +++ b/java-logging/CHANGELOG.md @@ -0,0 +1,1527 @@ +# Changelog + +## [3.23.9](https://github.com/googleapis/java-logging/compare/v3.23.8...v3.23.9) (2025-12-11) + + +### Bug Fixes + +* **deps:** Update the Java code generator (gapic-generator-java) to 2.64.2 ([fcb7ec1](https://github.com/googleapis/java-logging/commit/fcb7ec1ba7ae7c9a041d68c76e7b72a7e0861cf7)) + + +### Dependencies + +* Update dependency com.google.cloud:sdk-platform-java-config to v3.54.2 ([#1897](https://github.com/googleapis/java-logging/issues/1897)) ([ab9862f](https://github.com/googleapis/java-logging/commit/ab9862f655bc89fa3e4e381567dcd0a9d8afdbf9)) +* Update googleapis/sdk-platform-java action to v2.64.2 ([#1898](https://github.com/googleapis/java-logging/issues/1898)) ([5860f51](https://github.com/googleapis/java-logging/commit/5860f516596686ef3054969b8c69de7eb48629e3)) + +## [3.23.8](https://github.com/googleapis/java-logging/compare/v3.23.7...v3.23.8) (2025-11-13) + + +### Bug Fixes + +* **deps:** Update the Java code generator (gapic-generator-java) to 2.64.1 ([9187dcd](https://github.com/googleapis/java-logging/commit/9187dcd1314a6be4df8f8c6eed95092724c6da69)) + + +### Dependencies + +* Update dependency com.google.cloud:sdk-platform-java-config to v3.54.1 ([#1883](https://github.com/googleapis/java-logging/issues/1883)) ([acc56db](https://github.com/googleapis/java-logging/commit/acc56db1ea0389ca91a09e435662b802db63abe6)) +* Update googleapis/sdk-platform-java action to v2.64.1 ([#1882](https://github.com/googleapis/java-logging/issues/1882)) ([abdd374](https://github.com/googleapis/java-logging/commit/abdd37434c76f615cdc9affb5d770970fbcbbf72)) + +## [3.23.7](https://github.com/googleapis/java-logging/compare/v3.23.6...v3.23.7) (2025-10-20) + + +### Bug Fixes + +* **deps:** Update the Java code generator (gapic-generator-java) to 2.63.0 ([385a1dc](https://github.com/googleapis/java-logging/commit/385a1dc67fcdd8706238ba2f95f694bbb647f5f8)) + + +### Dependencies + +* Update dependency com.google.cloud:sdk-platform-java-config to v3.53.0 ([#1875](https://github.com/googleapis/java-logging/issues/1875)) ([b79fd2b](https://github.com/googleapis/java-logging/commit/b79fd2b0cd2c358e3d3e69ddc76fcbfa16a47b5b)) + +## [3.23.6](https://github.com/googleapis/java-logging/compare/v3.23.5...v3.23.6) (2025-10-08) + + +### Bug Fixes + +* **deps:** Update the Java code generator (gapic-generator-java) to 2.62.3 ([5d5d8a7](https://github.com/googleapis/java-logging/commit/5d5d8a76c58c3329f90e4fa84f5e81a1d3296894)) + + +### Dependencies + +* Update dependency com.google.cloud:sdk-platform-java-config to v3.52.3 ([#1869](https://github.com/googleapis/java-logging/issues/1869)) ([94405fa](https://github.com/googleapis/java-logging/commit/94405fa929c48db114dd10ae39a0f3e520865bbf)) +* Update googleapis/sdk-platform-java action to v2.62.3 ([#1868](https://github.com/googleapis/java-logging/issues/1868)) ([cac5cd9](https://github.com/googleapis/java-logging/commit/cac5cd99e6a1738100248c9d235f4fa2987967d0)) + +## [3.23.5](https://github.com/googleapis/java-logging/compare/v3.23.4...v3.23.5) (2025-09-24) + + +### Bug Fixes + +* **deps:** Update the Java code generator (gapic-generator-java) to 2.62.2 ([eeca440](https://github.com/googleapis/java-logging/commit/eeca440da06c24afc07e669f6f087246d91cd933)) + + +### Dependencies + +* Update dependency com.google.cloud:sdk-platform-java-config to v3.52.2 ([#1858](https://github.com/googleapis/java-logging/issues/1858)) ([0252352](https://github.com/googleapis/java-logging/commit/0252352ca34dd494c4471f3a90391df762d676df)) + +## [3.23.4](https://github.com/googleapis/java-logging/compare/v3.23.3...v3.23.4) (2025-09-11) + + +### Bug Fixes + +* **deps:** Update the Java code generator (gapic-generator-java) to 2.62.1 ([1438bff](https://github.com/googleapis/java-logging/commit/1438bff5bc7028fbf125895f0bdd2bb50490effa)) + + +### Dependencies + +* Update dependency com.google.cloud:sdk-platform-java-config to v3.52.1 ([#1853](https://github.com/googleapis/java-logging/issues/1853)) ([c21a635](https://github.com/googleapis/java-logging/commit/c21a635f054b1cd8a6e5aea7450017af85ba03c7)) +* Update googleapis/sdk-platform-java action to v2.62.1 ([#1855](https://github.com/googleapis/java-logging/issues/1855)) ([b6ce498](https://github.com/googleapis/java-logging/commit/b6ce4988391dba73e019aa9f597ce6cc23f81a8c)) + +## [3.23.3](https://github.com/googleapis/java-logging/compare/v3.23.2...v3.23.3) (2025-08-20) + + +### Dependencies + +* Update dependency com.google.cloud:sdk-platform-java-config to v3.52.0 ([#1848](https://github.com/googleapis/java-logging/issues/1848)) ([162ef56](https://github.com/googleapis/java-logging/commit/162ef563793270c236ecf7ca2524ad3b560d7a12)) + +## [3.23.2](https://github.com/googleapis/java-logging/compare/v3.23.1...v3.23.2) (2025-08-05) + + +### Bug Fixes + +* **deps:** Update the Java code generator (gapic-generator-java) to 2.61.0 ([0a21b83](https://github.com/googleapis/java-logging/commit/0a21b83377e6e6a2f4cf98149424a47dcd490c1c)) + + +### Dependencies + +* Update dependency com.google.cloud:sdk-platform-java-config to v3.51.0 ([#1843](https://github.com/googleapis/java-logging/issues/1843)) ([975d8ae](https://github.com/googleapis/java-logging/commit/975d8aeca38ff2f2f8317df93a661910969c5fc1)) + +## [3.23.1](https://github.com/googleapis/java-logging/compare/v3.23.0...v3.23.1) (2025-07-28) + + +### Bug Fixes + +* **deps:** Update the Java code generator (gapic-generator-java) to 2.60.2 ([6a268f8](https://github.com/googleapis/java-logging/commit/6a268f8dbb33b38fa5e4d35d8dfcd196f8fcf9db)) + + +### Dependencies + +* Update dependency com.google.cloud:sdk-platform-java-config to v3.50.2 ([#1834](https://github.com/googleapis/java-logging/issues/1834)) ([2e46f6e](https://github.com/googleapis/java-logging/commit/2e46f6ef44278af5031167106c216dcdb0a16357)) + +## [3.23.0](https://github.com/googleapis/java-logging/compare/v3.22.6...v3.23.0) (2025-07-11) + + +### Features + +* Next release from main branch is 3.23.0 ([#1826](https://github.com/googleapis/java-logging/issues/1826)) ([f0ef15f](https://github.com/googleapis/java-logging/commit/f0ef15f609a3400460bd8074bdd05014cc388743)) + + +### Dependencies + +* Update dependency com.google.cloud:sdk-platform-java-config to v3.50.1 ([#1828](https://github.com/googleapis/java-logging/issues/1828)) ([44c3094](https://github.com/googleapis/java-logging/commit/44c3094e23450f1a8e6bb397f209b17cf37a4345)) + +## [3.22.6](https://github.com/googleapis/java-logging/compare/v3.22.5...v3.22.6) (2025-06-25) + + +### Bug Fixes + +* Regenerate gapic yaml and service yaml for logging by augmentation configs ([9023895](https://github.com/googleapis/java-logging/commit/9023895fd56381c1f4309843a269975763a89d40)) + + +### Dependencies + +* Update dependency com.google.cloud:sdk-platform-java-config to v3.50.0 ([#1821](https://github.com/googleapis/java-logging/issues/1821)) ([af4edc5](https://github.com/googleapis/java-logging/commit/af4edc5b1399b3563d9cf07e171c4281fde2bb79)) +* Update googleapis/sdk-platform-java action to v2.60.0 ([#1822](https://github.com/googleapis/java-logging/issues/1822)) ([0a96dd5](https://github.com/googleapis/java-logging/commit/0a96dd52dc1594767b7dd60da99a17bac8ac14ba)) + +## [3.22.5](https://github.com/googleapis/java-logging/compare/v3.22.4...v3.22.5) (2025-06-05) + + +### Bug Fixes + +* **deps:** Update the Java code generator (gapic-generator-java) to 2.59.0 ([f2362fb](https://github.com/googleapis/java-logging/commit/f2362fb4c05d34fda4a1c9788ea87822ac887d9e)) + + +### Dependencies + +* Update dependency com.google.cloud:sdk-platform-java-config to v3.49.0 ([#1813](https://github.com/googleapis/java-logging/issues/1813)) ([c15da84](https://github.com/googleapis/java-logging/commit/c15da84716d6d554ae26919412e8d4313fd980bc)) + +## [3.22.4](https://github.com/googleapis/java-logging/compare/v3.22.3...v3.22.4) (2025-05-20) + + +### Bug Fixes + +* **deps:** Update the Java code generator (gapic-generator-java) to 2.58.0 ([45b4878](https://github.com/googleapis/java-logging/commit/45b4878eeec35f8c19a3cd3cd33331e9ece6b5c6)) + + +### Dependencies + +* Update dependency com.google.cloud:sdk-platform-java-config to v3.48.0 ([#1808](https://github.com/googleapis/java-logging/issues/1808)) ([6327c51](https://github.com/googleapis/java-logging/commit/6327c51f3a8ecfb7af678c8c040b066e7f938863)) +* Update googleapis/sdk-platform-java action to v2.58.0 ([#1806](https://github.com/googleapis/java-logging/issues/1806)) ([b94da77](https://github.com/googleapis/java-logging/commit/b94da779d8263ce6c1845bb8baa6a9e9aedc2ccf)) + +## [3.22.3](https://github.com/googleapis/java-logging/compare/v3.22.2...v3.22.3) (2025-05-06) + + +### Bug Fixes + +* **deps:** Update the Java code generator (gapic-generator-java) to 2.56.3 ([844f4fa](https://github.com/googleapis/java-logging/commit/844f4fa48f878a7da77ff9ab13652dc93f079920)) + + +### Dependencies + +* Update dependency com.google.cloud:sdk-platform-java-config to v3.46.3 ([#1801](https://github.com/googleapis/java-logging/issues/1801)) ([d7aa7bc](https://github.com/googleapis/java-logging/commit/d7aa7bcd4e1235491f30ab4dd88ff80c07966185)) +* Update dependency com.google.cloud:sdk-platform-java-config to v3.47.0 ([#1803](https://github.com/googleapis/java-logging/issues/1803)) ([5967ffe](https://github.com/googleapis/java-logging/commit/5967ffe459d9e1d00a36727ae433303005bf15d8)) +* Update googleapis/sdk-platform-java action to v2.57.0 ([#1804](https://github.com/googleapis/java-logging/issues/1804)) ([e9a27ec](https://github.com/googleapis/java-logging/commit/e9a27ec2a1b148c40ea13d541b4c7a96cef07901)) + +## [3.22.2](https://github.com/googleapis/java-logging/compare/v3.22.1...v3.22.2) (2025-04-25) + + +### Dependencies + +* Update dependency com.google.cloud:sdk-platform-java-config to v3.46.2 ([#1796](https://github.com/googleapis/java-logging/issues/1796)) ([1f88271](https://github.com/googleapis/java-logging/commit/1f882712aeb7e48a2339ffbad783813e11e74401)) + +## [3.22.1](https://github.com/googleapis/java-logging/compare/v3.22.0...v3.22.1) (2025-04-25) + + +### Bug Fixes + +* **deps:** Update the Java code generator (gapic-generator-java) to 2.56.2 ([7cce5b5](https://github.com/googleapis/java-logging/commit/7cce5b509c904209f0a92e239e836afac4169ec4)) + +## [3.22.0](https://github.com/googleapis/java-logging/compare/v3.21.4...v3.22.0) (2025-03-18) + + +### Features + +* Next release from main branch is 3.22.0 ([#1776](https://github.com/googleapis/java-logging/issues/1776)) ([7736073](https://github.com/googleapis/java-logging/commit/773607312a1dc6f5f569f2518587ffba4743bb43)) + + +### Bug Fixes + +* **deps:** Update the Java code generator (gapic-generator-java) to 2.55.1 ([dd25992](https://github.com/googleapis/java-logging/commit/dd259929b01a2dd50ca2d09005fedf1631b97877)) + + +### Dependencies + +* Update dependency com.google.cloud:sdk-platform-java-config to v3.45.1 ([#1779](https://github.com/googleapis/java-logging/issues/1779)) ([a643ab0](https://github.com/googleapis/java-logging/commit/a643ab03600fa25cee41df23b2daf65c0fc4e70a)) +* Update googleapis/sdk-platform-java action to v2.55.1 ([#1780](https://github.com/googleapis/java-logging/issues/1780)) ([505557e](https://github.com/googleapis/java-logging/commit/505557e1b9b14c910aec402335bf9fc9ca96975c)) + +## [3.21.4](https://github.com/googleapis/java-logging/compare/v3.21.3...v3.21.4) (2025-02-26) + + +### Bug Fixes + +* **deps:** Update the Java code generator (gapic-generator-java) to 2.54.0 ([67fa9fb](https://github.com/googleapis/java-logging/commit/67fa9fbbc48dd8df9c176ba0bb3d1acf6b975bfc)) + + +### Dependencies + +* Update dependency com.google.cloud:sdk-platform-java-config to v3.44.0 ([#1768](https://github.com/googleapis/java-logging/issues/1768)) ([a69e699](https://github.com/googleapis/java-logging/commit/a69e6990e5cc7ab920382599510bb14f29a12d7d)) +* Update googleapis/sdk-platform-java action to v2.54.0 ([#1762](https://github.com/googleapis/java-logging/issues/1762)) ([d50a8d2](https://github.com/googleapis/java-logging/commit/d50a8d2fbef588138b4d47cbd3440d7217d690b0)) + +## [3.21.3](https://github.com/googleapis/java-logging/compare/v3.21.2...v3.21.3) (2025-02-12) + + +### Bug Fixes + +* **deps:** Update the Java code generator (gapic-generator-java) to 2.52.0 ([888a885](https://github.com/googleapis/java-logging/commit/888a885dc229960c26fae5098c4b43b7b0ef4fa6)) + + +### Dependencies + +* Update dependency com.google.cloud:sdk-platform-java-config to v3.43.0 ([#1763](https://github.com/googleapis/java-logging/issues/1763)) ([e0f9f27](https://github.com/googleapis/java-logging/commit/e0f9f271be10cec0d9400bc464bcc0a175078d97)) + +## [3.21.2](https://github.com/googleapis/java-logging/compare/v3.21.1...v3.21.2) (2025-01-29) + + +### Dependencies + +* Update dependency com.google.cloud:sdk-platform-java-config to v3.42.0 ([#1755](https://github.com/googleapis/java-logging/issues/1755)) ([d404381](https://github.com/googleapis/java-logging/commit/d4043815246423efe542356dc50ba663092b8df0)) +* Update dependency io.opentelemetry:opentelemetry-bom to v1.46.0 ([#1747](https://github.com/googleapis/java-logging/issues/1747)) ([5ef2853](https://github.com/googleapis/java-logging/commit/5ef285387d63b79bff7e43b233c7f9770f378dba)) +* Update googleapis/sdk-platform-java action to v2.52.0 ([#1753](https://github.com/googleapis/java-logging/issues/1753)) ([3dcf86a](https://github.com/googleapis/java-logging/commit/3dcf86adc3e1ef3d5866cd043149808601c213b8)) + +## [3.21.1](https://github.com/googleapis/java-logging/compare/v3.21.0...v3.21.1) (2025-01-13) + + +### Bug Fixes + +* **deps:** Update the Java code generator (gapic-generator-java) to 2.51.1 ([705dba2](https://github.com/googleapis/java-logging/commit/705dba2d6c12bd9f9e281c962cfb232ab28b31a9)) + + +### Dependencies + +* Update dependency com.google.cloud:sdk-platform-java-config to v3.41.1 ([#1745](https://github.com/googleapis/java-logging/issues/1745)) ([6a7280d](https://github.com/googleapis/java-logging/commit/6a7280d0851024c1b44457fa7064a7f3d6fc2d5b)) +* Update dependency org.easymock:easymock to v5.5.0 ([#1639](https://github.com/googleapis/java-logging/issues/1639)) ([f559d89](https://github.com/googleapis/java-logging/commit/f559d89bf36201fce609ef752f27baa0c5f6f1c1)) +* Update googleapis/sdk-platform-java action to v2.51.1 ([#1742](https://github.com/googleapis/java-logging/issues/1742)) ([3c7a2c7](https://github.com/googleapis/java-logging/commit/3c7a2c70fd46cc7196ef7b037d6017971e8a020a)) + +## [3.21.0](https://github.com/googleapis/java-logging/compare/v3.20.7...v3.21.0) (2024-12-13) + + +### Features + +* Introduce `java.time` methods ([#1729](https://github.com/googleapis/java-logging/issues/1729)) ([323eb33](https://github.com/googleapis/java-logging/commit/323eb332a65f39c5588cf65ecae0a3454903a1c6)) + + +### Bug Fixes + +* **deps:** Update the Java code generator (gapic-generator-java) to 2.51.0 ([04d8868](https://github.com/googleapis/java-logging/commit/04d886849a4b41fad17f501f2c40ae54e6daa71a)) + + +### Dependencies + +* Update dependency io.opentelemetry:opentelemetry-bom to v1.45.0 ([#1638](https://github.com/googleapis/java-logging/issues/1638)) ([7e007d4](https://github.com/googleapis/java-logging/commit/7e007d4f966ed7e9c75cbf0ce951441052e8735c)) +* Update sdk platform java dependencies ([#1736](https://github.com/googleapis/java-logging/issues/1736)) ([88b4cdf](https://github.com/googleapis/java-logging/commit/88b4cdf71463285e50a815e0635d36301d583e4c)) + +## [3.20.7](https://github.com/googleapis/java-logging/compare/v3.20.6...v3.20.7) (2024-11-18) + + +### Bug Fixes + +* **deps:** Update the Java code generator (gapic-generator-java) to 2.49.0 ([a1ec68d](https://github.com/googleapis/java-logging/commit/a1ec68d539e4d0720fb2cf72314deb4f485f3d4a)) +* **deps:** Update the Java code generator (gapic-generator-java) to 2.50.0 ([afcf63c](https://github.com/googleapis/java-logging/commit/afcf63cc063c4e0f5159c3ac5dbe2d372c335beb)) +* Fixed outdated link to X-Cloud-Trace-Context header description ([#1713](https://github.com/googleapis/java-logging/issues/1713)) ([d474313](https://github.com/googleapis/java-logging/commit/d4743138b9e5c9fd4e9c59b0793028f1e424e6e4)) + + +### Dependencies + +* Update sdk platform java dependencies ([#1725](https://github.com/googleapis/java-logging/issues/1725)) ([531f8c5](https://github.com/googleapis/java-logging/commit/531f8c5089a260840eee7ff97d315307f074f5e6)) + +## [3.20.6](https://github.com/googleapis/java-logging/compare/v3.20.5...v3.20.6) (2024-10-26) + + +### Dependencies + +* Update sdk platform java dependencies ([#1717](https://github.com/googleapis/java-logging/issues/1717)) ([ee9ef91](https://github.com/googleapis/java-logging/commit/ee9ef91a9ebaed9faa5870a29be40b0c1531a226)) + +## [3.20.5](https://github.com/googleapis/java-logging/compare/v3.20.4...v3.20.5) (2024-10-23) + + +### Dependencies + +* Update sdk platform java dependencies ([#1707](https://github.com/googleapis/java-logging/issues/1707)) ([2359040](https://github.com/googleapis/java-logging/commit/23590409f5c4aaff5c741e860fc0916f7ec4c963)) + +## [3.20.4](https://github.com/googleapis/java-logging/compare/v3.20.3...v3.20.4) (2024-10-07) + + +### Bug Fixes + +* **deps:** Update the Java code generator (gapic-generator-java) to 2.47.0 ([90b88ee](https://github.com/googleapis/java-logging/commit/90b88ee70ee84bdcb0af4aced50b5ee61e0a706c)) + + +### Dependencies + +* Update dependency com.google.cloud:sdk-platform-java-config to v3.37.0 ([#1702](https://github.com/googleapis/java-logging/issues/1702)) ([1f7da17](https://github.com/googleapis/java-logging/commit/1f7da17810fa22b8437edc88e4f95b3ed5cb8349)) + +## [3.20.3](https://github.com/googleapis/java-logging/compare/v3.20.2...v3.20.3) (2024-10-01) + + +### Dependencies + +* Update dependency com.google.cloud:sdk-platform-java-config to v3.36.1 ([#1698](https://github.com/googleapis/java-logging/issues/1698)) ([9491512](https://github.com/googleapis/java-logging/commit/94915125fd2425ffba5ef86da0c54af3c1d2c138)) +* Update dependency org.apache.maven.plugins:maven-deploy-plugin to v3.1.3 ([2b6ea70](https://github.com/googleapis/java-logging/commit/2b6ea703aad05e714f5634fbd74e0b9bca0c51f9)) + +## [3.20.2](https://github.com/googleapis/java-logging/compare/v3.20.1...v3.20.2) (2024-09-12) + + +### Dependencies + +* Update dependency com.google.cloud:sdk-platform-java-config to v3.35.0 ([#1683](https://github.com/googleapis/java-logging/issues/1683)) ([31ec2b9](https://github.com/googleapis/java-logging/commit/31ec2b972d5e11e12fe0432f42e3e5b8f23312c6)) + +## [3.20.1](https://github.com/googleapis/java-logging/compare/v3.20.0...v3.20.1) (2024-08-22) + + +### Dependencies + +* Update dependency com.google.cloud:sdk-platform-java-config to v3.34.0 ([#1677](https://github.com/googleapis/java-logging/issues/1677)) ([dbd050c](https://github.com/googleapis/java-logging/commit/dbd050c354cee5272c37dd323358b222cea5e87e)) + +## [3.20.0](https://github.com/googleapis/java-logging/compare/v3.19.0...v3.20.0) (2024-08-02) + + +### Features + +* Enable hermetic library generation ([#1620](https://github.com/googleapis/java-logging/issues/1620)) ([034b9c4](https://github.com/googleapis/java-logging/commit/034b9c42ac8ba12f20dbde9e90ae8e59ea4c5748)) + + +### Dependencies + +* Update dependency com.google.cloud:sdk-platform-java-config to v3.33.0 ([#1664](https://github.com/googleapis/java-logging/issues/1664)) ([cb6de76](https://github.com/googleapis/java-logging/commit/cb6de767ba726a1178b4ebd0b481a4fc2454b910)) + + +### Documentation + +* Documentation update for OpenTelemetry and tracing ([#1657](https://github.com/googleapis/java-logging/issues/1657)) ([e3c6670](https://github.com/googleapis/java-logging/commit/e3c667094170ac7d404addc797facbe997ca51d3)) + +## [3.19.0](https://github.com/googleapis/java-logging/compare/v3.18.0...v3.19.0) (2024-06-26) + + +### Features + +* **logging:** OpenTelemetry trace/span ID integration for Java logging library ([#1596](https://github.com/googleapis/java-logging/issues/1596)) ([67db829](https://github.com/googleapis/java-logging/commit/67db829621fd1c4a876d158fe1afb4927821fa54)) + + +### Dependencies + +* Update dependency com.google.cloud:sdk-platform-java-config to v3.32.0 ([#1649](https://github.com/googleapis/java-logging/issues/1649)) ([cb428d1](https://github.com/googleapis/java-logging/commit/cb428d19a1ea750520d336c9d1042d50f3801f15)) + +## [3.18.0](https://github.com/googleapis/java-logging/compare/v3.17.2...v3.18.0) (2024-06-04) + + +### Features + +* [java] allow passing libraries_bom_version from env ([#1967](https://github.com/googleapis/java-logging/issues/1967)) ([#1615](https://github.com/googleapis/java-logging/issues/1615)) ([dc00cd0](https://github.com/googleapis/java-logging/commit/dc00cd0da891b59f3c22cd7ce281868f5ce8b433)) + + +### Dependencies + +* Update dependency com.google.cloud:sdk-platform-java-config to v3.31.0 ([#1625](https://github.com/googleapis/java-logging/issues/1625)) ([9db8f3b](https://github.com/googleapis/java-logging/commit/9db8f3b948e20fa406f315b670341da2b00f0856)) + +## [3.17.2](https://github.com/googleapis/java-logging/compare/v3.17.1...v3.17.2) (2024-05-16) + + +### Dependencies + +* Update dependency com.google.cloud:sdk-platform-java-config to v3.30.1 ([#1611](https://github.com/googleapis/java-logging/issues/1611)) ([e7a0904](https://github.com/googleapis/java-logging/commit/e7a0904a1faf04b0de400c1778f976494246e39e)) + +## [3.17.1](https://github.com/googleapis/java-logging/compare/v3.17.0...v3.17.1) (2024-05-06) + + +### Dependencies + +* Update actions/checkout action to v4 ([#1570](https://github.com/googleapis/java-logging/issues/1570)) ([ea0db35](https://github.com/googleapis/java-logging/commit/ea0db3579da6e965e778233b3cba4862b3fff65c)) +* Update actions/github-script action to v7 ([#1571](https://github.com/googleapis/java-logging/issues/1571)) ([16d6192](https://github.com/googleapis/java-logging/commit/16d61928b6d4887faebbdd48a694a2edff8cb752)) +* Update actions/setup-java action to v4 ([#1572](https://github.com/googleapis/java-logging/issues/1572)) ([9eb8834](https://github.com/googleapis/java-logging/commit/9eb88346fac9688c0e56bec83f7407c5690a5b7f)) +* Update dependency com.google.cloud:sdk-platform-java-config to v3.30.0 ([#1603](https://github.com/googleapis/java-logging/issues/1603)) ([16967e5](https://github.com/googleapis/java-logging/commit/16967e5ba704a75419904ba2aaabce0cbc116352)) + +## [3.17.0](https://github.com/googleapis/java-logging/compare/v3.16.3...v3.17.0) (2024-04-25) + + +### Features + +* Add Cloud Run Jobs support ([#1574](https://github.com/googleapis/java-logging/issues/1574)) ([1dd64d0](https://github.com/googleapis/java-logging/commit/1dd64d078e0d4cbb1e16cb1d050ba192492d6a60)) + + +### Bug Fixes + +* **deps:** Update the Java code generator (gapic-generator-java) to 2.39.0 ([#1587](https://github.com/googleapis/java-logging/issues/1587)) ([848418b](https://github.com/googleapis/java-logging/commit/848418b426c2e93e636dbd9de71985c386ccb9d2)) + + +### Dependencies + +* Update dependency com.google.cloud:sdk-platform-java-config to v3.29.0 ([#1586](https://github.com/googleapis/java-logging/issues/1586)) ([edcaf8d](https://github.com/googleapis/java-logging/commit/edcaf8de643a7f7f419ee6059c706d0ef0ef4873)) + +## [3.16.3](https://github.com/googleapis/java-logging/compare/v3.16.2...v3.16.3) (2024-04-17) + + +### Dependencies + +* Update dependency com.google.cloud:sdk-platform-java-config to v3.28.1 ([#1569](https://github.com/googleapis/java-logging/issues/1569)) ([8eb0781](https://github.com/googleapis/java-logging/commit/8eb0781b1e1e6e369a6ff0a03d1db4cd0462a6a7)) + +## [3.16.2](https://github.com/googleapis/java-logging/compare/v3.16.1...v3.16.2) (2024-03-20) + + +### Dependencies + +* Update dependency com.google.cloud:sdk-platform-java-config to v3.28.0 ([#1560](https://github.com/googleapis/java-logging/issues/1560)) ([d52e623](https://github.com/googleapis/java-logging/commit/d52e62343aa814183baa4fa8ea39d41a5e7c423f)) +* Update dependency com.google.cloud:sdk-platform-java-config to v3.28.1 ([#1563](https://github.com/googleapis/java-logging/issues/1563)) ([81aa3e6](https://github.com/googleapis/java-logging/commit/81aa3e6b6662d62844b289a22e8aba50dff36a51)) + +## [3.16.1](https://github.com/googleapis/java-logging/compare/v3.16.0...v3.16.1) (2024-03-07) + + +### Bug Fixes + +* **deps:** Update the Java code generator (gapic-generator-java) to 2.37.0 ([#1553](https://github.com/googleapis/java-logging/issues/1553)) ([15b05fc](https://github.com/googleapis/java-logging/commit/15b05fc4a8e6c4069414110b749525082821e509)) + + +### Dependencies + +* Update dependency com.google.cloud:sdk-platform-java-config to v3.27.0 ([#1552](https://github.com/googleapis/java-logging/issues/1552)) ([6c5464d](https://github.com/googleapis/java-logging/commit/6c5464d1c5a74962fcd459a1e03282747e148a44)) + +## [3.16.0](https://github.com/googleapis/java-logging/compare/v3.15.17...v3.16.0) (2024-02-20) + + +### Features + +* Add an API method for reordering firewall policies ([#1538](https://github.com/googleapis/java-logging/issues/1538)) ([9cd6b96](https://github.com/googleapis/java-logging/commit/9cd6b96d9946828c02ccff2ff846a06cc6fff329)) + + +### Dependencies + +* Update dependency com.google.cloud:sdk-platform-java-config to v3.25.0 ([#1535](https://github.com/googleapis/java-logging/issues/1535)) ([7fde779](https://github.com/googleapis/java-logging/commit/7fde7795f03ac96353912829b42adc0035a41d26)) +* Update dependency org.graalvm.buildtools:junit-platform-native to v0.10.0 ([#1528](https://github.com/googleapis/java-logging/issues/1528)) ([b3e4f9b](https://github.com/googleapis/java-logging/commit/b3e4f9b77bffc49a4f9569d4b7a9318a0d5ea5c0)) +* Update dependency org.graalvm.buildtools:native-maven-plugin to v0.10.0 ([#1456](https://github.com/googleapis/java-logging/issues/1456)) ([f27713e](https://github.com/googleapis/java-logging/commit/f27713ed55159754715cca5ff205364e315a7c05)) +* Update dependency org.graalvm.buildtools:native-maven-plugin to v0.10.1 ([#1542](https://github.com/googleapis/java-logging/issues/1542)) ([af784bc](https://github.com/googleapis/java-logging/commit/af784bce7c5272a346ce5016464c87af7d69b442)) +* Update dependency org.junit.vintage:junit-vintage-engine to v5.10.2 ([#1530](https://github.com/googleapis/java-logging/issues/1530)) ([20981dc](https://github.com/googleapis/java-logging/commit/20981dc90ca1b73b74d9f5a0c7f0dfa4d9960ab9)) + +## [3.15.17](https://github.com/googleapis/java-logging/compare/v3.15.16...v3.15.17) (2024-02-07) + + +### Dependencies + +* Update dependency com.google.cloud:sdk-platform-java-config to v3.24.0 ([#1526](https://github.com/googleapis/java-logging/issues/1526)) ([235f1aa](https://github.com/googleapis/java-logging/commit/235f1aa380d4f34f65d4cc957b3d26fa6a35e226)) + + +### Documentation + +* Fix typo in code comments ([#1520](https://github.com/googleapis/java-logging/issues/1520)) ([0440fc6](https://github.com/googleapis/java-logging/commit/0440fc6dfa3c5cd19f0d7d941af242872da1bbd3)) + +## [3.15.16](https://github.com/googleapis/java-logging/compare/v3.15.15...v3.15.16) (2024-01-25) + + +### Bug Fixes + +* **deps:** Update the Java code generator (gapic-generator-java) to 2.32.0 ([#1511](https://github.com/googleapis/java-logging/issues/1511)) ([e2f574c](https://github.com/googleapis/java-logging/commit/e2f574caa0b8c2a2cdb3b186fbf2d599d6ef4c2b)) +* Enable v2.LogEntry Protobufs converter functions ([#1509](https://github.com/googleapis/java-logging/issues/1509)) ([9ef4d90](https://github.com/googleapis/java-logging/commit/9ef4d9048b1ecdc887ebc9cb4898a4bfe3f6c154)) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.22.0 ([#1510](https://github.com/googleapis/java-logging/issues/1510)) ([b40e846](https://github.com/googleapis/java-logging/commit/b40e8465590dadec7c9ff26eb27e92c16b059489)) +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.23.0 ([#1518](https://github.com/googleapis/java-logging/issues/1518)) ([30ba9ed](https://github.com/googleapis/java-logging/commit/30ba9ed687f5469d36138a138f68cd998cf60b53)) + +## [3.15.15](https://github.com/googleapis/java-logging/compare/v3.15.14...v3.15.15) (2024-01-10) + + +### Bug Fixes + +* **deps:** Update the Java code generator (gapic-generator-java) to 2.31.0 ([#1502](https://github.com/googleapis/java-logging/issues/1502)) ([c7a20de](https://github.com/googleapis/java-logging/commit/c7a20de29bf6fae079f8d73e3062025a79c220c9)) +* Replace internal Structs class with google-cloud-core version ([#1501](https://github.com/googleapis/java-logging/issues/1501)) ([21e1929](https://github.com/googleapis/java-logging/commit/21e19295923a33759229e2e992d003409ab1feb3)) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.21.0 ([#1500](https://github.com/googleapis/java-logging/issues/1500)) ([6cce3c9](https://github.com/googleapis/java-logging/commit/6cce3c9bbe051180789c7ff4fbdde4c45fe46888)) + +## [3.15.14](https://github.com/googleapis/java-logging/compare/v3.15.13...v3.15.14) (2023-12-01) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.20.0 ([#1484](https://github.com/googleapis/java-logging/issues/1484)) ([f3227db](https://github.com/googleapis/java-logging/commit/f3227dbbb6ef7f8b16ff4a6d39882f57868915f1)) + +## [3.15.13](https://github.com/googleapis/java-logging/compare/v3.15.12...v3.15.13) (2023-11-06) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.19.0 ([#1468](https://github.com/googleapis/java-logging/issues/1468)) ([5835a7d](https://github.com/googleapis/java-logging/commit/5835a7dc1c839eb3bc379470846451bd51fdfc24)) +* Update dependency org.junit.vintage:junit-vintage-engine to v5.10.1 ([#1471](https://github.com/googleapis/java-logging/issues/1471)) ([debc77f](https://github.com/googleapis/java-logging/commit/debc77f4ce57d768474c27eb6c056f7c10c7d743)) + +## [3.15.12](https://github.com/googleapis/java-logging/compare/v3.15.11...v3.15.12) (2023-10-25) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.18.0 ([#1454](https://github.com/googleapis/java-logging/issues/1454)) ([dc25a87](https://github.com/googleapis/java-logging/commit/dc25a87cb6e1d64c2e2c811a928ea2553a684daa)) +* Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.28 ([#1455](https://github.com/googleapis/java-logging/issues/1455)) ([3080cec](https://github.com/googleapis/java-logging/commit/3080cec373f8d9d61ce57363553925a07702d552)) + +## [3.15.11](https://github.com/googleapis/java-logging/compare/v3.15.10...v3.15.11) (2023-10-10) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.17.0 ([#1444](https://github.com/googleapis/java-logging/issues/1444)) ([748e8a2](https://github.com/googleapis/java-logging/commit/748e8a29026b6eb782a559df207a70555289f906)) + +## [3.15.10](https://github.com/googleapis/java-logging/compare/v3.15.9...v3.15.10) (2023-09-27) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.16.1 ([#1434](https://github.com/googleapis/java-logging/issues/1434)) ([e9e9835](https://github.com/googleapis/java-logging/commit/e9e9835e6c7b52364104a1e4a503027efb722422)) +* Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.27 ([#1430](https://github.com/googleapis/java-logging/issues/1430)) ([9e750a3](https://github.com/googleapis/java-logging/commit/9e750a3c3685671ee573a7e8190622d7f9002b51)) +* Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.27 ([#1431](https://github.com/googleapis/java-logging/issues/1431)) ([7c2aa2c](https://github.com/googleapis/java-logging/commit/7c2aa2cc3b5651674591dc4e6cb89774d14e6513)) + +## [3.15.9](https://github.com/googleapis/java-logging/compare/v3.15.8...v3.15.9) (2023-09-11) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.15.0 ([#1424](https://github.com/googleapis/java-logging/issues/1424)) ([4f82f33](https://github.com/googleapis/java-logging/commit/4f82f339e47014821eca217f5200080e6b78e03f)) +* Update dependency org.easymock:easymock to v5.2.0 ([#1421](https://github.com/googleapis/java-logging/issues/1421)) ([f931544](https://github.com/googleapis/java-logging/commit/f9315443ba97104f1a23e5695ed72cb4bd2dfa10)) +* Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.26 ([#1420](https://github.com/googleapis/java-logging/issues/1420)) ([ff581a6](https://github.com/googleapis/java-logging/commit/ff581a67270777fe15e291794df3b49041c111e3)) +* Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.26 ([#1412](https://github.com/googleapis/java-logging/issues/1412)) ([bd9be4e](https://github.com/googleapis/java-logging/commit/bd9be4e8aecd5b7a532a6f2eb91151201a41334f)) + +## [3.15.8](https://github.com/googleapis/java-logging/compare/v3.15.7...v3.15.8) (2023-08-08) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.14.0 ([#1409](https://github.com/googleapis/java-logging/issues/1409)) ([f9af381](https://github.com/googleapis/java-logging/commit/f9af381b302aeefa401e5bc2f51d97c09f1484e5)) +* Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.24 ([#1411](https://github.com/googleapis/java-logging/issues/1411)) ([0487cdf](https://github.com/googleapis/java-logging/commit/0487cdff06c0ce9529d4c662991cf84ad25b9f40)) + +## [3.15.7](https://github.com/googleapis/java-logging/compare/v3.15.6...v3.15.7) (2023-07-24) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.13.1 ([#1395](https://github.com/googleapis/java-logging/issues/1395)) ([1a29b9d](https://github.com/googleapis/java-logging/commit/1a29b9da803238ff1dee0c69d9449d97d4324477)) +* Update dependency org.junit.vintage:junit-vintage-engine to v5.10.0 ([#1397](https://github.com/googleapis/java-logging/issues/1397)) ([f15d246](https://github.com/googleapis/java-logging/commit/f15d2462962c261be5726d5a68b6a1d31aa916fc)) + +## [3.15.6](https://github.com/googleapis/java-logging/compare/v3.15.5...v3.15.6) (2023-07-17) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.13.0 ([#1388](https://github.com/googleapis/java-logging/issues/1388)) ([03179b0](https://github.com/googleapis/java-logging/commit/03179b0697f17bfc114ff114e454464ed76f8d5b)) + +## [3.15.5](https://github.com/googleapis/java-logging/compare/v3.15.4...v3.15.5) (2023-06-22) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.12.0 ([#1382](https://github.com/googleapis/java-logging/issues/1382)) ([8241302](https://github.com/googleapis/java-logging/commit/824130227897ed17c5b8a1becf32a695d844b2bb)) + +## [3.15.4](https://github.com/googleapis/java-logging/compare/v3.15.3...v3.15.4) (2023-06-22) + + +### Dependencies + +* Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.23 ([#1374](https://github.com/googleapis/java-logging/issues/1374)) ([dce3c4c](https://github.com/googleapis/java-logging/commit/dce3c4c9413c2d1674b6ddaf6fe9351a28f0673a)) +* Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.23 ([#1375](https://github.com/googleapis/java-logging/issues/1375)) ([a15c73c](https://github.com/googleapis/java-logging/commit/a15c73cbf8c22971f690d38fa87b6b349851d5c8)) + +## [3.15.3](https://github.com/googleapis/java-logging/compare/v3.15.2...v3.15.3) (2023-06-08) + + +### Bug Fixes + +* Remove org.jspecify dependency ([#1364](https://github.com/googleapis/java-logging/issues/1364)) ([8138f46](https://github.com/googleapis/java-logging/commit/8138f463e170f1927280d3c083fa403b184fca47)) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.11.0 ([#1367](https://github.com/googleapis/java-logging/issues/1367)) ([8cd2a53](https://github.com/googleapis/java-logging/commit/8cd2a53b396d4671514bf8cca1b4c2a62cfb457c)) + +## [3.15.2](https://github.com/googleapis/java-logging/compare/v3.15.1...v3.15.2) (2023-05-30) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.10.1 ([#1354](https://github.com/googleapis/java-logging/issues/1354)) ([b2f1111](https://github.com/googleapis/java-logging/commit/b2f1111fc8df71b40a85505e1b8209d315cc2c90)) +* Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.22 ([#1340](https://github.com/googleapis/java-logging/issues/1340)) ([b3b9d5f](https://github.com/googleapis/java-logging/commit/b3b9d5ffe078a3203725f3709c1840cb88f6e9ea)) + +## [3.15.1](https://github.com/googleapis/java-logging/compare/v3.15.0...v3.15.1) (2023-05-12) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.9.0 ([#1342](https://github.com/googleapis/java-logging/issues/1342)) ([8b14ae1](https://github.com/googleapis/java-logging/commit/8b14ae17514481a5925ae3ff079cc4f1b4ad6d94)) +* Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.22 ([#1341](https://github.com/googleapis/java-logging/issues/1341)) ([cfc0106](https://github.com/googleapis/java-logging/commit/cfc0106c359c153031bddcac7dadc292a9bb561e)) + +## [3.15.0](https://github.com/googleapis/java-logging/compare/v3.14.9...v3.15.0) (2023-05-06) + + +### Features + +* Log Analytics features of the Cloud Logging API ([#1335](https://github.com/googleapis/java-logging/issues/1335)) ([7d43b80](https://github.com/googleapis/java-logging/commit/7d43b8049c71187fffcde39274db38ebb54cddfa)) + + +### Dependencies + +* Update dependency org.junit.vintage:junit-vintage-engine to v5.9.3 ([#1329](https://github.com/googleapis/java-logging/issues/1329)) ([dfb98f4](https://github.com/googleapis/java-logging/commit/dfb98f47098d4560fc3ef93f126af1770ae4faf6)) + +## [3.14.9](https://github.com/googleapis/java-logging/compare/v3.14.8...v3.14.9) (2023-04-25) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.8.0 ([#1326](https://github.com/googleapis/java-logging/issues/1326)) ([5a56f1b](https://github.com/googleapis/java-logging/commit/5a56f1b5087e65bc097d5c8a85d000d12bbbca8c)) +* Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.21 ([#1319](https://github.com/googleapis/java-logging/issues/1319)) ([5aef8d6](https://github.com/googleapis/java-logging/commit/5aef8d6492c9ebf8e989ee652dcf4a1d82cac8a4)) +* Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.21 ([#1320](https://github.com/googleapis/java-logging/issues/1320)) ([fc2d065](https://github.com/googleapis/java-logging/commit/fc2d0655e5b3d2ea9aedf1a4fd65fad8cf815462)) + +## [3.14.8](https://github.com/googleapis/java-logging/compare/v3.14.7...v3.14.8) (2023-04-14) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.7.0 ([#1318](https://github.com/googleapis/java-logging/issues/1318)) ([973d260](https://github.com/googleapis/java-logging/commit/973d2601bc1639b09d4dd89dd2b6f90cd1b779e9)) + +## [3.14.7](https://github.com/googleapis/java-logging/compare/v3.14.6...v3.14.7) (2023-03-28) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.6.0 ([#1308](https://github.com/googleapis/java-logging/issues/1308)) ([febcf49](https://github.com/googleapis/java-logging/commit/febcf49085ed0fb6be02aaf9108805dd4cce31b8)) + +## [3.14.6](https://github.com/googleapis/java-logging/compare/v3.14.5...v3.14.6) (2023-03-20) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.5.0 ([#1301](https://github.com/googleapis/java-logging/issues/1301)) ([9fa6f05](https://github.com/googleapis/java-logging/commit/9fa6f05a9ea1444d9abad4e0eae5fd854bb2608c)) + +## [3.14.5](https://github.com/googleapis/java-logging/compare/v3.14.4...v3.14.5) (2023-03-02) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.4.0 ([#1290](https://github.com/googleapis/java-logging/issues/1290)) ([84d42ae](https://github.com/googleapis/java-logging/commit/84d42ae6da926785462088de23947bc742f9dc0a)) + +## [3.14.4](https://github.com/googleapis/java-logging/compare/v3.14.3...v3.14.4) (2023-02-21) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.3.0 ([#1282](https://github.com/googleapis/java-logging/issues/1282)) ([58ac608](https://github.com/googleapis/java-logging/commit/58ac608ddbf5803bb394bb4833cf8af0bbb22e91)) +* Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.20 ([#1279](https://github.com/googleapis/java-logging/issues/1279)) ([296cce1](https://github.com/googleapis/java-logging/commit/296cce153cbd263e620c1fbb028466f62f7251dd)) +* Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.20 ([#1280](https://github.com/googleapis/java-logging/issues/1280)) ([6363196](https://github.com/googleapis/java-logging/commit/63631966432aac89883dd80c0087576454616cc2)) + +## [3.14.3](https://github.com/googleapis/java-logging/compare/v3.14.2...v3.14.3) (2023-02-06) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.2.0 ([#1269](https://github.com/googleapis/java-logging/issues/1269)) ([e196a80](https://github.com/googleapis/java-logging/commit/e196a802d0d004dcec2ddfb352ed9aebebe68810)) + +## [3.14.2](https://github.com/googleapis/java-logging/compare/v3.14.1...v3.14.2) (2023-01-24) + + +### Bug Fixes + +* **java:** Skip fixing poms for special modules ([#1744](https://github.com/googleapis/java-logging/issues/1744)) ([#1256](https://github.com/googleapis/java-logging/issues/1256)) ([09eeff0](https://github.com/googleapis/java-logging/commit/09eeff0b4608bad1e854252ff73688a867a071f1)) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.1.2 ([#1258](https://github.com/googleapis/java-logging/issues/1258)) ([d4bc663](https://github.com/googleapis/java-logging/commit/d4bc663a0a0295594fb6333cf9bf2a6fd7a7b7e8)) + +## [3.14.1](https://github.com/googleapis/java-logging/compare/v3.14.0...v3.14.1) (2023-01-10) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.1.1 ([#1243](https://github.com/googleapis/java-logging/issues/1243)) ([fdf6b7a](https://github.com/googleapis/java-logging/commit/fdf6b7a44435286a47e1143a53a8307bb5b8fc63)) +* Update dependency org.junit.vintage:junit-vintage-engine to v5.9.2 ([#1245](https://github.com/googleapis/java-logging/issues/1245)) ([e73a704](https://github.com/googleapis/java-logging/commit/e73a704fa92d8f2abfe3b979e741b7f00ab89bca)) + +## [3.14.0](https://github.com/googleapis/java-logging/compare/v3.13.7...v3.14.0) (2022-12-31) + + +### Features + +* Next release from main branch is 3.14.0 ([#1236](https://github.com/googleapis/java-logging/issues/1236)) ([125d94c](https://github.com/googleapis/java-logging/commit/125d94c9e88196ddd02d4a4acb49bf124cbda81a)) + + +### Dependencies + +* Update dependency org.easymock:easymock to v5.1.0 ([#1238](https://github.com/googleapis/java-logging/issues/1238)) ([d9a381a](https://github.com/googleapis/java-logging/commit/d9a381a1f2418e2d9a16afa110459e90a3c53d00)) + +## [3.13.7](https://github.com/googleapis/java-logging/compare/v3.13.6...v3.13.7) (2022-12-19) + + +### Bug Fixes + +* Install auth plugin on gke environment tests ([#1232](https://github.com/googleapis/java-logging/issues/1232)) ([d18bbba](https://github.com/googleapis/java-logging/commit/d18bbba07bc44e1bdc231a9ad0eaa258fb94081d)) + +## [3.13.6](https://github.com/googleapis/java-logging/compare/v3.13.5...v3.13.6) (2022-12-07) + + +### Bug Fixes + +* Retrieving logentries pagewise always results in an exception ([#1220](https://github.com/googleapis/java-logging/issues/1220)) ([662a439](https://github.com/googleapis/java-logging/commit/662a4394688661e7da2da51446cb3a73658ead62)) + +## [3.13.5](https://github.com/googleapis/java-logging/compare/v3.13.4...v3.13.5) (2022-12-06) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.1.0 ([#1219](https://github.com/googleapis/java-logging/issues/1219)) ([b54e015](https://github.com/googleapis/java-logging/commit/b54e015b13b52bfae0f57242a08c452a74cbfb29)) + +## [3.13.4](https://github.com/googleapis/java-logging/compare/v3.13.3...v3.13.4) (2022-12-03) + + +### Dependencies + +* Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.19 ([#1214](https://github.com/googleapis/java-logging/issues/1214)) ([f104203](https://github.com/googleapis/java-logging/commit/f1042031e5f2ef2fd1c008e9d15a1c14d4831435)) +* Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.19 ([#1215](https://github.com/googleapis/java-logging/issues/1215)) ([7785a7c](https://github.com/googleapis/java-logging/commit/7785a7c9c1e1b975cd9ee723076983268631a50d)) + +## [3.13.3](https://github.com/googleapis/java-logging/compare/v3.13.2...v3.13.3) (2022-12-01) + + +### Bug Fixes + +* Add a partner team as approvers for PRs ([#1211](https://github.com/googleapis/java-logging/issues/1211)) ([a69fd5e](https://github.com/googleapis/java-logging/commit/a69fd5e02b41e8818493797f8d4f64f75fdfb5e0)) +* Need a way to disable flushing ([#1206](https://github.com/googleapis/java-logging/issues/1206)) ([aa0c176](https://github.com/googleapis/java-logging/commit/aa0c176418534c1f07054ab10d66006fd88f6c39)) + +## [3.13.2](https://github.com/googleapis/java-logging/compare/v3.13.1...v3.13.2) (2022-11-21) + + +### Dependencies + +* Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.18 ([#1201](https://github.com/googleapis/java-logging/issues/1201)) ([8b00108](https://github.com/googleapis/java-logging/commit/8b001089f2b0c387134f5fda7cea762433be1198)) +* Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.18 ([#1202](https://github.com/googleapis/java-logging/issues/1202)) ([c884361](https://github.com/googleapis/java-logging/commit/c884361df06a4eb42712d41e1cfeaa9cf75792b1)) + +## [3.13.1](https://github.com/googleapis/java-logging/compare/v3.13.0...v3.13.1) (2022-11-16) + + +### Bug Fixes + +* Fix failing instrumentation test preventing release ([#1187](https://github.com/googleapis/java-logging/issues/1187)) ([04bb6c0](https://github.com/googleapis/java-logging/commit/04bb6c013f9e6f61976df43d6ebfc679524221af)) +* Test failures due to RESOURCE_EXHAUSTED ([#1197](https://github.com/googleapis/java-logging/issues/1197)) ([f74b86d](https://github.com/googleapis/java-logging/commit/f74b86d69db714884959dee7c1f4851df0a0c916)) +* Wrong order of libraries info in instrumentation ([#1196](https://github.com/googleapis/java-logging/issues/1196)) ([c3942ea](https://github.com/googleapis/java-logging/commit/c3942ea6a7ba3fe094e7971010cd30840675aacf)) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.6 ([#1190](https://github.com/googleapis/java-logging/issues/1190)) ([01ebe33](https://github.com/googleapis/java-logging/commit/01ebe33363c9dd131de8ff90b87552934dfdd5a6)) +* Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.17 ([#1182](https://github.com/googleapis/java-logging/issues/1182)) ([d4f17ab](https://github.com/googleapis/java-logging/commit/d4f17ab247a9761632eb4b7503be3376c7353a29)) + +## [3.13.0](https://github.com/googleapis/java-logging/compare/v3.12.1...v3.13.0) (2022-11-04) + + +### Features + +* Add support for instrumentation version annotations ([#1179](https://github.com/googleapis/java-logging/issues/1179)) ([0931446](https://github.com/googleapis/java-logging/commit/09314464f5170c5c261c3676c55bd28d9ee1b27f)) +* Update release-please.yml with correct path ([#1184](https://github.com/googleapis/java-logging/issues/1184)) ([9e75fe4](https://github.com/googleapis/java-logging/commit/9e75fe4c991db88a39cf5a865c2de081068a6f8f)) + + +### Dependencies + +* Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.17 ([#1181](https://github.com/googleapis/java-logging/issues/1181)) ([1830525](https://github.com/googleapis/java-logging/commit/18305255917815a859e5957f1b835e7f6a919925)) + +## [3.12.1](https://github.com/googleapis/java-logging/compare/v3.12.0...v3.12.1) (2022-11-02) + + +### Bug Fixes + +* Make partialSuccess to be true by default ([#1173](https://github.com/googleapis/java-logging/issues/1173)) ([123960a](https://github.com/googleapis/java-logging/commit/123960ad31f9258d2dadd788029941bb984ae0fa)) + +## [3.12.0](https://github.com/googleapis/java-logging/compare/v3.11.10...v3.12.0) (2022-10-27) + + +### Features + +* Add support for batching configuration ([#1164](https://github.com/googleapis/java-logging/issues/1164)) ([35be8d1](https://github.com/googleapis/java-logging/commit/35be8d1e931a8784c3263299033fc24d623087b5)) + +## [3.11.10](https://github.com/googleapis/java-logging/compare/v3.11.9...v3.11.10) (2022-10-26) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.5 ([#1156](https://github.com/googleapis/java-logging/issues/1156)) ([413fa54](https://github.com/googleapis/java-logging/commit/413fa54ee4f38d5c28e91f54f4a5cd8e0407b08a)) +* Update dependency org.easymock:easymock to v5.0.1 ([#1159](https://github.com/googleapis/java-logging/issues/1159)) ([df8bfbe](https://github.com/googleapis/java-logging/commit/df8bfbeca6827e7d124a7880ae13e8bf6ec9c24c)) +* Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.16 ([#1144](https://github.com/googleapis/java-logging/issues/1144)) ([4836c7e](https://github.com/googleapis/java-logging/commit/4836c7e037bf6b15cb87d96770a12197cae9e57b)) +* Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.16 ([#1154](https://github.com/googleapis/java-logging/issues/1154)) ([a13ef9f](https://github.com/googleapis/java-logging/commit/a13ef9fa9c7d59a719534881cb4a995ead7e827d)) + +## [3.11.9](https://github.com/googleapis/java-logging/compare/v3.11.8...v3.11.9) (2022-10-17) + + +### Dependencies + +* Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.15 ([#1145](https://github.com/googleapis/java-logging/issues/1145)) ([5bd000c](https://github.com/googleapis/java-logging/commit/5bd000c55e24d53667eca0bcb22ee3cbb9f13fe0)) + +## [3.11.8](https://github.com/googleapis/java-logging/compare/v3.11.7...v3.11.8) (2022-10-15) + + +### Dependencies + +* Update dependency org.easymock:easymock to v5 ([#1139](https://github.com/googleapis/java-logging/issues/1139)) ([ad33e92](https://github.com/googleapis/java-logging/commit/ad33e92641907226004c82de2266afa99111a7d5)) + +## [3.11.7](https://github.com/googleapis/java-logging/compare/v3.11.6...v3.11.7) (2022-10-12) + + +### Bug Fixes + +* Add safe directory for environment tests ([#1131](https://github.com/googleapis/java-logging/issues/1131)) ([a6ff3c6](https://github.com/googleapis/java-logging/commit/a6ff3c663647bb92ee542a60a3eb25b1392a5457)) + +## [3.11.6](https://github.com/googleapis/java-logging/compare/v3.11.5...v3.11.6) (2022-10-07) + + +### Bug Fixes + +* Logging SDK not applying quota limits for project set using quotaProjectId ([#1125](https://github.com/googleapis/java-logging/issues/1125)) ([70fc6ee](https://github.com/googleapis/java-logging/commit/70fc6ee9c0fdc845a06e031ca82c50b8def2bb3b)) + +## [3.11.5](https://github.com/googleapis/java-logging/compare/v3.11.4...v3.11.5) (2022-10-03) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.4 ([#1120](https://github.com/googleapis/java-logging/issues/1120)) ([17a6e26](https://github.com/googleapis/java-logging/commit/17a6e26d955d9e8d6de9e7b68473f3d09a779d82)) + +## [3.11.4](https://github.com/googleapis/java-logging/compare/v3.11.3...v3.11.4) (2022-10-01) + + +### Bug Fixes + +* Add flush() calls in samples ([#1116](https://github.com/googleapis/java-logging/issues/1116)) ([6d3cb5b](https://github.com/googleapis/java-logging/commit/6d3cb5bf787409d44ba8c0d4c20fb6810a8d1d88)) + +## [3.11.3](https://github.com/googleapis/java-logging/compare/v3.11.2...v3.11.3) (2022-09-22) + + +### Dependencies + +* Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.14 ([#1079](https://github.com/googleapis/java-logging/issues/1079)) ([c08c4da](https://github.com/googleapis/java-logging/commit/c08c4da8cf91e4d168ad16038a460ac9ab2bed8e)) +* Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.14 ([#1080](https://github.com/googleapis/java-logging/issues/1080)) ([50c979b](https://github.com/googleapis/java-logging/commit/50c979b8d83f2b5f9c74bbb115b7c30e0326211d)) + +## [3.11.2](https://github.com/googleapis/java-logging/compare/v3.11.1...v3.11.2) (2022-09-21) + + +### Dependencies + +* Update dependency org.junit.vintage:junit-vintage-engine to v5.9.1 ([#1075](https://github.com/googleapis/java-logging/issues/1075)) ([d38e9e0](https://github.com/googleapis/java-logging/commit/d38e9e0a8a9b4faa487a4ce169d0189e8718a88b)) + +## [3.11.1](https://github.com/googleapis/java-logging/compare/v3.11.0...v3.11.1) (2022-09-15) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.3 ([#1067](https://github.com/googleapis/java-logging/issues/1067)) ([6d36ffc](https://github.com/googleapis/java-logging/commit/6d36ffc9f4f7d7411df5fa17b770fba8c6402894)) + +## [3.11.0](https://github.com/googleapis/java-logging/compare/v3.10.8...v3.11.0) (2022-09-14) + + +### Features + +* Apply Google style recommendations ([#1057](https://github.com/googleapis/java-logging/issues/1057)) ([bfef3d1](https://github.com/googleapis/java-logging/commit/bfef3d1a26b499c67d064dcdfd071ea8b6f1eb1b)) + + +### Bug Fixes + +* Fix a couple linter issues on my stderr update ([#1061](https://github.com/googleapis/java-logging/issues/1061)) ([fa1a18f](https://github.com/googleapis/java-logging/commit/fa1a18f6f6c0924c1dba51d8796a5bb3f43c40a7)) + +## [3.10.8](https://github.com/googleapis/java-logging/compare/v3.10.7...v3.10.8) (2022-09-09) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.2 ([#1060](https://github.com/googleapis/java-logging/issues/1060)) ([b5dea1b](https://github.com/googleapis/java-logging/commit/b5dea1b65e32859d84be76a242fc5aadb4a28277)) + +## [3.10.7](https://github.com/googleapis/java-logging/compare/v3.10.6...v3.10.7) (2022-09-07) + + +### Bug Fixes + +* Apply Google Java Code Clarity suggestions ([#1044](https://github.com/googleapis/java-logging/issues/1044)) ([79e9d8d](https://github.com/googleapis/java-logging/commit/79e9d8d00b0b9be10a12d6bb37f387f6f8b356f2)) + +## [3.10.6](https://github.com/googleapis/java-logging/compare/v3.10.5...v3.10.6) (2022-08-29) + + +### Dependencies + +* use error_prone_annotation via shared deps ([#1049](https://github.com/googleapis/java-logging/issues/1049)) ([0998b9b](https://github.com/googleapis/java-logging/commit/0998b9b83bc20a867dc22a68e103e4d3cac0f403)) + +## [3.10.5](https://github.com/googleapis/java-logging/compare/v3.10.4...v3.10.5) (2022-08-25) + + +### Bug Fixes + +* resource detection for 2nd gen of Cloud Functions works incorrectly ([#1045](https://github.com/googleapis/java-logging/issues/1045)) ([dda1d0a](https://github.com/googleapis/java-logging/commit/dda1d0a48c3db18b46b8306c3304a79054e9b49c)) + +## [3.10.4](https://github.com/googleapis/java-logging/compare/v3.10.3...v3.10.4) (2022-08-19) + + +### Dependencies + +* update dependency com.google.errorprone:error_prone_annotations to v2.15.0 ([#1037](https://github.com/googleapis/java-logging/issues/1037)) ([b2731c7](https://github.com/googleapis/java-logging/commit/b2731c70d1cdb3825e40fd80c771ea56777a1d27)) + +## [3.10.3](https://github.com/googleapis/java-logging/compare/v3.10.2...v3.10.3) (2022-08-19) + + +### Bug Fixes + +* Add explicit RunWith annotations on all tests ([#1004](https://github.com/googleapis/java-logging/issues/1004)) ([342157f](https://github.com/googleapis/java-logging/commit/342157fc0b5819e50a7c53ddb03f6016042272a3)) +* Apply fixes from Google error-prone ([#1010](https://github.com/googleapis/java-logging/issues/1010)) ([2d57d78](https://github.com/googleapis/java-logging/commit/2d57d7886f4281e779c8a1dd54aa056c5a8be46a)) +* Correct the JSON time field name ([#1020](https://github.com/googleapis/java-logging/issues/1020)) ([8c9a218](https://github.com/googleapis/java-logging/commit/8c9a2184bc5f5a697345d9dc1f2afc9b8fd759b7)) +* Fix flakiness in JSON test ([#1006](https://github.com/googleapis/java-logging/issues/1006)) ([cafafe4](https://github.com/googleapis/java-logging/commit/cafafe44531001254e014da07211cc6694df97cc)) +* Fix some typos ([#1008](https://github.com/googleapis/java-logging/issues/1008)) ([5666ee0](https://github.com/googleapis/java-logging/commit/5666ee0dea87bba9eda9d48afee8924a074db6dd)) +* Make LoggingHandler.logEntryFor extensible ([#1021](https://github.com/googleapis/java-logging/issues/1021)) ([79baac6](https://github.com/googleapis/java-logging/commit/79baac68a60cca699088723864bf2de23fca0580)) +* Replace Date with LocalDateTime ([#1012](https://github.com/googleapis/java-logging/issues/1012)) ([765dd89](https://github.com/googleapis/java-logging/commit/765dd895df201966e7dea5851e29638dde115ce2)) +* Supress unchecked conversion warnings ([#1014](https://github.com/googleapis/java-logging/issues/1014)) ([a93ee23](https://github.com/googleapis/java-logging/commit/a93ee233112b28f21d9cc1ed724638455ece4dc0)) +* Update the stub to avoid the deprecated *Map method ([#1002](https://github.com/googleapis/java-logging/issues/1002)) ([49bf5b4](https://github.com/googleapis/java-logging/commit/49bf5b41c354089ad213ff1ce5d3f42aa3d1d02e)) + + +### Dependencies + +* update dependency org.junit.vintage:junit-vintage-engine to v5.9.0 ([#1016](https://github.com/googleapis/java-logging/issues/1016)) ([e5f0b55](https://github.com/googleapis/java-logging/commit/e5f0b55acdcfb12e79a69eb213c60e237c9e630a)) + +## [3.10.2](https://github.com/googleapis/java-logging/compare/v3.10.1...v3.10.2) (2022-08-08) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v3 ([#1018](https://github.com/googleapis/java-logging/issues/1018)) ([17efd5c](https://github.com/googleapis/java-logging/commit/17efd5cdcd84ef894afc27afc665661eefb5a22b)) +* update dependency org.graalvm.buildtools:junit-platform-native to v0.9.13 ([#992](https://github.com/googleapis/java-logging/issues/992)) ([3856e4f](https://github.com/googleapis/java-logging/commit/3856e4fa5105f1da37c98a2fbb5ff5dc9166d41b)) +* update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.13 ([#993](https://github.com/googleapis/java-logging/issues/993)) ([a94e428](https://github.com/googleapis/java-logging/commit/a94e42820261caf063b7a8f43df594b873084d7b)) + +## [3.10.1](https://github.com/googleapis/java-logging/compare/v3.10.0...v3.10.1) (2022-07-13) + + +### Bug Fixes + +* enable longpaths support for windows test ([#1485](https://github.com/googleapis/java-logging/issues/1485)) ([#995](https://github.com/googleapis/java-logging/issues/995)) ([b2f68cb](https://github.com/googleapis/java-logging/commit/b2f68cb46d56521eeddcd63a0daea1abd85b70ae)) + + +### Dependencies + +* update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.12 ([#977](https://github.com/googleapis/java-logging/issues/977)) ([71dc1ee](https://github.com/googleapis/java-logging/commit/71dc1ee5ee98532958ea89f4ee7e3dd801d57501)) + +## [3.10.0](https://github.com/googleapis/java-logging/compare/v3.9.0...v3.10.0) (2022-06-25) + + +### Features + +* Add support for library instrumentation ([#979](https://github.com/googleapis/java-logging/issues/979)) ([2749974](https://github.com/googleapis/java-logging/commit/27499744f37a5fddcc2d6825c69481374e78829c)) + + +### Documentation + +* **sample:** update README for native image sample ([#974](https://github.com/googleapis/java-logging/issues/974)) ([1512487](https://github.com/googleapis/java-logging/commit/1512487e60141ed5c61a3a60fcca29f52f4ec141)) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.13.0 ([#980](https://github.com/googleapis/java-logging/issues/980)) ([18acf1f](https://github.com/googleapis/java-logging/commit/18acf1f64d836ca3fb1b8f4b558ef21d728c391f)) +* update dependency org.graalvm.buildtools:junit-platform-native to v0.9.12 ([#976](https://github.com/googleapis/java-logging/issues/976)) ([01d3213](https://github.com/googleapis/java-logging/commit/01d3213b9e010c3ae3843e5a05bbd01b2961b454)) + +## [3.9.0](https://github.com/googleapis/java-logging/compare/v3.8.0...v3.9.0) (2022-05-19) + + +### Features + +* add build scripts for native image testing in Java 17 ([#1440](https://github.com/googleapis/java-logging/issues/1440)) ([#962](https://github.com/googleapis/java-logging/issues/962)) ([4edb7e4](https://github.com/googleapis/java-logging/commit/4edb7e46e313db88f5400ccada019ac01a51dee4)) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.11.0 ([#960](https://github.com/googleapis/java-logging/issues/960)) ([c969b4c](https://github.com/googleapis/java-logging/commit/c969b4cddb54a4b7f25e7a5f8a4c665fde1ece47)) +* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.12.0 ([#966](https://github.com/googleapis/java-logging/issues/966)) ([c95840b](https://github.com/googleapis/java-logging/commit/c95840bc83316c6064f99908da38952179ce4a54)) + +## [3.8.0](https://github.com/googleapis/java-logging/compare/v3.7.6...v3.8.0) (2022-05-16) + + +### Features + +* next release from main branch is 3.7.0 ([#957](https://github.com/googleapis/java-logging/issues/957)) ([576a93e](https://github.com/googleapis/java-logging/commit/576a93e2bba9939425e6fce22b13b6580565689c)) + +### [3.7.6](https://github.com/googleapis/java-logging/compare/v3.7.5...v3.7.6) (2022-05-03) + + +### Documentation + +* Add link to interactive tutorial ([#952](https://github.com/googleapis/java-logging/issues/952)) ([934df5a](https://github.com/googleapis/java-logging/commit/934df5ad5b29f11e781b8b8a4660f89198bb06d1)) +* Add link to interactive walkthrough ([#950](https://github.com/googleapis/java-logging/issues/950)) ([33ae197](https://github.com/googleapis/java-logging/commit/33ae197627d63d6c153f9bbb0076a071029cf686)) +* **sample:** removing unnecessary native-image-support dependency ([#947](https://github.com/googleapis/java-logging/issues/947)) ([75331a6](https://github.com/googleapis/java-logging/commit/75331a6aa754ed93171832f59a5c0012e7cb7e05)) + +### [3.7.5](https://github.com/googleapis/java-logging/compare/v3.7.4...v3.7.5) (2022-04-15) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.10.0 ([#930](https://github.com/googleapis/java-logging/issues/930)) ([074c6c7](https://github.com/googleapis/java-logging/commit/074c6c791059f4503a4103d8387f6b0b062db3a3)) +* update dependency com.google.cloud:native-image-support to v0.13.1 ([#931](https://github.com/googleapis/java-logging/issues/931)) ([2e4b4d0](https://github.com/googleapis/java-logging/commit/2e4b4d09192a75f3e9107c143c9e74fa05201e1a)) + +### [3.7.4](https://github.com/googleapis/java-logging/compare/v3.7.3...v3.7.4) (2022-03-31) + + +### Bug Fixes + +* Async logging should not rethrow error in onFailure callback ([#923](https://github.com/googleapis/java-logging/issues/923)) ([1adf867](https://github.com/googleapis/java-logging/commit/1adf86722361ce946c733de87cb217fa2f65bfd5)) +* Async logging should not rethrow error in onFailure callback correction ([#925](https://github.com/googleapis/java-logging/issues/925)) ([da92518](https://github.com/googleapis/java-logging/commit/da925189d808833f1b7cc7a1934bcf66f51663be)) + +### [3.7.3](https://github.com/googleapis/java-logging/compare/v3.7.2...v3.7.3) (2022-03-29) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.9.0 ([#917](https://github.com/googleapis/java-logging/issues/917)) ([b42717e](https://github.com/googleapis/java-logging/commit/b42717e8e2d825cee9918c48ae4b7628f225f6be)) +* update dependency com.google.cloud:native-image-support to v0.12.11 ([#916](https://github.com/googleapis/java-logging/issues/916)) ([6d6bbef](https://github.com/googleapis/java-logging/commit/6d6bbef4bfb0802677e2773ffd95047c71814613)) + +### [3.7.2](https://github.com/googleapis/java-logging/compare/v3.7.1...v3.7.2) (2022-03-24) + + +### Documentation + +* **sample:** Add sample for Native Image support in Logging ([#880](https://github.com/googleapis/java-logging/issues/880)) ([7e59bf3](https://github.com/googleapis/java-logging/commit/7e59bf3c3676ebc6bfcdf6e951d3d8f0b6c1589f)) + + +### Dependencies + +* update dependency com.google.cloud:native-image-support to v0.12.10 ([#903](https://github.com/googleapis/java-logging/issues/903)) ([b692e02](https://github.com/googleapis/java-logging/commit/b692e0247ea61b290aad0f0245184fd3c026629b)) +* update dependency org.graalvm.buildtools:junit-platform-native to v0.9.10 ([#904](https://github.com/googleapis/java-logging/issues/904)) ([d834a0a](https://github.com/googleapis/java-logging/commit/d834a0a5f10cda8a1327714f8a93c0c6e41143df)) +* update dependency org.graalvm.buildtools:junit-platform-native to v0.9.11 ([#912](https://github.com/googleapis/java-logging/issues/912)) ([c1d6559](https://github.com/googleapis/java-logging/commit/c1d65597ee8ce95dc6276c4f19d13a922c819f0d)) +* update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.10 ([#905](https://github.com/googleapis/java-logging/issues/905)) ([3c44e3e](https://github.com/googleapis/java-logging/commit/3c44e3ed51c52a84b5a5a517a8b8a105f083532c)) +* update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.11 ([#911](https://github.com/googleapis/java-logging/issues/911)) ([3721ef5](https://github.com/googleapis/java-logging/commit/3721ef53305e27afb5bad685a10eb8901988c7b9)) + +### [3.7.1](https://github.com/googleapis/java-logging/compare/v3.7.0...v3.7.1) (2022-03-03) + + +### Bug Fixes + +* do not use GAE_RUNTIME for GAE environment detection ([#891](https://github.com/googleapis/java-logging/issues/891)) ([19e9abb](https://github.com/googleapis/java-logging/commit/19e9abb389ed98cdcca7ef0dfa5b07e69568f6f9)) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.8.0 ([#889](https://github.com/googleapis/java-logging/issues/889)) ([4885440](https://github.com/googleapis/java-logging/commit/48854405838151a4179f6d1727fc925b06d1727d)) + +## [3.7.0](https://github.com/googleapis/java-logging/compare/v3.6.4...v3.7.0) (2022-02-28) + + +### Features + +* KMS configuration in settings ([#877](https://github.com/googleapis/java-logging/issues/877)) ([27c199b](https://github.com/googleapis/java-logging/commit/27c199ba91b8423934788cbd6cb8e449dfc7b115)) +* Update Logging API with latest changes ([27c199b](https://github.com/googleapis/java-logging/commit/27c199ba91b8423934788cbd6cb8e449dfc7b115)) + + +### Bug Fixes + +* **deps:** set gson via java-shared-deps ([#878](https://github.com/googleapis/java-logging/issues/878)) ([5c97fea](https://github.com/googleapis/java-logging/commit/5c97feadf1d4fd80618cdcee19e02e4cbabfb1ea)) + +### [3.6.4](https://github.com/googleapis/java-logging/compare/v3.6.3...v3.6.4) (2022-02-15) + + +### Dependencies + +* update dependency com.google.code.gson:gson to v2.9.0 ([#868](https://github.com/googleapis/java-logging/issues/868)) ([f3d6f3f](https://github.com/googleapis/java-logging/commit/f3d6f3f0d29d1b56f8c8fd191b4b946bc31f6e10)) + +### [3.6.3](https://github.com/googleapis/java-logging/compare/v3.6.2...v3.6.3) (2022-02-11) + + +### Dependencies + +* update actions/github-script action to v6 ([#865](https://github.com/googleapis/java-logging/issues/865)) ([2d05dc8](https://github.com/googleapis/java-logging/commit/2d05dc81b3b56ae6b5205c26719bfd3985c5b9d7)) + +### [3.6.2](https://github.com/googleapis/java-logging/compare/v3.6.1...v3.6.2) (2022-02-03) + + +### Dependencies + +* **java:** update actions/github-script action to v5 ([#1339](https://github.com/googleapis/java-logging/issues/1339)) ([#851](https://github.com/googleapis/java-logging/issues/851)) ([7a5ee11](https://github.com/googleapis/java-logging/commit/7a5ee11ab17aaa36c688e1c631a4c9a65eae6352)) +* update actions/github-script action to v5 ([#849](https://github.com/googleapis/java-logging/issues/849)) ([286728a](https://github.com/googleapis/java-logging/commit/286728a941b34a67e3dccb119d6d2c13830e5c38)) +* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.7.0 ([#852](https://github.com/googleapis/java-logging/issues/852)) ([eb2eef5](https://github.com/googleapis/java-logging/commit/eb2eef553ee6e9f9880f06fd6185e90367063d86)) + +### [3.6.1](https://github.com/googleapis/java-logging/compare/v3.6.0...v3.6.1) (2022-01-18) + + +### Bug Fixes + +* use initialized logging option in constructor ([#843](https://github.com/googleapis/java-logging/issues/843)) ([99fb678](https://github.com/googleapis/java-logging/commit/99fb6782f2a37be569309cc37591ce7b9c86092b)) + + +### Dependencies + +* update dependency org.easymock:easymock to v4 ([#830](https://github.com/googleapis/java-logging/issues/830)) ([21c2436](https://github.com/googleapis/java-logging/commit/21c243619e3b00891a0ff828e0f3e087b6e17d4b)) + +## [3.6.0](https://www.github.com/googleapis/java-logging/compare/v3.5.3...v3.6.0) (2022-01-07) + + +### Features + +* enable auto-population of missing metadata in logs and opting logs redirection to stdout in JUL handler ([#808](https://www.github.com/googleapis/java-logging/issues/808)) ([bb25d5d](https://www.github.com/googleapis/java-logging/commit/bb25d5def9de42fa6e0de5658154fbf2e72e8fba)) + +### [3.5.3](https://www.github.com/googleapis/java-logging/compare/v3.5.2...v3.5.3) (2022-01-07) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.6.0 ([#823](https://www.github.com/googleapis/java-logging/issues/823)) ([2816bb3](https://www.github.com/googleapis/java-logging/commit/2816bb37fc57be241b78d85a8862d8e7c9c47221)) + +### [3.5.2](https://www.github.com/googleapis/java-logging/compare/v3.5.1...v3.5.2) (2021-12-28) + + +### Bug Fixes + +* enforce w3c trace context value validation ([#777](https://www.github.com/googleapis/java-logging/issues/777)) ([0150655](https://www.github.com/googleapis/java-logging/commit/0150655891537a8de3f3debb5ec5c49f4a6de146)) +* **java:** add -ntp flag to native image testing command ([#1299](https://www.github.com/googleapis/java-logging/issues/1299)) ([#780](https://www.github.com/googleapis/java-logging/issues/780)) ([3f70b62](https://www.github.com/googleapis/java-logging/commit/3f70b6261b606c03307eb8ca5dbea14526d1b054)) +* Rename LogDestinationName.getId() to LogDestinationName.getDestinationId() ([#797](https://www.github.com/googleapis/java-logging/issues/797)) ([62e7838](https://www.github.com/googleapis/java-logging/commit/62e783839b9a7c29a05bfeac55189bd8ea1bdfd6)) +* Rename staleness.critical config parameter to staleness.extraold ([#781](https://www.github.com/googleapis/java-logging/issues/781)) ([3083bca](https://www.github.com/googleapis/java-logging/commit/3083bca8fb388092c5abfbe5efc58d1de757bb00)) + +### [3.5.1](https://www.github.com/googleapis/java-logging/compare/v3.5.0...v3.5.1) (2021-12-03) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.5.1 ([#773](https://www.github.com/googleapis/java-logging/issues/773)) ([56907a4](https://www.github.com/googleapis/java-logging/commit/56907a4b1d3a529655f3845bd1e46f308977b436)) + +## [3.5.0](https://www.github.com/googleapis/java-logging/compare/v3.4.0...v3.5.0) (2021-11-24) + + +### Features + +* Enable auto-label bot to mark stale pull requests ([#758](https://www.github.com/googleapis/java-logging/issues/758)) ([23f7fa5](https://www.github.com/googleapis/java-logging/commit/23f7fa559add710b96bad90002fcebef8ac0e5c9)) +* implement context handler to store HTTP request and tracing information ([#752](https://www.github.com/googleapis/java-logging/issues/752)) ([86223ff](https://www.github.com/googleapis/java-logging/commit/86223ff36f9c4b147f322ba646607727b92fbe7b)) + + +### Bug Fixes + +* handle null pointer when parsing metadata attributes ([#759](https://www.github.com/googleapis/java-logging/issues/759)) ([e8cf6f9](https://www.github.com/googleapis/java-logging/commit/e8cf6f91b56529d28cc002cedb0976ce952e0e0e)) +* modify list log entries example documentation ([#740](https://www.github.com/googleapis/java-logging/issues/740)) ([790fb1a](https://www.github.com/googleapis/java-logging/commit/790fb1a342d63704298d16a576f6cce15bfd4398)) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.5.0 ([#743](https://www.github.com/googleapis/java-logging/issues/743)) ([c003417](https://www.github.com/googleapis/java-logging/commit/c003417aade41e025082f47f2185e66707bffcff)) + +## [3.4.0](https://www.github.com/googleapis/java-logging/compare/v3.3.0...v3.4.0) (2021-11-06) + + +### Features + +* Add an ability to delete logs based on project, folder, organization or billing account resource names ([#731](https://www.github.com/googleapis/java-logging/issues/731)) ([25673fd](https://www.github.com/googleapis/java-logging/commit/25673fdc2622f19926e3634ae187182f64efec18)) +* Add destination property into LogEntry ([#720](https://www.github.com/googleapis/java-logging/issues/720)) ([43ea0b4](https://www.github.com/googleapis/java-logging/commit/43ea0b465b29c22e7eb439811f19ada90b9d23dd)) +* add population of the SourceLocation from context ([#721](https://www.github.com/googleapis/java-logging/issues/721)) ([1fa3a6e](https://www.github.com/googleapis/java-logging/commit/1fa3a6e286336a861f83d9b59f28f309fc846d70)) +* Extend a set of options in WriteOption to allow defining the log location as custom project, folder, organization or billing account ([#727](https://www.github.com/googleapis/java-logging/issues/727)) ([1996cb4](https://www.github.com/googleapis/java-logging/commit/1996cb49fa0dc3dd4d35d7d2876c9ac3698a450b)) + + +### Bug Fixes + +* **java:** java 17 dependency arguments ([#1266](https://www.github.com/googleapis/java-logging/issues/1266)) ([#724](https://www.github.com/googleapis/java-logging/issues/724)) ([5a8cedf](https://www.github.com/googleapis/java-logging/commit/5a8cedfcd30b59c0630edb5769c850bc26467bb3)) + +## [3.3.0](https://www.github.com/googleapis/java-logging/compare/v3.2.0...v3.3.0) (2021-10-20) + + +### Features + +* implement revised version of the monitored resource type discovery and metadata population ([#708](https://www.github.com/googleapis/java-logging/issues/708)) ([0592c96](https://www.github.com/googleapis/java-logging/commit/0592c96bc697a983f521c7ac51df53661c801975)) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.4.0 ([#714](https://www.github.com/googleapis/java-logging/issues/714)) ([6ba9df7](https://www.github.com/googleapis/java-logging/commit/6ba9df7e0f36ea4c41d8bd45a67fa671c41d9db6)) + +## [3.2.0](https://www.github.com/googleapis/java-logging/compare/v3.1.2...v3.2.0) (2021-09-27) + + +### Features + +* Add a sample snippet for use of the tailLogEntries API ([8115888](https://www.github.com/googleapis/java-logging/commit/81158885911e6c150fa04053fc41f95640329548)) +* add support for tailLogEntry API ([5a7845a](https://www.github.com/googleapis/java-logging/commit/5a7845a8c6476ca2d80e6fffdcb2f5f061f6260b)) + + +### Bug Fixes + +* add space to fix embedding exclusion in docs ([#615](https://www.github.com/googleapis/java-logging/issues/615)) ([9d70b96](https://www.github.com/googleapis/java-logging/commit/9d70b96914ae6217cbe58ab1af93e1d5dfe67ce1)) +* fix samples region tags and test flakiness ([#680](https://www.github.com/googleapis/java-logging/issues/680)) ([53481bd](https://www.github.com/googleapis/java-logging/commit/53481bde1e455037cd8102bc1b404ea2c491c235)) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.3.0 ([#681](https://www.github.com/googleapis/java-logging/issues/681)) ([9be4047](https://www.github.com/googleapis/java-logging/commit/9be4047f5631c824e3f07cfc8c21211168bd51d4)) + +### [3.1.2](https://www.github.com/googleapis/java-logging/compare/v3.1.1...v3.1.2) (2021-09-16) + + +### Bug Fixes + +* Change timestamp type to support nanosecond resolution ([#654](https://www.github.com/googleapis/java-logging/issues/654)) ([7ae1537](https://www.github.com/googleapis/java-logging/commit/7ae153789268629539cf1ea5246597aae7aa8d19)), closes [#598](https://www.github.com/googleapis/java-logging/issues/598) +* Return Resource.K8sContainer when autodetecting resource type ([#641](https://www.github.com/googleapis/java-logging/issues/641)) ([6103560](https://www.github.com/googleapis/java-logging/commit/6103560c1c59c3c1ba83a4c9f2be5b5781640c36)) +* update CI to use maven 3.8.1 ([#662](https://www.github.com/googleapis/java-logging/issues/662)) ([9beb2ed](https://www.github.com/googleapis/java-logging/commit/9beb2ed44e3b7ad3eeaf6710b2195e50ac39016f)) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.2.1 ([#667](https://www.github.com/googleapis/java-logging/issues/667)) ([8190656](https://www.github.com/googleapis/java-logging/commit/8190656732d3d388569b02dbd0aeefe0e0c7fdff)) + +### [3.1.1](https://www.github.com/googleapis/java-logging/compare/v3.1.0...v3.1.1) (2021-08-31) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.2.0 ([#649](https://www.github.com/googleapis/java-logging/issues/649)) ([8af8d14](https://www.github.com/googleapis/java-logging/commit/8af8d142eb3d90cd5fba5b3e34d388db1867a56a)) + +## [3.1.0](https://www.github.com/googleapis/java-logging/compare/v3.0.1...v3.1.0) (2021-08-24) + + +### Features + +* implement listLogs API and provide sample snippet ([#602](https://www.github.com/googleapis/java-logging/issues/602)) ([9359569](https://www.github.com/googleapis/java-logging/commit/935956944200d978738d86ae4adff6107532531c)) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.1.0 ([#636](https://www.github.com/googleapis/java-logging/issues/636)) ([fb9ac95](https://www.github.com/googleapis/java-logging/commit/fb9ac954293f5a281024e122d06e8487cb3a62c1)) + +### [3.0.1](https://www.github.com/googleapis/java-logging/compare/v3.0.0...v3.0.1) (2021-08-11) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.0.1 ([#616](https://www.github.com/googleapis/java-logging/issues/616)) ([02a00a2](https://www.github.com/googleapis/java-logging/commit/02a00a2a417445bb12389e278288c5bac4fd3c81)) + +## [3.0.0](https://www.github.com/googleapis/java-logging/compare/v2.3.2...v3.0.0) (2021-08-04) + + +### ⚠ BREAKING CHANGES + +* release gapic-generator-java v2.0.0 (#605) + +### Features + +* deprecate methods ([#587](https://www.github.com/googleapis/java-logging/issues/587)) ([85e496d](https://www.github.com/googleapis/java-logging/commit/85e496d5884143ecc6cd1757fcce31d5b83ecda5)) +* release gapic-generator-java v2.0.0 ([#605](https://www.github.com/googleapis/java-logging/issues/605)) ([8fa5c5a](https://www.github.com/googleapis/java-logging/commit/8fa5c5ae1d76d9a0959add1036300a799918dcb4)) + + +### Bug Fixes + +* describe authorization required for service object ([#582](https://www.github.com/googleapis/java-logging/issues/582)) ([4fd3cdc](https://www.github.com/googleapis/java-logging/commit/4fd3cdc4b4c564da026a0a424ba8d49c8390982e)) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v2 ([#606](https://www.github.com/googleapis/java-logging/issues/606)) ([99cb3a0](https://www.github.com/googleapis/java-logging/commit/99cb3a005f2775034d2df207dcb1a6c7f19b6fd4)) + +### [2.3.2](https://www.github.com/googleapis/java-logging/compare/v2.3.1...v2.3.2) (2021-07-01) + + +### Bug Fixes + +* Add `shopt -s nullglob` to dependencies script ([#564](https://www.github.com/googleapis/java-logging/issues/564)) ([5a5f737](https://www.github.com/googleapis/java-logging/commit/5a5f7371569f3e5656a3e40fcc2d72b7a8e0e916)) +* Update dependencies.sh to not break on mac ([#559](https://www.github.com/googleapis/java-logging/issues/559)) ([5877a06](https://www.github.com/googleapis/java-logging/commit/5877a068ae466b0e61d240674263ddb772b43cb2)) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v1.4.0 ([#568](https://www.github.com/googleapis/java-logging/issues/568)) ([623a85b](https://www.github.com/googleapis/java-logging/commit/623a85b0ca9ab893b925522fe38f1b03ab822d7e)) + +### [2.3.1](https://www.github.com/googleapis/java-logging/compare/v2.3.0...v2.3.1) (2021-06-04) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v1.3.0 ([#549](https://www.github.com/googleapis/java-logging/issues/549)) ([b6a7de0](https://www.github.com/googleapis/java-logging/commit/b6a7de0c8d698f33b261b5392f888022c0877000)) + +## [2.3.0](https://www.github.com/googleapis/java-logging/compare/v2.2.3...v2.3.0) (2021-05-26) + + +### Features + +* add `gcf-owl-bot[bot]` to `ignoreAuthors` ([#534](https://www.github.com/googleapis/java-logging/issues/534)) ([5e8a13f](https://www.github.com/googleapis/java-logging/commit/5e8a13f64ef29f2541aa246771ac1659c9f29e97)) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v1.2.0 ([#532](https://www.github.com/googleapis/java-logging/issues/532)) ([8a30a36](https://www.github.com/googleapis/java-logging/commit/8a30a365310f07378e65e8e75e70b4fcbb920e17)) + +### [2.2.3](https://www.github.com/googleapis/java-logging/compare/v2.2.2...v2.2.3) (2021-05-11) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v1.1.0 ([#522](https://www.github.com/googleapis/java-logging/issues/522)) ([12fdf2a](https://www.github.com/googleapis/java-logging/commit/12fdf2afa2090bee0d23b30761561d2215ca13a3)) + +### [2.2.2](https://www.github.com/googleapis/java-logging/compare/v2.2.1...v2.2.2) (2021-04-24) + + +### Bug Fixes + +* release scripts from issuing overlapping phases ([#496](https://www.github.com/googleapis/java-logging/issues/496)) ([e3c1e84](https://www.github.com/googleapis/java-logging/commit/e3c1e84244b5f8cc4a792fd8c6346757f114d186)) +* typo ([#491](https://www.github.com/googleapis/java-logging/issues/491)) ([9b0423f](https://www.github.com/googleapis/java-logging/commit/9b0423fdad66368be15c2fa28f783f31964d5d9a)) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.21.1 ([#500](https://www.github.com/googleapis/java-logging/issues/500)) ([f5581a5](https://www.github.com/googleapis/java-logging/commit/f5581a55dfe99812f0538ad19f9a3a259401323a)) +* update dependency com.google.cloud:google-cloud-shared-dependencies to v1 ([#507](https://www.github.com/googleapis/java-logging/issues/507)) ([b15d59b](https://www.github.com/googleapis/java-logging/commit/b15d59bea99a6c840b6316f5e25487cc8f057515)) + +### [2.2.1](https://www.github.com/googleapis/java-logging/compare/v2.2.0...v2.2.1) (2021-04-09) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.21.0 ([#481](https://www.github.com/googleapis/java-logging/issues/481)) ([944e190](https://www.github.com/googleapis/java-logging/commit/944e19060b6e1f47567783365e80a54b153d472c)) + +## [2.2.0](https://www.github.com/googleapis/java-logging/compare/v2.1.5...v2.2.0) (2021-03-11) + + +### Features + +* **generator:** update protoc to v3.15.3 ([#454](https://www.github.com/googleapis/java-logging/issues/454)) ([1e61adb](https://www.github.com/googleapis/java-logging/commit/1e61adb4b817ff099e17ccc9a4433fc5061a4826)) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.20.1 ([#465](https://www.github.com/googleapis/java-logging/issues/465)) ([676d0ba](https://www.github.com/googleapis/java-logging/commit/676d0baea2c591f477c0036191874c3d40288251)) + +### [2.1.5](https://www.github.com/googleapis/java-logging/compare/v2.1.4...v2.1.5) (2021-02-25) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.20.0 ([#449](https://www.github.com/googleapis/java-logging/issues/449)) ([921553a](https://www.github.com/googleapis/java-logging/commit/921553a44e04afed95d6482eda210df43baf177d)) + +### [2.1.4](https://www.github.com/googleapis/java-logging/compare/v2.1.3...v2.1.4) (2021-02-22) + + +### Documentation + +* generate sample code in the Java microgenerator ([#423](https://www.github.com/googleapis/java-logging/issues/423)) ([8649f2f](https://www.github.com/googleapis/java-logging/commit/8649f2fa8d8d730422ea426142fba2bf3ebfec94)) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.19.0 ([#439](https://www.github.com/googleapis/java-logging/issues/439)) ([9cd8474](https://www.github.com/googleapis/java-logging/commit/9cd8474fdcd313f08216642254d72de9ce1a3214)) + +### [2.1.3](https://www.github.com/googleapis/java-logging/compare/v2.1.2...v2.1.3) (2021-01-22) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.17.1 ([#390](https://www.github.com/googleapis/java-logging/issues/390)) ([3054f17](https://www.github.com/googleapis/java-logging/commit/3054f17bb23f9ac99e373d5368f5e18b9668b917)) +* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.18.0 ([#392](https://www.github.com/googleapis/java-logging/issues/392)) ([219a7f8](https://www.github.com/googleapis/java-logging/commit/219a7f85d06327fe0bac4b7c1a36bda17bbb3382)) + +### [2.1.2](https://www.github.com/googleapis/java-logging/compare/v2.1.1...v2.1.2) (2020-12-15) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.17.0 ([#373](https://www.github.com/googleapis/java-logging/issues/373)) ([af43940](https://www.github.com/googleapis/java-logging/commit/af439404fb7786e8bc1856ee4b03796110677c98)) + +### [2.1.1](https://www.github.com/googleapis/java-logging/compare/v2.1.0...v2.1.1) (2020-12-14) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.16.1 ([84c8865](https://www.github.com/googleapis/java-logging/commit/84c88659d1a47633bcd545609262f71e747aaaed)) + +## [2.1.0](https://www.github.com/googleapis/java-logging/compare/v2.0.1...v2.1.0) (2020-12-10) + + +### Features + +* add support for k8s_container resource type ([#207](https://www.github.com/googleapis/java-logging/issues/207)) ([233efcc](https://www.github.com/googleapis/java-logging/commit/233efcce7d08cc66088d367b7fb6c104cb2f3a46)) +* fix resourceNames ([#24](https://www.github.com/googleapis/java-logging/issues/24)) ([70242d5](https://www.github.com/googleapis/java-logging/commit/70242d525dc3164c043f86d720e9210af40c6af5)) +* Makes remaining LogBucket and LogViews methods public ([#336](https://www.github.com/googleapis/java-logging/issues/336)) ([f3472c2](https://www.github.com/googleapis/java-logging/commit/f3472c27c79740cb62f83eaff66bb48f3e4ac723)) + + +### Dependencies + +* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.16.0 ([#350](https://www.github.com/googleapis/java-logging/issues/350)) ([ea92588](https://www.github.com/googleapis/java-logging/commit/ea9258838c66be244c440c76f84e5db729661791)) + + +### Documentation + +* specify current version ([#356](https://www.github.com/googleapis/java-logging/issues/356)) ([729b650](https://www.github.com/googleapis/java-logging/commit/729b650ff6a5f5022e5e5a32b0ef7b2c1642858f)) + +### [2.0.1](https://www.github.com/googleapis/java-logging/compare/v2.0.0...v2.0.1) (2020-11-12) + + +### Dependencies + +* update googleapis/code-suggester action to v1.8.1 ([#321](https://www.github.com/googleapis/java-logging/issues/321)) ([cc303c3](https://www.github.com/googleapis/java-logging/commit/cc303c3494cf10dc611ddd1901b2befcf54f32a4)) + +## [2.0.0](https://www.github.com/googleapis/java-logging/compare/v1.101.2...v2.0.0) (2020-11-11) + + +### ⚠ BREAKING CHANGES + +* previously if the user called listLogEntries API with no parameters, the query would try to retrieve all log entries, taking up time and eventually crashing on projects with high volume logs. The new behavior complies with gcloud: if no timestamp filter was specified, it appends a filter covering last 24 hours. +* remove Start/EndTime from LogSink, Metadata from LogEntry, implement multipattern resource names (#174) + +### Features + +* add logging bucket destination for log sinks ([#226](https://www.github.com/googleapis/java-logging/issues/226)) ([ef97aae](https://www.github.com/googleapis/java-logging/commit/ef97aae71c550c4501b231c32d6d58746af4d130)) +* expose log exclusion apis ([#162](https://www.github.com/googleapis/java-logging/issues/162)) ([0038828](https://www.github.com/googleapis/java-logging/commit/00388289e2dc379b65d790d3af1fc3520b6843e9)) +* remove Start/EndTime from LogSink, Metadata from LogEntry, implement multipattern resource names ([#174](https://www.github.com/googleapis/java-logging/issues/174)) ([d3d2370](https://www.github.com/googleapis/java-logging/commit/d3d2370a5b2ffcf012faba0a1b893a2321d58ba0)) +* update retry settings ([#201](https://www.github.com/googleapis/java-logging/issues/201)) ([6b9d382](https://www.github.com/googleapis/java-logging/commit/6b9d3824a1dde94ac6c4b05627737d8605340f1f)) +* **deps:** adopt flatten plugin and google-cloud-shared-dependencies ([#191](https://www.github.com/googleapis/java-logging/issues/191)) ([e1ece40](https://www.github.com/googleapis/java-logging/commit/e1ece4063dc1f022b043ed3209cfcae3f8323c71)) + + +### Bug Fixes + +* add default time range filter for ListLogEntries API ([#304](https://www.github.com/googleapis/java-logging/issues/304)) ([c2f40df](https://www.github.com/googleapis/java-logging/commit/c2f40df6ed815e2229e0381a993e7e94e2e651fc)) +* make TransportChannel autocloseable ([#212](https://www.github.com/googleapis/java-logging/issues/212)) ([e4853b1](https://www.github.com/googleapis/java-logging/commit/e4853b180193f8e5a5c1151917a74745b5dd4427)) +* remove usage of deprecated newInstance() method ([#203](https://www.github.com/googleapis/java-logging/issues/203)) ([039d9ba](https://www.github.com/googleapis/java-logging/commit/039d9ba17fff6f9851091166eeba1e7c8d0cd4bc)) + + +### Dependencies + +* update core dependencies ([#170](https://www.github.com/googleapis/java-logging/issues/170)) ([5ab9181](https://www.github.com/googleapis/java-logging/commit/5ab9181dd0774a631cd6997cb9d15bff1b83592f)) +* update dependency com.google.api:api-common to v1.9.2 ([#169](https://www.github.com/googleapis/java-logging/issues/169)) ([288a894](https://www.github.com/googleapis/java-logging/commit/288a894f3ec0bda774b1fbc6c81690a92c387757)) +* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.10.0 ([#254](https://www.github.com/googleapis/java-logging/issues/254)) ([d63b4b4](https://www.github.com/googleapis/java-logging/commit/d63b4b4198235af54ed84d153be8229469690afa)) +* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.10.2 ([#273](https://www.github.com/googleapis/java-logging/issues/273)) ([870d7d7](https://www.github.com/googleapis/java-logging/commit/870d7d72a8938472354008fc9ea11bc36b5789ad)) +* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.13.0 ([#289](https://www.github.com/googleapis/java-logging/issues/289)) ([1488370](https://www.github.com/googleapis/java-logging/commit/148837000588892f8c92a9d9354a3c30f0b0faad)) +* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.14.1 ([#310](https://www.github.com/googleapis/java-logging/issues/310)) ([cc4b57f](https://www.github.com/googleapis/java-logging/commit/cc4b57f2e50df23bd85045fbd4b00462eb77969a)) +* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.15.0 ([#320](https://www.github.com/googleapis/java-logging/issues/320)) ([e97dda7](https://www.github.com/googleapis/java-logging/commit/e97dda77029ed7cde83b4499e417468adc34ef58)) +* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.8.6 ([#200](https://www.github.com/googleapis/java-logging/issues/200)) ([a4f19e8](https://www.github.com/googleapis/java-logging/commit/a4f19e8afa78ced9de5b2d2f96231373493e4ca8)) +* update dependency com.google.cloud:google-cloud-shared-dependencies to v0.9.0 ([#224](https://www.github.com/googleapis/java-logging/issues/224)) ([506738c](https://www.github.com/googleapis/java-logging/commit/506738c61b1415edff0cec9970e2f7905b661059)) +* update dependency com.google.protobuf:protobuf-bom to v3.12.2 ([#168](https://www.github.com/googleapis/java-logging/issues/168)) ([2732f81](https://www.github.com/googleapis/java-logging/commit/2732f81d932410bc3e39d4add76bac542325a575)) + +### [1.101.2](https://www.github.com/googleapis/java-logging/compare/v1.101.1...v1.101.2) (2020-06-10) + + +### Bug Fixes + +* remove duplicate classes provided by proto-google-common-protos ([#177](https://www.github.com/googleapis/java-logging/issues/177)) ([08d8639](https://www.github.com/googleapis/java-logging/commit/08d86391250642cbe4bac27b3853fe7f40458cdc)) + + +### Dependencies + +* update dependency com.google.api.grpc:proto-google-common-protos to v1.18.0 ([#156](https://www.github.com/googleapis/java-logging/issues/156)) ([84a6ccd](https://www.github.com/googleapis/java-logging/commit/84a6ccde0cf01fc0d7c331300abadfcf4e004b7a)) +* update dependency com.google.guava:guava-bom to v29 ([#136](https://www.github.com/googleapis/java-logging/issues/136)) ([8c261a0](https://www.github.com/googleapis/java-logging/commit/8c261a0d3386bf3867fda7cc0eac2e6821639359)) +* update dependency com.google.http-client:google-http-client-bom to v1.35.0 ([#153](https://www.github.com/googleapis/java-logging/issues/153)) ([181447a](https://www.github.com/googleapis/java-logging/commit/181447a6b33ed34de16926da008e789ac5570043)) +* update dependency com.google.protobuf:protobuf-bom to v3.12.0 ([#165](https://www.github.com/googleapis/java-logging/issues/165)) ([62ec11d](https://www.github.com/googleapis/java-logging/commit/62ec11d0f4be627a291567d356b0912d35b00f99)) +* update dependency io.grpc:grpc-bom to v1.29.0 ([#149](https://www.github.com/googleapis/java-logging/issues/149)) ([5841918](https://www.github.com/googleapis/java-logging/commit/5841918619873f500efe000d60bd8d3c5f5ab0d8)) +* update dependency org.threeten:threetenbp to v1.4.4 ([#151](https://www.github.com/googleapis/java-logging/issues/151)) ([abeac81](https://www.github.com/googleapis/java-logging/commit/abeac81a3117eb42ec3bfa9bfa1b934a303bc90e)) + +### [1.101.1](https://www.github.com/googleapis/java-logging/compare/v1.101.0...v1.101.1) (2020-04-07) + + +### Dependencies + +* update core dependencies ([#115](https://www.github.com/googleapis/java-logging/issues/115)) ([cc89e00](https://www.github.com/googleapis/java-logging/commit/cc89e00a7a3d6b1339c73f4de7651da0eebdf411)) +* update core dependencies to v1.93.4 ([#131](https://www.github.com/googleapis/java-logging/issues/131)) ([77c5cf6](https://www.github.com/googleapis/java-logging/commit/77c5cf6175936c51acaa3e441baf91e629475ae2)) +* update dependency org.threeten:threetenbp to v1.4.3 ([#117](https://www.github.com/googleapis/java-logging/issues/117)) ([1a4ad46](https://www.github.com/googleapis/java-logging/commit/1a4ad461f5e2ac3252b9e287bbc9015eae00e0fa)) + +## [1.101.0](https://www.github.com/googleapis/java-logging/compare/v1.100.0...v1.101.0) (2020-03-25) + + +### Features + +* add CmekSettings options ([#89](https://www.github.com/googleapis/java-logging/issues/89)) ([f76206d](https://www.github.com/googleapis/java-logging/commit/f76206d6d137fec9e73ef7e93a8b77193d71166c)) + + +### Bug Fixes + +* **regen:** undeprecate resourcenames until multi-pattern resource names are available ([#108](https://www.github.com/googleapis/java-logging/issues/108)) ([4ca5895](https://www.github.com/googleapis/java-logging/commit/4ca5895f2bb83fcf1c7ecf908aae1c50d9cd89d9)) + + +### Dependencies + +* update core dependencies ([#61](https://www.github.com/googleapis/java-logging/issues/61)) ([a73322c](https://www.github.com/googleapis/java-logging/commit/a73322cb0e8f43eb253a4004189f1e4d387dcb1c)) +* update core dependencies ([#85](https://www.github.com/googleapis/java-logging/issues/85)) ([5e61aa7](https://www.github.com/googleapis/java-logging/commit/5e61aa7180934af6b63e845f2d172c6e6d08d0ee)) +* update core dependencies ([#92](https://www.github.com/googleapis/java-logging/issues/92)) ([4fe64cc](https://www.github.com/googleapis/java-logging/commit/4fe64cc5fa0c680733e42cfc6d40c9e7aaac77a6)) +* update core dependencies to v1.93.1 ([#113](https://www.github.com/googleapis/java-logging/issues/113)) ([2d68fe9](https://www.github.com/googleapis/java-logging/commit/2d68fe9a9653d08eec5427f877848cbc25c47c4b)) +* update core deps ([#109](https://www.github.com/googleapis/java-logging/issues/109)) ([75d38f1](https://www.github.com/googleapis/java-logging/commit/75d38f1d6d56605f5d446cc581a5abf96256c3f4)) +* update dependency com.google.api:api-common to v1.9.0 ([#120](https://www.github.com/googleapis/java-logging/issues/120)) ([87ebf36](https://www.github.com/googleapis/java-logging/commit/87ebf36b455478357ea1c0185584d5813244ade8)) +* update dependency com.google.http-client:google-http-client-bom to v1.34.1 ([#81](https://www.github.com/googleapis/java-logging/issues/81)) ([dacc7db](https://www.github.com/googleapis/java-logging/commit/dacc7db6775a5489f1d43467bbece7fd781e14ba)) +* update dependency com.google.http-client:google-http-client-bom to v1.34.2 ([#94](https://www.github.com/googleapis/java-logging/issues/94)) ([55f6936](https://www.github.com/googleapis/java-logging/commit/55f6936f9933d17d29ea5244d93b9460837a7c70)) +* update dependency com.google.protobuf:protobuf-bom to v3.11.3 ([#87](https://www.github.com/googleapis/java-logging/issues/87)) ([dee31b3](https://www.github.com/googleapis/java-logging/commit/dee31b386b7b930419013a17cb1ae0399d7a5bdf)) +* update dependency com.google.protobuf:protobuf-bom to v3.11.4 ([#95](https://www.github.com/googleapis/java-logging/issues/95)) ([954897e](https://www.github.com/googleapis/java-logging/commit/954897e43c746961d69550644f1dd5a2936d50e5)) + + +### Documentation + +* **regen:** update sample code to set total timeout, add API client header test ([#91](https://www.github.com/googleapis/java-logging/issues/91)) ([133a762](https://www.github.com/googleapis/java-logging/commit/133a762a93f0bd2725edc5342eada77459c78896)) + +## [1.100.0](https://www.github.com/googleapis/java-logging/compare/v1.99.0...v1.100.0) (2020-01-23) + + +### Features + +* add label fullStacktrace ([#40](https://www.github.com/googleapis/java-logging/issues/40)) ([43e1953](https://www.github.com/googleapis/java-logging/commit/43e19533f969d0e2a2c0c31669a4de191e8cd67e)) + + +### Bug Fixes + +* support for Cloud Run monitored resource ([#78](https://www.github.com/googleapis/java-logging/issues/78)) ([b3c1b68](https://www.github.com/googleapis/java-logging/commit/b3c1b68712060299c9df5928ec011f556b8340ad)), closes [#71](https://www.github.com/googleapis/java-logging/issues/71) + + +### Dependencies + +* update core dependencies ([#54](https://www.github.com/googleapis/java-logging/issues/54)) ([9ae3410](https://www.github.com/googleapis/java-logging/commit/9ae341087e99edce79d30ddc7d8aa33e347f20d5)) +* update dependency com.google.http-client:google-http-client-bom to v1.34.0 ([#45](https://www.github.com/googleapis/java-logging/issues/45)) ([6bab25b](https://www.github.com/googleapis/java-logging/commit/6bab25b334405278de3bae6c9c2b3a88d872f9bd)) +* update dependency com.google.protobuf:protobuf-java to v3.11.1 ([eb0befc](https://www.github.com/googleapis/java-logging/commit/eb0befc97a838b2c003851973d53e8530b54b7a7)) +* update dependency org.threeten:threetenbp to v1.4.1 ([f560dca](https://www.github.com/googleapis/java-logging/commit/f560dca9466ce13a634da430ff2209234f22096e)) +* update libraries-bom to 3.3.0 ([#59](https://www.github.com/googleapis/java-logging/issues/59)) ([91c2a4e](https://www.github.com/googleapis/java-logging/commit/91c2a4e993ae2b60cd6c21ec271e805401724cc1)) + + +### Documentation + +* **regen:** updated javadocs from protoc update ([#41](https://www.github.com/googleapis/java-logging/issues/41)) ([63d626c](https://www.github.com/googleapis/java-logging/commit/63d626cb458aeb631fe2e87d83141bfb6e50e2d4)) + +## [1.99.0](https://www.github.com/googleapis/java-logging/compare/1.98.0...v1.99.0) (2019-11-20) + + +### Features + +* make repo releasable, add parent/bom ([#1](https://www.github.com/googleapis/java-logging/issues/1)) ([1249ea7](https://www.github.com/googleapis/java-logging/commit/1249ea764f2531ad7fc6958fc3df47da5bc004d9)) + + +### Dependencies + +* update dependency io.grpc:grpc-bom to v1.25.0 ([#7](https://www.github.com/googleapis/java-logging/issues/7)) ([f602d3b](https://www.github.com/googleapis/java-logging/commit/f602d3b9096e6121a3f776ac50615461af826053)) +* use google-cloud-core-bom and update to v1.91.3 ([#15](https://www.github.com/googleapis/java-logging/issues/15)) ([f2c9cb8](https://www.github.com/googleapis/java-logging/commit/f2c9cb86ffd6c604b57e8744de19d4b801f2cf00)) diff --git a/java-logging/CODE_OF_CONDUCT.md b/java-logging/CODE_OF_CONDUCT.md new file mode 100644 index 000000000000..2add2547a812 --- /dev/null +++ b/java-logging/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/java-logging/CONTRIBUTING.md b/java-logging/CONTRIBUTING.md new file mode 100644 index 000000000000..f2dbdee06bc3 --- /dev/null +++ b/java-logging/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/java-logging/LICENSE b/java-logging/LICENSE new file mode 100644 index 000000000000..261eeb9e9f8b --- /dev/null +++ b/java-logging/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/java-logging/README.md b/java-logging/README.md new file mode 100644 index 000000000000..f9956d9794f5 --- /dev/null +++ b/java-logging/README.md @@ -0,0 +1,487 @@ +# Google Cloud Logging Client for Java + +Java idiomatic client for [Cloud Logging][product-docs]. + +[![Maven][maven-version-image]][maven-version-link] +![Stability][stability-image] + +- [Product Documentation][product-docs] +- [Client Library Documentation][javadocs] + + +## Quickstart + +If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file: + +```xml + + + + com.google.cloud + libraries-bom + 26.55.0 + pom + import + + + + + + + com.google.cloud + google-cloud-logging + + + + +``` + +If you are using Maven without the BOM, add this to your dependencies: + + +```xml + + com.google.cloud + google-cloud-logging + 3.21.3 + + +``` + +If you are using Gradle 5.x or later, add this to your dependencies: + +```Groovy +implementation platform('com.google.cloud:libraries-bom:26.73.0') + +implementation 'com.google.cloud:google-cloud-logging' +``` +If you are using Gradle without BOM, add this to your dependencies: + +```Groovy +implementation 'com.google.cloud:google-cloud-logging:3.23.9' +``` + +If you are using SBT, add this to your dependencies: + +```Scala +libraryDependencies += "com.google.cloud" % "google-cloud-logging" % "3.23.9" +``` + +## Authentication + +See the [Authentication][authentication] section in the base directory's README. + +## Authorization + +The client application making API calls must be granted [authorization scopes][auth-scopes] required for the desired Cloud Logging APIs, and the authenticated principal must have the [IAM role(s)][predefined-iam-roles] required to access GCP resources using the Cloud Logging API calls. + +## Getting Started + +### Prerequisites + +You will need a [Google Cloud Platform Console][developer-console] project with the Cloud Logging [API enabled][enable-api]. +You will need to [enable billing][enable-billing] to use Google Cloud Logging. +[Follow these instructions][create-project] to get your project set up. You will also need to set up the local development environment by +[installing the Google Cloud Command Line Interface][cloud-cli] and running the following commands in command line: +`gcloud auth login` and `gcloud config set project [YOUR PROJECT ID]`. + +### Installation and setup + +You'll need to obtain the `google-cloud-logging` library. See the [Quickstart](#quickstart) section +to add `google-cloud-logging` as a dependency in your code. + +## About Cloud Logging + + +[Cloud Logging][product-docs] allows you to store, search, analyze, monitor, and alert on log data and events from Google Cloud and Amazon Web Services. Using the BindPlane service, you can also collect this data from over 150 common application components, on-premises systems, and hybrid cloud systems. BindPlane is included with your Google Cloud project at no additional cost. + +See the [Cloud Logging client library docs][javadocs] to learn how to +use this Cloud Logging Client Library. + + +#### Creating an authorized service object + +To make requests to Cloud Logging, you must create a service object with valid credentials. +You can then make API calls by calling methods on the Logging service object. +You can obtain credentials by using [Application Default Credentials](https://developers.google.com/identity/protocols/application-default-credentials). +Or you can use a [Service Account](https://cloud.google.com/iam/docs/service-accounts) which is a recommended way to obtain credentials. +The credentials can be automatically inferred from your [environment](https://cloud.google.com/docs/authentication/getting-started#setting_the_environment_variable). +Then you only need the following code to create your service object: + +```java +import com.google.cloud.logging.Logging; +import com.google.cloud.logging.LoggingOptions; + +LoggingOptions options = LoggingOptions.getDefaultInstance(); +try(Logging logging = options.getService()) { + // use logging here +} +``` + +For other options, see the [Authentication](https://github.com/googleapis/google-cloud-java#authentication) page. +The service object should be granted permissions to make API calls. +Each API call describes the permissions under Authorized Scopes section. +See [Logging API](https://cloud.google.com/logging/docs/reference/v2/rest) to find the required list of permissions or consult with [Access control guide](https://cloud.google.com/logging/docs/access-control) for predefined IAM roles that can be granted to the Logging service object. + +#### Creating a metric +With Logging you can create logs-based metrics. Logs-based metrics allow to keep track of the number +of log messages associated to specific events. Add the following imports at the top of your file: + +```java +import com.google.cloud.logging.Metric; +import com.google.cloud.logging.MetricInfo; +``` + +Then, to create the metric, use the following code: + +```java +MetricInfo metricInfo = MetricInfo.newBuilder("test-metric", "severity >= ERROR") + .setDescription("Log entries with severity higher or equal to ERROR") + .build(); +logging.create(metricInfo); +``` + +#### Writing log entries +For an interactive tutorial click + +[![Guide Me](_static/guide-me.svg)](https://console.cloud.google.com/?walkthrough_id=logging__logging-java) + +With Logging you can also write custom log entries. Add the following imports at the top of your +file: + +```java +import com.google.cloud.MonitoredResource; +import com.google.cloud.logging.LogEntry; +import com.google.cloud.logging.Logging; +import com.google.cloud.logging.Payload.StringPayload; + +import java.util.Collections; +``` + +Then, to write the log entries, use the following code: + +```java +LogEntry firstEntry = LogEntry.newBuilder(StringPayload.of("message")) + .setLogName("test-log") + .setResource(MonitoredResource.newBuilder("global") + .addLabel("project_id", options.getProjectId()) + .build()) + .build(); +logging.write(Collections.singleton(firstEntry)); +``` + +The library supports writing log entries synchronously and asynchronously. +In the synchronous mode each call to `write()` method results in a consequent call to Logging API to write a log entry. +In the asynchronous mode the call(s) to Logging API takes place asynchronously and few calls to `write()` method may be batched together to compose a single call to Logging API. +The default mode of writing is asynchronous. +It can be configured in the `java.util.logging` handler [configuration file](https://cloud.google.com/logging/docs/setup/java#javautillogging_configuration): + +``` +com.google.cloud.logging.LoggingHandler.synchronicity=SYNC +``` + +or in the code after initiating an instance of `Logging` by calling: + +```java +logging.setWriteSynchronicity(Synchronicity.SYNC); +``` + +NOTE: +> Writing log entries asynchronously in some Google Cloud managed environments (e.g. Cloud Functions) +> may lead to unexpected results such as absense of expected log entries or abnormal program execution. +> To avoid these unexpected results, it is recommended to use synchronous mode. + +#### Controlling the batching settings +As mentioned before, in the asynchronous mode the call(s) to Logging API takes place asynchronously and few calls to `write()` +method may be batched together to compose a single call to Logging API. In order to control the batching settings, the `LoggingOptions` +is enhanced with `BatchingSettings` which can be set as shown in example below: + +```java +import com.google.api.gax.batching.BatchingSettings; +import com.google.api.gax.batching.FlowControlSettings; +import com.google.api.gax.batching.FlowController; + +LoggingOptions actual = + LoggingOptions.newBuilder() + .setBatchingSettings( + BatchingSettings.newBuilder() + .setIsEnabled(true) + .setElementCountThreshold(1000L) + .setRequestByteThreshold(1048576L) + .setDelayThreshold(Duration.ofMillis(50L)) + .setFlowControlSettings( + FlowControlSettings.newBuilder() + .setMaxOutstandingElementCount(100000L) + .setMaxOutstandingRequestBytes(10485760L) + .setLimitExceededBehavior( + FlowController.LimitExceededBehavior.ThrowException) + .build()) + .build()) + .setProjectId('Your project ID') + .build(); +``` + +You can find more information about batching parameters see [BatchingSettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.batching.BatchingSettings). + +#### Listing log entries + +With Logging you can also list log entries that have been previously written. Add the following +imports at the top of your file: + +```java +import com.google.api.gax.paging.Page; +import com.google.cloud.logging.LogEntry; +import com.google.cloud.logging.Logging.EntryListOption; +``` + +Then, to list the log entries, use the following code: + +``` java +Page entries = logging.listLogEntries( + EntryListOption.filter("logName=projects/" + options.getProjectId() + "/logs/test-log")); +while (entries != null) { + for (LogEntry logEntry : entries.iterateAll()) { + System.out.println(logEntry); + } + entries = entries.getNextPage(); +} +``` +#### Add a Cloud Logging handler to a logger + +You can also register a `LoggingHandler` to a `java.util.logging.Logger` that publishes log entries +to Cloud Logging. Given the following logger: + +```java +private final static Logger LOGGER = Logger.getLogger(MyClass.class.getName()); +``` + +You can register a `LoggingHandler` with the code: + +```java +LoggingHandler.addHandler(LOGGER, new LoggingHandler()); +``` + +After that, logs generated using `LOGGER` will be also directed to Cloud Logging. + +Notice that you can also register a `LoggingHandler` via the `logging.properties` configuration +file. Adding, for instance, the following line: + +``` +com.google.cloud.examples.logging.snippets.AddLoggingHandler.handlers=com.google.cloud.logging.LoggingHandler +``` + +#### Alternative way to ingest logs in Google Cloud managed environments + +If you use Java logger with the Cloud Logging Handler, you can configure the handler to output logs to `stdout` using +the [structured logging Json format](https://cloud.google.com/logging/docs/structured-logging#special-payload-fields). +To do this, add `com.google.cloud.logging.LoggingHandler.redirectToStdout=true` to the logger configuration file. +You can use this configuration when running applications in Google Cloud managed environments such as AppEngine, Cloud Run, +Cloud Function or GKE. The logger agent installed on these environments can capture STDOUT and ingest it into Cloud Logging. +The agent can parse structured logs printed to STDOUT and capture additional log metadata beside the log payload. +The parsed information includes severity, source location, user labels, http request and tracing information. + +#### Auto-population of log entrys' metadata + +LogEntry object metadata information such as [monitored resource](https://cloud.google.com/logging/docs/reference/v2/rest/v2/MonitoredResource), +[Http request](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry#HttpRequest) or +[source location](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry#LogEntrySourceLocation) +are automatically populated with information that the library retrieves from the execution context. +The library populates only empty (set to `null`) LogEntry fields. +This behavior in the `Logging` instance can be opted out via `LoggingOptions`. +Call `LoggingOptions.Builder.setAutoPopulateMetadata(false)` to configure logging options to opt-out the metadata auto-population. +Cloud Logging handler can be configured to opt-out automatic population of the metadata using the logger configuration. +To disable the metadata auto-population add `com.google.cloud.logging.LoggingHandler.autoPopulateMetadata=false` +to the logger configuration file. + +The auto-population logic populates source location _only_ for log entries with `Severity.DEBUG` severity. +The execution context of the Http request and tracing information is maintained by `ContextHandler` class. +The context is managed in the scope of the thread. +If you do not use thread pools for multi-threading the `ContextHandler` can be configured to propagate the context +to the scope of the child threads. +To enable this add `com.google.cloud.logging.ContextHandler.useInheritedContext=true` to the logger configuration file. +The library provides two methods to update the context: + +* Manually set the context. You can use the following methods of the `Context.Builder` to set the context information. +Use the method `setRequest()` to setup the `HttpRequest` instance or `setRequestUrl()`, `setRequestMethod()`, +`setReferer() `, `setRemoteIp()` and `setServerIp()` to setup the fields of the `HttpRequest`. +The trace and span Ids can be set directly using `setTraceId()` and `setSpanId()` respectively. +Alternatively it can be parsed from the W3C tracing context header using `loadW3CTraceParentContext()` or +from the Google Cloud tracing context header using `loadCloudTraceContext()`. + + ```java + Context context = Context.newBuilder().setHttpRequest(request).setTrace(traceId).setSpanId(spanId).build(); + (new ContextHandler()).setCurrentContext(context); + ``` + +* Using [servlet initializer](https://github.com/googleapis/java-logging-servlet-initializer). +If your application uses a Web server based on Jakarta servlets (e.g. Jetty or Tomcat), you can add the servlet initializer +package to your WAR. The package implements a service provider interface (SPI) for +[javax.servlet.ServletContainerInitializer](https://docs.oracle.com/javaee/6/api/javax/servlet/ServletContainerInitializer.html) +and filters all servlet requests to automatically capture the execution context of the servlet request and store it using +`ContextHandler` class. The stored `Context` class instances are used to populate Http request and tracing information. +If you use Maven, to use the servlet initializer add the following dependency to your BOM: + + ```xml + + com.google.cloud + google-cloud-logging-servlet-initializer + + ``` +#### Population of Trace/Span ID fields in a LogEntry +Cloud Logging libraries use [trace fields within LogEntry](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry#FIELDS.trace) to capture trace contexts, which enables the [correlation of logs and traces](https://cloud.google.com/logging/docs/view/correlate-logs), and distributed tracing troubleshooting. +These tracing fields, including [trace](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry#FIELDS.trace), [spanId](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry#FIELDS.span_id), and [traceSampled](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry#FIELDS.trace_sampled), define the trace context for a `LogEntry`. + +Tracing information set manually takes precedence over information set by the following methods: + +* Auto-populate Trace/Span ID from OpenTelemetry Context +If you are using OpenTelemetry and there is an active span in the OpenTelemetry Context, the `trace`, `span_id`, and `trace_sampled` fields in the log entry are populated from the active span. More information about OpenTelemetry can be found [here](https://opentelemetry.io/docs/languages/java/). + +* Use the [servlet initializer](https://github.com/googleapis/java-logging-servlet-initializer) to Populate Trace/Span ID from HTTP Headers +If trace/span Id are not manually set or auto-populated from OpenTelemetry context, you can use the [servlet initializer](https://github.com/googleapis/java-logging-servlet-initializer) to populate trace/span Id from HTTP headers. +This package filters all servlet requests to automatically capture the execution context of the servlet request and stores it by using ContextHandler class. Http request and trace/span Id information are populated from the stored Context class instances. +Using this method, trace/span Id can be automatically populated from either the [W3C Traceparent](https://www.w3.org/TR/trace-context) or [X-Cloud-Trace-Context](https://cloud.google.com/trace/docs/trace-context#legacy-http-header) headers. + + + + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-java/tree/main/samples) directory. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Native Image Logging Sample | [source code](https://github.com/googleapis/google-cloud-java/blob/main/samples/native-image-sample/src/main/java/com/example/logging/NativeImageLoggingSample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-java&page=editor&open_in_editor=samples/native-image-sample/src/main/java/com/example/logging/NativeImageLoggingSample.java) | +| Get Sink Metadata | [source code](https://github.com/googleapis/google-cloud-java/blob/main/samples/snippets/src/main/java/com/example/logging/GetSinkMetadata.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-java&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/logging/GetSinkMetadata.java) | +| List Log Entries | [source code](https://github.com/googleapis/google-cloud-java/blob/main/samples/snippets/src/main/java/com/example/logging/ListLogEntries.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-java&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/logging/ListLogEntries.java) | +| List Logs | [source code](https://github.com/googleapis/google-cloud-java/blob/main/samples/snippets/src/main/java/com/example/logging/ListLogs.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-java&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/logging/ListLogs.java) | +| Log Entry Write Http Request | [source code](https://github.com/googleapis/google-cloud-java/blob/main/samples/snippets/src/main/java/com/example/logging/LogEntryWriteHttpRequest.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-java&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/logging/LogEntryWriteHttpRequest.java) | +| Quickstart Sample | [source code](https://github.com/googleapis/google-cloud-java/blob/main/samples/snippets/src/main/java/com/example/logging/QuickstartSample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-java&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/logging/QuickstartSample.java) | +| Tail Log Entries | [source code](https://github.com/googleapis/google-cloud-java/blob/main/samples/snippets/src/main/java/com/example/logging/TailLogEntries.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-java&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/logging/TailLogEntries.java) | +| Write Log Entry | [source code](https://github.com/googleapis/google-cloud-java/blob/main/samples/snippets/src/main/java/com/example/logging/WriteLogEntry.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-java&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/logging/WriteLogEntry.java) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-java/blob/main/samples/snippets/src/main/java/com/example/logging/jul/Quickstart.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-java&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/logging/jul/Quickstart.java) | +| Example Enhancer | [source code](https://github.com/googleapis/google-cloud-java/blob/main/samples/snippets/src/main/java/com/example/logging/jul/enhancers/ExampleEnhancer.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-java&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/logging/jul/enhancers/ExampleEnhancer.java) | + + + +## Troubleshooting + +To get help, follow the instructions in the [shared Troubleshooting document][troubleshooting]. + +## Transport + +Cloud Logging uses gRPC for the transport layer. + +## Supported Java Versions + +Java 8 or above is required for using this client. + +Google's Java client libraries, +[Google Cloud Client Libraries][cloudlibs] +and +[Google Cloud API Libraries][apilibs], +follow the +[Oracle Java SE support roadmap][oracle] +(see the Oracle Java SE Product Releases section). + +### For new development + +In general, new feature development occurs with support for the lowest Java +LTS version covered by Oracle's Premier Support (which typically lasts 5 years +from initial General Availability). If the minimum required JVM for a given +library is changed, it is accompanied by a [semver][semver] major release. + +Java 11 and (in September 2021) Java 17 are the best choices for new +development. + +### Keeping production systems current + +Google tests its client libraries with all current LTS versions covered by +Oracle's Extended Support (which typically lasts 8 years from initial +General Availability). + +#### Legacy support + +Google's client libraries support legacy versions of Java runtimes with long +term stable libraries that don't receive feature updates on a best efforts basis +as it may not be possible to backport all patches. + +Google provides updates on a best efforts basis to apps that continue to use +Java 7, though apps might need to upgrade to current versions of the library +that supports their JVM. + +#### Where to find specific information + +The latest versions and the supported Java versions are identified on +the individual GitHub repository `github.com/GoogleAPIs/java-SERVICENAME` +and on [google-cloud-java][g-c-j]. + +## Versioning + + +This library follows [Semantic Versioning](http://semver.org/). + + + +## Contributing + + +Contributions to this library are always welcome and highly encouraged. + +See [CONTRIBUTING][contributing] for more information how to get started. + +Please note that this project is released with a Contributor Code of Conduct. By participating in +this project you agree to abide by its terms. See [Code of Conduct][code-of-conduct] for more +information. + + +## License + +Apache 2.0 - See [LICENSE][license] for more information. + +## CI Status + +Java Version | Status +------------ | ------ +Java 8 | [![Kokoro CI][kokoro-badge-image-2]][kokoro-badge-link-2] +Java 8 OSX | [![Kokoro CI][kokoro-badge-image-3]][kokoro-badge-link-3] +Java 8 Windows | [![Kokoro CI][kokoro-badge-image-4]][kokoro-badge-link-4] +Java 11 | [![Kokoro CI][kokoro-badge-image-5]][kokoro-badge-link-5] + +Java is a registered trademark of Oracle and/or its affiliates. + +[product-docs]: https://cloud.google.com/logging/docs +[javadocs]: https://cloud.google.com/java/docs/reference/google-cloud-logging/latest/history +[kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java7.svg +[kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java7.html +[kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8.svg +[kokoro-badge-link-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8.html +[kokoro-badge-image-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8-osx.svg +[kokoro-badge-link-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8-osx.html +[kokoro-badge-image-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8-win.svg +[kokoro-badge-link-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8-win.html +[kokoro-badge-image-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.svg +[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.html +[stability-image]: https://img.shields.io/badge/stability-stable-green +[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-logging.svg +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-logging/3.23.9 +[authentication]: https://github.com/googleapis/google-cloud-java#authentication +[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes +[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles +[iam-policy]: https://cloud.google.com/iam/docs/overview#cloud-iam-policy +[developer-console]: https://console.developers.google.com/ +[create-project]: https://cloud.google.com/resource-manager/docs/creating-managing-projects +[cloud-cli]: https://cloud.google.com/cli +[troubleshooting]: https://github.com/googleapis/google-cloud-java/blob/main/TROUBLESHOOTING.md +[contributing]: https://github.com/googleapis/google-cloud-java/blob/main/CONTRIBUTING.md +[code-of-conduct]: https://github.com/googleapis/google-cloud-java/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct +[license]: https://github.com/googleapis/google-cloud-java/blob/main/LICENSE +[enable-billing]: https://cloud.google.com/apis/docs/getting-started#enabling_billing +[enable-api]: https://console.cloud.google.com/flows/enableapi?apiid=logging.googleapis.com +[libraries-bom]: https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google-Cloud-Platform-Libraries-BOM +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png + +[semver]: https://semver.org/ +[cloudlibs]: https://cloud.google.com/apis/docs/client-libraries-explained +[apilibs]: https://cloud.google.com/apis/docs/client-libraries-explained#google_api_client_libraries +[oracle]: https://www.oracle.com/java/technologies/java-se-support-roadmap.html +[g-c-j]: http://github.com/googleapis/google-cloud-java diff --git a/java-logging/SECURITY.md b/java-logging/SECURITY.md new file mode 100644 index 000000000000..8b58ae9c01ae --- /dev/null +++ b/java-logging/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/java-logging/_static/guide-me.svg b/java-logging/_static/guide-me.svg new file mode 100644 index 000000000000..f6017fc50ad7 --- /dev/null +++ b/java-logging/_static/guide-me.svg @@ -0,0 +1,45 @@ + + + + + + GUIDE ME + + + + + + + diff --git a/java-logging/codecov.yaml b/java-logging/codecov.yaml new file mode 100644 index 000000000000..5724ea9478d7 --- /dev/null +++ b/java-logging/codecov.yaml @@ -0,0 +1,4 @@ +--- +codecov: + ci: + - source.cloud.google.com diff --git a/java-logging/env-tests-logging b/java-logging/env-tests-logging new file mode 160000 index 000000000000..b2f060f30170 --- /dev/null +++ b/java-logging/env-tests-logging @@ -0,0 +1 @@ +Subproject commit b2f060f30170d95a0fd813dc39cdaa6abca69ca9 diff --git a/java-logging/generation_config.yaml b/java-logging/generation_config.yaml new file mode 100644 index 000000000000..7913092ff23f --- /dev/null +++ b/java-logging/generation_config.yaml @@ -0,0 +1,22 @@ +gapic_generator_version: 2.64.2 +googleapis_commitish: b32495a713a68dd0dff90cf0b24021debfca048a +libraries_bom_version: 26.72.0 +libraries: + - api_shortname: logging + name_pretty: Cloud Logging + product_documentation: https://cloud.google.com/logging/docs + client_documentation: https://cloud.google.com/java/docs/reference/google-cloud-logging/latest/history + issue_tracker: https://issuetracker.google.com/savedsearches/559764 + release_level: stable + language: java + repo: googleapis/java-logging + repo_short: java-logging + distribution_name: com.google.cloud:google-cloud-logging + api_id: logging.googleapis.com + transport: grpc + library_type: GAPIC_COMBO + api_description: allows you to store, search, analyze, monitor, and alert on log data and events from Google Cloud and Amazon Web Services. Using the BindPlane service, you can also collect this data from over 150 common application components, on-premises systems, and hybrid cloud systems. BindPlane is included with your Google Cloud project at no additional cost. + codeowner_team: '@googleapis/api-logging @googleapis/yoshi-java @googleapis/api-logging-partners' + recommended_package: com.google.cloud.logging + GAPICs: + - proto_path: google/logging/v2 diff --git a/java-logging/google-cloud-logging-bom/pom.xml b/java-logging/google-cloud-logging-bom/pom.xml new file mode 100644 index 000000000000..26838f5594f9 --- /dev/null +++ b/java-logging/google-cloud-logging-bom/pom.xml @@ -0,0 +1,82 @@ + + + 4.0.0 + com.google.cloud + google-cloud-logging-bom + 3.23.10-SNAPSHOT + pom + + com.google.cloud + sdk-platform-java-config + 3.54.2 + + + Google Cloud logging BOM + https://github.com/googleapis/java-logging + + BOM for Google Cloud Logging + + + + Google LLC + + + + + chingor13 + Jeff Ching + chingor@google.com + Google LLC + + Developer + + + + + + scm:git:https://github.com/googleapis/java-logging.git + scm:git:git@github.com:googleapis/java-logging.git + https://github.com/googleapis/java-logging + + + + + + The Apache Software License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + + + + com.google.cloud + google-cloud-logging + 3.23.10-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-logging-v2 + 0.112.10-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-logging-v2 + 0.112.10-SNAPSHOT + + + + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + + true + + + + + diff --git a/java-logging/google-cloud-logging/clirr-ignored-differences.xml b/java-logging/google-cloud-logging/clirr-ignored-differences.xml new file mode 100644 index 000000000000..aff67cbada0b --- /dev/null +++ b/java-logging/google-cloud-logging/clirr-ignored-differences.xml @@ -0,0 +1,12 @@ + + + + 3003 + com/google/cloud/logging/Instrumentation + + + 7009 + com/google/cloud/logging/Instrumentation + Instrumentation() + + diff --git a/java-logging/google-cloud-logging/pom.xml b/java-logging/google-cloud-logging/pom.xml new file mode 100644 index 000000000000..bbc6bfdf1ef0 --- /dev/null +++ b/java-logging/google-cloud-logging/pom.xml @@ -0,0 +1,182 @@ + + + 4.0.0 + com.google.cloud + google-cloud-logging + 3.23.10-SNAPSHOT + jar + Google Cloud Logging + https://github.com/googleapis/java-logging + Java idiomatic client for Cloud Logging + + com.google.cloud + google-cloud-logging-parent + 3.23.10-SNAPSHOT + + + google-cloud-logging + + + + io.opentelemetry + opentelemetry-api + + + io.opentelemetry + opentelemetry-context + + + com.google.guava + guava + + + com.google.code.gson + gson + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.api + api-common + + + com.google.protobuf + protobuf-java + + + com.google.protobuf + protobuf-java-util + + + com.google.api.grpc + proto-google-common-protos + + + + com.google.api.grpc + proto-google-cloud-logging-v2 + + + com.google.api + gax + + + com.google.api + gax-grpc + + + org.threeten + threetenbp + + + com.google.cloud + google-cloud-core-grpc + + + com.google.auth + google-auth-library-oauth2-http + + + com.google.http-client + google-http-client + + + io.grpc + grpc-inprocess + + + com.google.cloud + google-cloud-core + + + com.google.errorprone + error_prone_annotations + + + com.google.auth + google-auth-library-credentials + + + + + junit + junit + test + + + org.easymock + easymock + test + + + org.objenesis + objenesis + test + + + com.google.truth + truth + test + + + com.google.cloud + google-cloud-core + test-jar + test + + + com.google.guava + guava-testlib + test + + + + com.google.api.grpc + grpc-google-cloud-logging-v2 + test + + + + io.opentelemetry + opentelemetry-sdk + test + + + io.opentelemetry + opentelemetry-sdk-testing + test + + + io.opentelemetry + opentelemetry-sdk-trace + test + + + + + com.google.api + gax-grpc + testlib + test + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + diff --git a/java-logging/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/ConfigClient.java b/java-logging/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/ConfigClient.java new file mode 100644 index 000000000000..6216cbaccbe8 --- /dev/null +++ b/java-logging/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/ConfigClient.java @@ -0,0 +1,5514 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.logging.v2.stub.ConfigServiceV2Stub; +import com.google.cloud.logging.v2.stub.ConfigServiceV2StubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.logging.v2.BillingAccountLocationName; +import com.google.logging.v2.BillingAccountName; +import com.google.logging.v2.BucketMetadata; +import com.google.logging.v2.CmekSettings; +import com.google.logging.v2.CopyLogEntriesMetadata; +import com.google.logging.v2.CopyLogEntriesRequest; +import com.google.logging.v2.CopyLogEntriesResponse; +import com.google.logging.v2.CreateBucketRequest; +import com.google.logging.v2.CreateExclusionRequest; +import com.google.logging.v2.CreateLinkRequest; +import com.google.logging.v2.CreateSinkRequest; +import com.google.logging.v2.CreateViewRequest; +import com.google.logging.v2.DeleteBucketRequest; +import com.google.logging.v2.DeleteExclusionRequest; +import com.google.logging.v2.DeleteLinkRequest; +import com.google.logging.v2.DeleteSinkRequest; +import com.google.logging.v2.DeleteViewRequest; +import com.google.logging.v2.FolderLocationName; +import com.google.logging.v2.FolderName; +import com.google.logging.v2.GetBucketRequest; +import com.google.logging.v2.GetCmekSettingsRequest; +import com.google.logging.v2.GetExclusionRequest; +import com.google.logging.v2.GetLinkRequest; +import com.google.logging.v2.GetSettingsRequest; +import com.google.logging.v2.GetSinkRequest; +import com.google.logging.v2.GetViewRequest; +import com.google.logging.v2.Link; +import com.google.logging.v2.LinkMetadata; +import com.google.logging.v2.LinkName; +import com.google.logging.v2.ListBucketsRequest; +import com.google.logging.v2.ListBucketsResponse; +import com.google.logging.v2.ListExclusionsRequest; +import com.google.logging.v2.ListExclusionsResponse; +import com.google.logging.v2.ListLinksRequest; +import com.google.logging.v2.ListLinksResponse; +import com.google.logging.v2.ListSinksRequest; +import com.google.logging.v2.ListSinksResponse; +import com.google.logging.v2.ListViewsRequest; +import com.google.logging.v2.ListViewsResponse; +import com.google.logging.v2.LocationName; +import com.google.logging.v2.LogBucket; +import com.google.logging.v2.LogBucketName; +import com.google.logging.v2.LogExclusion; +import com.google.logging.v2.LogExclusionName; +import com.google.logging.v2.LogSink; +import com.google.logging.v2.LogSinkName; +import com.google.logging.v2.LogView; +import com.google.logging.v2.OrganizationLocationName; +import com.google.logging.v2.OrganizationName; +import com.google.logging.v2.ProjectName; +import com.google.logging.v2.Settings; +import com.google.logging.v2.SettingsName; +import com.google.logging.v2.UndeleteBucketRequest; +import com.google.logging.v2.UpdateBucketRequest; +import com.google.logging.v2.UpdateCmekSettingsRequest; +import com.google.logging.v2.UpdateExclusionRequest; +import com.google.logging.v2.UpdateSettingsRequest; +import com.google.logging.v2.UpdateSinkRequest; +import com.google.logging.v2.UpdateViewRequest; +import com.google.longrunning.Operation; +import com.google.longrunning.OperationsClient; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Service for configuring sinks used to route log entries. + * + *

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
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ *   GetBucketRequest request =
+ *       GetBucketRequest.newBuilder()
+ *           .setName(
+ *               LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]")
+ *                   .toString())
+ *           .build();
+ *   LogBucket response = configClient.getBucket(request);
+ * }
+ * }
+ * + *

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

ListBuckets

Lists log buckets.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listBuckets(ListBucketsRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • listBuckets(BillingAccountLocationName parent) + *

  • listBuckets(FolderLocationName parent) + *

  • listBuckets(LocationName parent) + *

  • listBuckets(OrganizationLocationName parent) + *

  • listBuckets(String parent) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listBucketsPagedCallable() + *

  • listBucketsCallable() + *

+ *

GetBucket

Gets a log bucket.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getBucket(GetBucketRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getBucketCallable() + *

+ *

CreateBucketAsync

Creates a log bucket asynchronously that can be used to store log entries. + *

After a bucket has been created, the bucket's location cannot be changed.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • createBucketAsyncAsync(CreateBucketRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • createBucketAsyncOperationCallable() + *

  • createBucketAsyncCallable() + *

+ *

UpdateBucketAsync

Updates a log bucket asynchronously. + *

If the bucket has a `lifecycle_state` of `DELETE_REQUESTED`, then `FAILED_PRECONDITION` will be returned. + *

After a bucket has been created, the bucket's location cannot be changed.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • updateBucketAsyncAsync(UpdateBucketRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • updateBucketAsyncOperationCallable() + *

  • updateBucketAsyncCallable() + *

+ *

CreateBucket

Creates a log bucket that can be used to store log entries. After a bucket has been created, the bucket's location cannot be changed.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • createBucket(CreateBucketRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • createBucketCallable() + *

+ *

UpdateBucket

Updates a log bucket. + *

If the bucket has a `lifecycle_state` of `DELETE_REQUESTED`, then `FAILED_PRECONDITION` will be returned. + *

After a bucket has been created, the bucket's location cannot be changed.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • updateBucket(UpdateBucketRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • updateBucketCallable() + *

+ *

DeleteBucket

Deletes a log bucket. + *

Changes the bucket's `lifecycle_state` to the `DELETE_REQUESTED` state. After 7 days, the bucket will be purged and all log entries in the bucket will be permanently deleted.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • deleteBucket(DeleteBucketRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • deleteBucketCallable() + *

+ *

UndeleteBucket

Undeletes a log bucket. A bucket that has been deleted can be undeleted within the grace period of 7 days.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • undeleteBucket(UndeleteBucketRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • undeleteBucketCallable() + *

+ *

ListViews

Lists views on a log bucket.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listViews(ListViewsRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • listViews(String parent) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listViewsPagedCallable() + *

  • listViewsCallable() + *

+ *

GetView

Gets a view on a log bucket..

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getView(GetViewRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getViewCallable() + *

+ *

CreateView

Creates a view over log entries in a log bucket. A bucket may contain a maximum of 30 views.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • createView(CreateViewRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • createViewCallable() + *

+ *

UpdateView

Updates a view on a log bucket. This method replaces the following fields in the existing view with values from the new view: `filter`. If an `UNAVAILABLE` error is returned, this indicates that system is not in a state where it can update the view. If this occurs, please try again in a few minutes.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • updateView(UpdateViewRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • updateViewCallable() + *

+ *

DeleteView

Deletes a view on a log bucket. If an `UNAVAILABLE` error is returned, this indicates that system is not in a state where it can delete the view. If this occurs, please try again in a few minutes.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • deleteView(DeleteViewRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • deleteViewCallable() + *

+ *

ListSinks

Lists sinks.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listSinks(ListSinksRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • listSinks(BillingAccountName parent) + *

  • listSinks(FolderName parent) + *

  • listSinks(OrganizationName parent) + *

  • listSinks(ProjectName parent) + *

  • listSinks(String parent) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listSinksPagedCallable() + *

  • listSinksCallable() + *

+ *

GetSink

Gets a sink.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getSink(GetSinkRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • getSink(LogSinkName sinkName) + *

  • getSink(String sinkName) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getSinkCallable() + *

+ *

CreateSink

Creates a sink that exports specified log entries to a destination. The export of newly-ingested log entries begins immediately, unless the sink's `writer_identity` is not permitted to write to the destination. A sink can export log entries only from the resource owning the sink.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • createSink(CreateSinkRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • createSink(BillingAccountName parent, LogSink sink) + *

  • createSink(FolderName parent, LogSink sink) + *

  • createSink(OrganizationName parent, LogSink sink) + *

  • createSink(ProjectName parent, LogSink sink) + *

  • createSink(String parent, LogSink sink) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • createSinkCallable() + *

+ *

UpdateSink

Updates a sink. This method replaces the following fields in the existing sink with values from the new sink: `destination`, and `filter`. + *

The updated sink might also have a new `writer_identity`; see the `unique_writer_identity` field.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • updateSink(UpdateSinkRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • updateSink(LogSinkName sinkName, LogSink sink) + *

  • updateSink(String sinkName, LogSink sink) + *

  • updateSink(LogSinkName sinkName, LogSink sink, FieldMask updateMask) + *

  • updateSink(String sinkName, LogSink sink, FieldMask updateMask) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • updateSinkCallable() + *

+ *

DeleteSink

Deletes a sink. If the sink has a unique `writer_identity`, then that service account is also deleted.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • deleteSink(DeleteSinkRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • deleteSink(LogSinkName sinkName) + *

  • deleteSink(String sinkName) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • deleteSinkCallable() + *

+ *

CreateLink

Asynchronously creates a linked dataset in BigQuery which makes it possible to use BigQuery to read the logs stored in the log bucket. A log bucket may currently only contain one link.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • createLinkAsync(CreateLinkRequest request) + *

+ *

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

+ *
    + *
  • createLinkAsync(LogBucketName parent, Link link, String linkId) + *

  • createLinkAsync(String parent, Link link, String linkId) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • createLinkOperationCallable() + *

  • createLinkCallable() + *

+ *

DeleteLink

Deletes a link. This will also delete the corresponding BigQuery linked dataset.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • deleteLinkAsync(DeleteLinkRequest request) + *

+ *

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

+ *
    + *
  • deleteLinkAsync(LinkName name) + *

  • deleteLinkAsync(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • deleteLinkOperationCallable() + *

  • deleteLinkCallable() + *

+ *

ListLinks

Lists links.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listLinks(ListLinksRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • listLinks(LogBucketName parent) + *

  • listLinks(String parent) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listLinksPagedCallable() + *

  • listLinksCallable() + *

+ *

GetLink

Gets a link.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getLink(GetLinkRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • getLink(LinkName name) + *

  • getLink(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getLinkCallable() + *

+ *

ListExclusions

Lists all the exclusions on the _Default sink in a parent resource.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listExclusions(ListExclusionsRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • listExclusions(BillingAccountName parent) + *

  • listExclusions(FolderName parent) + *

  • listExclusions(OrganizationName parent) + *

  • listExclusions(ProjectName parent) + *

  • listExclusions(String parent) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listExclusionsPagedCallable() + *

  • listExclusionsCallable() + *

+ *

GetExclusion

Gets the description of an exclusion in the _Default sink.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getExclusion(GetExclusionRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • getExclusion(LogExclusionName name) + *

  • getExclusion(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getExclusionCallable() + *

+ *

CreateExclusion

Creates a new exclusion in the _Default sink in a specified parent resource. Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • createExclusion(CreateExclusionRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • createExclusion(BillingAccountName parent, LogExclusion exclusion) + *

  • createExclusion(FolderName parent, LogExclusion exclusion) + *

  • createExclusion(OrganizationName parent, LogExclusion exclusion) + *

  • createExclusion(ProjectName parent, LogExclusion exclusion) + *

  • createExclusion(String parent, LogExclusion exclusion) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • createExclusionCallable() + *

+ *

UpdateExclusion

Changes one or more properties of an existing exclusion in the _Default sink.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • updateExclusion(UpdateExclusionRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • updateExclusion(LogExclusionName name, LogExclusion exclusion, FieldMask updateMask) + *

  • updateExclusion(String name, LogExclusion exclusion, FieldMask updateMask) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • updateExclusionCallable() + *

+ *

DeleteExclusion

Deletes an exclusion in the _Default sink.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • deleteExclusion(DeleteExclusionRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • deleteExclusion(LogExclusionName name) + *

  • deleteExclusion(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • deleteExclusionCallable() + *

+ *

GetCmekSettings

Gets the Logging CMEK settings for the given resource. + *

Note: CMEK for the Log Router can be configured for Google Cloud projects, folders, organizations and billing accounts. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization. + *

See [Enabling CMEK for Log Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getCmekSettings(GetCmekSettingsRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getCmekSettingsCallable() + *

+ *

UpdateCmekSettings

Updates the Log Router CMEK settings for the given resource. + *

Note: CMEK for the Log Router can currently only be configured for Google Cloud organizations. Once configured, it applies to all projects and folders in the Google Cloud organization. + *

[UpdateCmekSettings][google.logging.v2.ConfigServiceV2.UpdateCmekSettings] will fail if 1) `kms_key_name` is invalid, or 2) the associated service account does not have the required `roles/cloudkms.cryptoKeyEncrypterDecrypter` role assigned for the key, or 3) access to the key is disabled. + *

See [Enabling CMEK for Log Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • updateCmekSettings(UpdateCmekSettingsRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • updateCmekSettingsCallable() + *

+ *

GetSettings

Gets the Log Router settings for the given resource. + *

Note: Settings for the Log Router can be get for Google Cloud projects, folders, organizations and billing accounts. Currently it can only be configured for organizations. Once configured for an organization, it applies to all projects and folders in the Google Cloud organization. + *

See [Enabling CMEK for Log Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getSettings(GetSettingsRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • getSettings(SettingsName name) + *

  • getSettings(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getSettingsCallable() + *

+ *

UpdateSettings

Updates the Log Router settings for the given resource. + *

Note: Settings for the Log Router can currently only be configured for Google Cloud organizations. Once configured, it applies to all projects and folders in the Google Cloud organization. + *

[UpdateSettings][google.logging.v2.ConfigServiceV2.UpdateSettings] will fail if 1) `kms_key_name` is invalid, or 2) the associated service account does not have the required `roles/cloudkms.cryptoKeyEncrypterDecrypter` role assigned for the key, or 3) access to the key is disabled. 4) `location_id` is not supported by Logging. 5) `location_id` violate OrgPolicy. + *

See [Enabling CMEK for Log Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • updateSettings(UpdateSettingsRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • updateSettings(Settings settings, FieldMask updateMask) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • updateSettingsCallable() + *

+ *

CopyLogEntries

Copies a set of log entries from a log bucket to a Cloud Storage bucket.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • copyLogEntriesAsync(CopyLogEntriesRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • copyLogEntriesOperationCallable() + *

  • copyLogEntriesCallable() + *

+ *
+ * + *

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 ConfigSettings to create(). + * For example: + * + *

To customize credentials: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * ConfigSettings configSettings =
+ *     ConfigSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * ConfigClient configClient = ConfigClient.create(configSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * ConfigSettings configSettings = ConfigSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * ConfigClient configClient = ConfigClient.create(configSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class ConfigClient implements BackgroundResource { + private final ConfigSettings settings; + private final ConfigServiceV2Stub stub; + private final OperationsClient operationsClient; + + /** Constructs an instance of ConfigClient with default settings. */ + public static final ConfigClient create() throws IOException { + return create(ConfigSettings.newBuilder().build()); + } + + /** + * Constructs an instance of ConfigClient, 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 ConfigClient create(ConfigSettings settings) throws IOException { + return new ConfigClient(settings); + } + + /** + * Constructs an instance of ConfigClient, using the given stub for making calls. This is for + * advanced usage - prefer using create(ConfigSettings). + */ + public static final ConfigClient create(ConfigServiceV2Stub stub) { + return new ConfigClient(stub); + } + + /** + * Constructs an instance of ConfigClient, 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 ConfigClient(ConfigSettings settings) throws IOException { + this.settings = settings; + this.stub = ((ConfigServiceV2StubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + protected ConfigClient(ConfigServiceV2Stub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + public final ConfigSettings getSettings() { + return settings; + } + + public ConfigServiceV2Stub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + public final OperationsClient getOperationsClient() { + return operationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists log buckets. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   BillingAccountLocationName parent =
+   *       BillingAccountLocationName.of("[BILLING_ACCOUNT]", "[LOCATION]");
+   *   for (LogBucket element : configClient.listBuckets(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent resource whose buckets are to be listed: + *

"projects/[PROJECT_ID]/locations/[LOCATION_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]" + *

Note: The locations portion of the resource must be specified, but supplying the + * character `-` in place of [LOCATION_ID] will return all buckets. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListBucketsPagedResponse listBuckets(BillingAccountLocationName parent) { + ListBucketsRequest request = + ListBucketsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listBuckets(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists log buckets. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   FolderLocationName parent = FolderLocationName.of("[FOLDER]", "[LOCATION]");
+   *   for (LogBucket element : configClient.listBuckets(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent resource whose buckets are to be listed: + *

"projects/[PROJECT_ID]/locations/[LOCATION_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]" + *

Note: The locations portion of the resource must be specified, but supplying the + * character `-` in place of [LOCATION_ID] will return all buckets. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListBucketsPagedResponse listBuckets(FolderLocationName parent) { + ListBucketsRequest request = + ListBucketsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listBuckets(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists log buckets. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (LogBucket element : configClient.listBuckets(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent resource whose buckets are to be listed: + *

"projects/[PROJECT_ID]/locations/[LOCATION_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]" + *

Note: The locations portion of the resource must be specified, but supplying the + * character `-` in place of [LOCATION_ID] will return all buckets. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListBucketsPagedResponse listBuckets(LocationName parent) { + ListBucketsRequest request = + ListBucketsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listBuckets(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists log buckets. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]");
+   *   for (LogBucket element : configClient.listBuckets(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent resource whose buckets are to be listed: + *

"projects/[PROJECT_ID]/locations/[LOCATION_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]" + *

Note: The locations portion of the resource must be specified, but supplying the + * character `-` in place of [LOCATION_ID] will return all buckets. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListBucketsPagedResponse listBuckets(OrganizationLocationName parent) { + ListBucketsRequest request = + ListBucketsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listBuckets(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists log buckets. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   for (LogBucket element : configClient.listBuckets(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent resource whose buckets are to be listed: + *

"projects/[PROJECT_ID]/locations/[LOCATION_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]" + *

Note: The locations portion of the resource must be specified, but supplying the + * character `-` in place of [LOCATION_ID] will return all buckets. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListBucketsPagedResponse listBuckets(String parent) { + ListBucketsRequest request = ListBucketsRequest.newBuilder().setParent(parent).build(); + return listBuckets(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists log buckets. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   ListBucketsRequest request =
+   *       ListBucketsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageToken("pageToken873572522")
+   *           .setPageSize(883849137)
+   *           .build();
+   *   for (LogBucket element : configClient.listBuckets(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListBucketsPagedResponse listBuckets(ListBucketsRequest request) { + return listBucketsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists log buckets. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   ListBucketsRequest request =
+   *       ListBucketsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageToken("pageToken873572522")
+   *           .setPageSize(883849137)
+   *           .build();
+   *   ApiFuture future = configClient.listBucketsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (LogBucket element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listBucketsPagedCallable() { + return stub.listBucketsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists log buckets. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   ListBucketsRequest request =
+   *       ListBucketsRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageToken("pageToken873572522")
+   *           .setPageSize(883849137)
+   *           .build();
+   *   while (true) {
+   *     ListBucketsResponse response = configClient.listBucketsCallable().call(request);
+   *     for (LogBucket element : response.getBucketsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listBucketsCallable() { + return stub.listBucketsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a log bucket. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   GetBucketRequest request =
+   *       GetBucketRequest.newBuilder()
+   *           .setName(
+   *               LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]")
+   *                   .toString())
+   *           .build();
+   *   LogBucket response = configClient.getBucket(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 LogBucket getBucket(GetBucketRequest request) { + return getBucketCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a log bucket. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   GetBucketRequest request =
+   *       GetBucketRequest.newBuilder()
+   *           .setName(
+   *               LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future = configClient.getBucketCallable().futureCall(request);
+   *   // Do something.
+   *   LogBucket response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getBucketCallable() { + return stub.getBucketCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a log bucket asynchronously that can be used to store log entries. + * + *

After a bucket has been created, the bucket's location cannot be changed. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   CreateBucketRequest request =
+   *       CreateBucketRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setBucketId("bucketId-1603305307")
+   *           .setBucket(LogBucket.newBuilder().build())
+   *           .build();
+   *   LogBucket response = configClient.createBucketAsyncAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createBucketAsyncAsync( + CreateBucketRequest request) { + return createBucketAsyncOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a log bucket asynchronously that can be used to store log entries. + * + *

After a bucket has been created, the bucket's location cannot be changed. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   CreateBucketRequest request =
+   *       CreateBucketRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setBucketId("bucketId-1603305307")
+   *           .setBucket(LogBucket.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       configClient.createBucketAsyncOperationCallable().futureCall(request);
+   *   // Do something.
+   *   LogBucket response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + createBucketAsyncOperationCallable() { + return stub.createBucketAsyncOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a log bucket asynchronously that can be used to store log entries. + * + *

After a bucket has been created, the bucket's location cannot be changed. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   CreateBucketRequest request =
+   *       CreateBucketRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setBucketId("bucketId-1603305307")
+   *           .setBucket(LogBucket.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = configClient.createBucketAsyncCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createBucketAsyncCallable() { + return stub.createBucketAsyncCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a log bucket asynchronously. + * + *

If the bucket has a `lifecycle_state` of `DELETE_REQUESTED`, then `FAILED_PRECONDITION` will + * be returned. + * + *

After a bucket has been created, the bucket's location cannot be changed. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   UpdateBucketRequest request =
+   *       UpdateBucketRequest.newBuilder()
+   *           .setName(
+   *               LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]")
+   *                   .toString())
+   *           .setBucket(LogBucket.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   LogBucket response = configClient.updateBucketAsyncAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateBucketAsyncAsync( + UpdateBucketRequest request) { + return updateBucketAsyncOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a log bucket asynchronously. + * + *

If the bucket has a `lifecycle_state` of `DELETE_REQUESTED`, then `FAILED_PRECONDITION` will + * be returned. + * + *

After a bucket has been created, the bucket's location cannot be changed. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   UpdateBucketRequest request =
+   *       UpdateBucketRequest.newBuilder()
+   *           .setName(
+   *               LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]")
+   *                   .toString())
+   *           .setBucket(LogBucket.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       configClient.updateBucketAsyncOperationCallable().futureCall(request);
+   *   // Do something.
+   *   LogBucket response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + updateBucketAsyncOperationCallable() { + return stub.updateBucketAsyncOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a log bucket asynchronously. + * + *

If the bucket has a `lifecycle_state` of `DELETE_REQUESTED`, then `FAILED_PRECONDITION` will + * be returned. + * + *

After a bucket has been created, the bucket's location cannot be changed. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   UpdateBucketRequest request =
+   *       UpdateBucketRequest.newBuilder()
+   *           .setName(
+   *               LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]")
+   *                   .toString())
+   *           .setBucket(LogBucket.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = configClient.updateBucketAsyncCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateBucketAsyncCallable() { + return stub.updateBucketAsyncCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a log bucket that can be used to store log entries. After a bucket has been created, + * the bucket's location cannot be changed. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   CreateBucketRequest request =
+   *       CreateBucketRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setBucketId("bucketId-1603305307")
+   *           .setBucket(LogBucket.newBuilder().build())
+   *           .build();
+   *   LogBucket response = configClient.createBucket(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 LogBucket createBucket(CreateBucketRequest request) { + return createBucketCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a log bucket that can be used to store log entries. After a bucket has been created, + * the bucket's location cannot be changed. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   CreateBucketRequest request =
+   *       CreateBucketRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setBucketId("bucketId-1603305307")
+   *           .setBucket(LogBucket.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = configClient.createBucketCallable().futureCall(request);
+   *   // Do something.
+   *   LogBucket response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createBucketCallable() { + return stub.createBucketCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a log bucket. + * + *

If the bucket has a `lifecycle_state` of `DELETE_REQUESTED`, then `FAILED_PRECONDITION` will + * be returned. + * + *

After a bucket has been created, the bucket's location cannot be changed. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   UpdateBucketRequest request =
+   *       UpdateBucketRequest.newBuilder()
+   *           .setName(
+   *               LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]")
+   *                   .toString())
+   *           .setBucket(LogBucket.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   LogBucket response = configClient.updateBucket(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 LogBucket updateBucket(UpdateBucketRequest request) { + return updateBucketCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a log bucket. + * + *

If the bucket has a `lifecycle_state` of `DELETE_REQUESTED`, then `FAILED_PRECONDITION` will + * be returned. + * + *

After a bucket has been created, the bucket's location cannot be changed. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   UpdateBucketRequest request =
+   *       UpdateBucketRequest.newBuilder()
+   *           .setName(
+   *               LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]")
+   *                   .toString())
+   *           .setBucket(LogBucket.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = configClient.updateBucketCallable().futureCall(request);
+   *   // Do something.
+   *   LogBucket response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateBucketCallable() { + return stub.updateBucketCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a log bucket. + * + *

Changes the bucket's `lifecycle_state` to the `DELETE_REQUESTED` state. After 7 days, the + * bucket will be purged and all log entries in the bucket will be permanently deleted. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   DeleteBucketRequest request =
+   *       DeleteBucketRequest.newBuilder()
+   *           .setName(
+   *               LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]")
+   *                   .toString())
+   *           .build();
+   *   configClient.deleteBucket(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteBucket(DeleteBucketRequest request) { + deleteBucketCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a log bucket. + * + *

Changes the bucket's `lifecycle_state` to the `DELETE_REQUESTED` state. After 7 days, the + * bucket will be purged and all log entries in the bucket will be permanently deleted. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   DeleteBucketRequest request =
+   *       DeleteBucketRequest.newBuilder()
+   *           .setName(
+   *               LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future = configClient.deleteBucketCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteBucketCallable() { + return stub.deleteBucketCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Undeletes a log bucket. A bucket that has been deleted can be undeleted within the grace period + * of 7 days. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   UndeleteBucketRequest request =
+   *       UndeleteBucketRequest.newBuilder()
+   *           .setName(
+   *               LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]")
+   *                   .toString())
+   *           .build();
+   *   configClient.undeleteBucket(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void undeleteBucket(UndeleteBucketRequest request) { + undeleteBucketCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Undeletes a log bucket. A bucket that has been deleted can be undeleted within the grace period + * of 7 days. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   UndeleteBucketRequest request =
+   *       UndeleteBucketRequest.newBuilder()
+   *           .setName(
+   *               LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future = configClient.undeleteBucketCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable undeleteBucketCallable() { + return stub.undeleteBucketCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists views on a log bucket. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   String parent = "parent-995424086";
+   *   for (LogView element : configClient.listViews(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The bucket whose views are to be listed: + *

"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListViewsPagedResponse listViews(String parent) { + ListViewsRequest request = ListViewsRequest.newBuilder().setParent(parent).build(); + return listViews(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists views on a log bucket. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   ListViewsRequest request =
+   *       ListViewsRequest.newBuilder()
+   *           .setParent("parent-995424086")
+   *           .setPageToken("pageToken873572522")
+   *           .setPageSize(883849137)
+   *           .build();
+   *   for (LogView element : configClient.listViews(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListViewsPagedResponse listViews(ListViewsRequest request) { + return listViewsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists views on a log bucket. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   ListViewsRequest request =
+   *       ListViewsRequest.newBuilder()
+   *           .setParent("parent-995424086")
+   *           .setPageToken("pageToken873572522")
+   *           .setPageSize(883849137)
+   *           .build();
+   *   ApiFuture future = configClient.listViewsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (LogView element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listViewsPagedCallable() { + return stub.listViewsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists views on a log bucket. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   ListViewsRequest request =
+   *       ListViewsRequest.newBuilder()
+   *           .setParent("parent-995424086")
+   *           .setPageToken("pageToken873572522")
+   *           .setPageSize(883849137)
+   *           .build();
+   *   while (true) {
+   *     ListViewsResponse response = configClient.listViewsCallable().call(request);
+   *     for (LogView element : response.getViewsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listViewsCallable() { + return stub.listViewsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a view on a log bucket.. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   GetViewRequest request =
+   *       GetViewRequest.newBuilder()
+   *           .setName(
+   *               LogViewName.ofProjectLocationBucketViewName(
+   *                       "[PROJECT]", "[LOCATION]", "[BUCKET]", "[VIEW]")
+   *                   .toString())
+   *           .build();
+   *   LogView response = configClient.getView(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 LogView getView(GetViewRequest request) { + return getViewCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a view on a log bucket.. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   GetViewRequest request =
+   *       GetViewRequest.newBuilder()
+   *           .setName(
+   *               LogViewName.ofProjectLocationBucketViewName(
+   *                       "[PROJECT]", "[LOCATION]", "[BUCKET]", "[VIEW]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future = configClient.getViewCallable().futureCall(request);
+   *   // Do something.
+   *   LogView response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getViewCallable() { + return stub.getViewCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a view over log entries in a log bucket. A bucket may contain a maximum of 30 views. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   CreateViewRequest request =
+   *       CreateViewRequest.newBuilder()
+   *           .setParent("parent-995424086")
+   *           .setViewId("viewId-816632160")
+   *           .setView(LogView.newBuilder().build())
+   *           .build();
+   *   LogView response = configClient.createView(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 LogView createView(CreateViewRequest request) { + return createViewCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a view over log entries in a log bucket. A bucket may contain a maximum of 30 views. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   CreateViewRequest request =
+   *       CreateViewRequest.newBuilder()
+   *           .setParent("parent-995424086")
+   *           .setViewId("viewId-816632160")
+   *           .setView(LogView.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = configClient.createViewCallable().futureCall(request);
+   *   // Do something.
+   *   LogView response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createViewCallable() { + return stub.createViewCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a view on a log bucket. This method replaces the following fields in the existing view + * with values from the new view: `filter`. If an `UNAVAILABLE` error is returned, this indicates + * that system is not in a state where it can update the view. If this occurs, please try again in + * a few minutes. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   UpdateViewRequest request =
+   *       UpdateViewRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setView(LogView.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   LogView response = configClient.updateView(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 LogView updateView(UpdateViewRequest request) { + return updateViewCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a view on a log bucket. This method replaces the following fields in the existing view + * with values from the new view: `filter`. If an `UNAVAILABLE` error is returned, this indicates + * that system is not in a state where it can update the view. If this occurs, please try again in + * a few minutes. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   UpdateViewRequest request =
+   *       UpdateViewRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setView(LogView.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = configClient.updateViewCallable().futureCall(request);
+   *   // Do something.
+   *   LogView response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateViewCallable() { + return stub.updateViewCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a view on a log bucket. If an `UNAVAILABLE` error is returned, this indicates that + * system is not in a state where it can delete the view. If this occurs, please try again in a + * few minutes. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   DeleteViewRequest request =
+   *       DeleteViewRequest.newBuilder()
+   *           .setName(
+   *               LogViewName.ofProjectLocationBucketViewName(
+   *                       "[PROJECT]", "[LOCATION]", "[BUCKET]", "[VIEW]")
+   *                   .toString())
+   *           .build();
+   *   configClient.deleteView(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteView(DeleteViewRequest request) { + deleteViewCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a view on a log bucket. If an `UNAVAILABLE` error is returned, this indicates that + * system is not in a state where it can delete the view. If this occurs, please try again in a + * few minutes. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   DeleteViewRequest request =
+   *       DeleteViewRequest.newBuilder()
+   *           .setName(
+   *               LogViewName.ofProjectLocationBucketViewName(
+   *                       "[PROJECT]", "[LOCATION]", "[BUCKET]", "[VIEW]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future = configClient.deleteViewCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteViewCallable() { + return stub.deleteViewCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists sinks. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]");
+   *   for (LogSink element : configClient.listSinks(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent resource whose sinks are to be listed: + *

"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListSinksPagedResponse listSinks(BillingAccountName parent) { + ListSinksRequest request = + ListSinksRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + return listSinks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists sinks. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   FolderName parent = FolderName.of("[FOLDER]");
+   *   for (LogSink element : configClient.listSinks(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent resource whose sinks are to be listed: + *

"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListSinksPagedResponse listSinks(FolderName parent) { + ListSinksRequest request = + ListSinksRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + return listSinks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists sinks. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+   *   for (LogSink element : configClient.listSinks(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent resource whose sinks are to be listed: + *

"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListSinksPagedResponse listSinks(OrganizationName parent) { + ListSinksRequest request = + ListSinksRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + return listSinks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists sinks. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   for (LogSink element : configClient.listSinks(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent resource whose sinks are to be listed: + *

"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListSinksPagedResponse listSinks(ProjectName parent) { + ListSinksRequest request = + ListSinksRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + return listSinks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists sinks. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   String parent = ProjectName.of("[PROJECT]").toString();
+   *   for (LogSink element : configClient.listSinks(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent resource whose sinks are to be listed: + *

"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListSinksPagedResponse listSinks(String parent) { + ListSinksRequest request = ListSinksRequest.newBuilder().setParent(parent).build(); + return listSinks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists sinks. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   ListSinksRequest request =
+   *       ListSinksRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .setPageToken("pageToken873572522")
+   *           .setPageSize(883849137)
+   *           .build();
+   *   for (LogSink element : configClient.listSinks(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListSinksPagedResponse listSinks(ListSinksRequest request) { + return listSinksPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists sinks. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   ListSinksRequest request =
+   *       ListSinksRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .setPageToken("pageToken873572522")
+   *           .setPageSize(883849137)
+   *           .build();
+   *   ApiFuture future = configClient.listSinksPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (LogSink element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listSinksPagedCallable() { + return stub.listSinksPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists sinks. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   ListSinksRequest request =
+   *       ListSinksRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .setPageToken("pageToken873572522")
+   *           .setPageSize(883849137)
+   *           .build();
+   *   while (true) {
+   *     ListSinksResponse response = configClient.listSinksCallable().call(request);
+   *     for (LogSink element : response.getSinksList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listSinksCallable() { + return stub.listSinksCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a sink. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]");
+   *   LogSink response = configClient.getSink(sinkName);
+   * }
+   * }
+ * + * @param sinkName Required. The resource name of the sink: + *

"projects/[PROJECT_ID]/sinks/[SINK_ID]" + * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + * "folders/[FOLDER_ID]/sinks/[SINK_ID]" + *

For example: + *

`"projects/my-project/sinks/my-sink"` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogSink getSink(LogSinkName sinkName) { + GetSinkRequest request = + GetSinkRequest.newBuilder() + .setSinkName(sinkName == null ? null : sinkName.toString()) + .build(); + return getSink(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a sink. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   String sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString();
+   *   LogSink response = configClient.getSink(sinkName);
+   * }
+   * }
+ * + * @param sinkName Required. The resource name of the sink: + *

"projects/[PROJECT_ID]/sinks/[SINK_ID]" + * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + * "folders/[FOLDER_ID]/sinks/[SINK_ID]" + *

For example: + *

`"projects/my-project/sinks/my-sink"` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogSink getSink(String sinkName) { + GetSinkRequest request = GetSinkRequest.newBuilder().setSinkName(sinkName).build(); + return getSink(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a sink. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   GetSinkRequest request =
+   *       GetSinkRequest.newBuilder()
+   *           .setSinkName(LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString())
+   *           .build();
+   *   LogSink response = configClient.getSink(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 LogSink getSink(GetSinkRequest request) { + return getSinkCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a sink. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   GetSinkRequest request =
+   *       GetSinkRequest.newBuilder()
+   *           .setSinkName(LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString())
+   *           .build();
+   *   ApiFuture future = configClient.getSinkCallable().futureCall(request);
+   *   // Do something.
+   *   LogSink response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getSinkCallable() { + return stub.getSinkCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a sink that exports specified log entries to a destination. The export of + * newly-ingested log entries begins immediately, unless the sink's `writer_identity` is not + * permitted to write to the destination. A sink can export log entries only from the resource + * owning the sink. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]");
+   *   LogSink sink = LogSink.newBuilder().build();
+   *   LogSink response = configClient.createSink(parent, sink);
+   * }
+   * }
+ * + * @param parent Required. The resource in which to create the sink: + *

"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + *

For examples: + *

`"projects/my-project"` `"organizations/123456789"` + * @param sink Required. The new sink, whose `name` parameter is a sink identifier that is not + * already in use. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogSink createSink(BillingAccountName parent, LogSink sink) { + CreateSinkRequest request = + CreateSinkRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setSink(sink) + .build(); + return createSink(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a sink that exports specified log entries to a destination. The export of + * newly-ingested log entries begins immediately, unless the sink's `writer_identity` is not + * permitted to write to the destination. A sink can export log entries only from the resource + * owning the sink. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   FolderName parent = FolderName.of("[FOLDER]");
+   *   LogSink sink = LogSink.newBuilder().build();
+   *   LogSink response = configClient.createSink(parent, sink);
+   * }
+   * }
+ * + * @param parent Required. The resource in which to create the sink: + *

"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + *

For examples: + *

`"projects/my-project"` `"organizations/123456789"` + * @param sink Required. The new sink, whose `name` parameter is a sink identifier that is not + * already in use. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogSink createSink(FolderName parent, LogSink sink) { + CreateSinkRequest request = + CreateSinkRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setSink(sink) + .build(); + return createSink(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a sink that exports specified log entries to a destination. The export of + * newly-ingested log entries begins immediately, unless the sink's `writer_identity` is not + * permitted to write to the destination. A sink can export log entries only from the resource + * owning the sink. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+   *   LogSink sink = LogSink.newBuilder().build();
+   *   LogSink response = configClient.createSink(parent, sink);
+   * }
+   * }
+ * + * @param parent Required. The resource in which to create the sink: + *

"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + *

For examples: + *

`"projects/my-project"` `"organizations/123456789"` + * @param sink Required. The new sink, whose `name` parameter is a sink identifier that is not + * already in use. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogSink createSink(OrganizationName parent, LogSink sink) { + CreateSinkRequest request = + CreateSinkRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setSink(sink) + .build(); + return createSink(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a sink that exports specified log entries to a destination. The export of + * newly-ingested log entries begins immediately, unless the sink's `writer_identity` is not + * permitted to write to the destination. A sink can export log entries only from the resource + * owning the sink. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   LogSink sink = LogSink.newBuilder().build();
+   *   LogSink response = configClient.createSink(parent, sink);
+   * }
+   * }
+ * + * @param parent Required. The resource in which to create the sink: + *

"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + *

For examples: + *

`"projects/my-project"` `"organizations/123456789"` + * @param sink Required. The new sink, whose `name` parameter is a sink identifier that is not + * already in use. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogSink createSink(ProjectName parent, LogSink sink) { + CreateSinkRequest request = + CreateSinkRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setSink(sink) + .build(); + return createSink(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a sink that exports specified log entries to a destination. The export of + * newly-ingested log entries begins immediately, unless the sink's `writer_identity` is not + * permitted to write to the destination. A sink can export log entries only from the resource + * owning the sink. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   String parent = ProjectName.of("[PROJECT]").toString();
+   *   LogSink sink = LogSink.newBuilder().build();
+   *   LogSink response = configClient.createSink(parent, sink);
+   * }
+   * }
+ * + * @param parent Required. The resource in which to create the sink: + *

"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + *

For examples: + *

`"projects/my-project"` `"organizations/123456789"` + * @param sink Required. The new sink, whose `name` parameter is a sink identifier that is not + * already in use. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogSink createSink(String parent, LogSink sink) { + CreateSinkRequest request = + CreateSinkRequest.newBuilder().setParent(parent).setSink(sink).build(); + return createSink(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a sink that exports specified log entries to a destination. The export of + * newly-ingested log entries begins immediately, unless the sink's `writer_identity` is not + * permitted to write to the destination. A sink can export log entries only from the resource + * owning the sink. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   CreateSinkRequest request =
+   *       CreateSinkRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .setSink(LogSink.newBuilder().build())
+   *           .setUniqueWriterIdentity(true)
+   *           .build();
+   *   LogSink response = configClient.createSink(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 LogSink createSink(CreateSinkRequest request) { + return createSinkCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a sink that exports specified log entries to a destination. The export of + * newly-ingested log entries begins immediately, unless the sink's `writer_identity` is not + * permitted to write to the destination. A sink can export log entries only from the resource + * owning the sink. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   CreateSinkRequest request =
+   *       CreateSinkRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .setSink(LogSink.newBuilder().build())
+   *           .setUniqueWriterIdentity(true)
+   *           .build();
+   *   ApiFuture future = configClient.createSinkCallable().futureCall(request);
+   *   // Do something.
+   *   LogSink response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createSinkCallable() { + return stub.createSinkCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a sink. This method replaces the following fields in the existing sink with values from + * the new sink: `destination`, and `filter`. + * + *

The updated sink might also have a new `writer_identity`; see the `unique_writer_identity` + * field. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]");
+   *   LogSink sink = LogSink.newBuilder().build();
+   *   LogSink response = configClient.updateSink(sinkName, sink);
+   * }
+   * }
+ * + * @param sinkName Required. The full resource name of the sink to update, including the parent + * resource and the sink identifier: + *

"projects/[PROJECT_ID]/sinks/[SINK_ID]" + * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + * "folders/[FOLDER_ID]/sinks/[SINK_ID]" + *

For example: + *

`"projects/my-project/sinks/my-sink"` + * @param sink Required. The updated sink, whose name is the same identifier that appears as part + * of `sink_name`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogSink updateSink(LogSinkName sinkName, LogSink sink) { + UpdateSinkRequest request = + UpdateSinkRequest.newBuilder() + .setSinkName(sinkName == null ? null : sinkName.toString()) + .setSink(sink) + .build(); + return updateSink(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a sink. This method replaces the following fields in the existing sink with values from + * the new sink: `destination`, and `filter`. + * + *

The updated sink might also have a new `writer_identity`; see the `unique_writer_identity` + * field. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   String sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString();
+   *   LogSink sink = LogSink.newBuilder().build();
+   *   LogSink response = configClient.updateSink(sinkName, sink);
+   * }
+   * }
+ * + * @param sinkName Required. The full resource name of the sink to update, including the parent + * resource and the sink identifier: + *

"projects/[PROJECT_ID]/sinks/[SINK_ID]" + * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + * "folders/[FOLDER_ID]/sinks/[SINK_ID]" + *

For example: + *

`"projects/my-project/sinks/my-sink"` + * @param sink Required. The updated sink, whose name is the same identifier that appears as part + * of `sink_name`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogSink updateSink(String sinkName, LogSink sink) { + UpdateSinkRequest request = + UpdateSinkRequest.newBuilder().setSinkName(sinkName).setSink(sink).build(); + return updateSink(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a sink. This method replaces the following fields in the existing sink with values from + * the new sink: `destination`, and `filter`. + * + *

The updated sink might also have a new `writer_identity`; see the `unique_writer_identity` + * field. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]");
+   *   LogSink sink = LogSink.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   LogSink response = configClient.updateSink(sinkName, sink, updateMask);
+   * }
+   * }
+ * + * @param sinkName Required. The full resource name of the sink to update, including the parent + * resource and the sink identifier: + *

"projects/[PROJECT_ID]/sinks/[SINK_ID]" + * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + * "folders/[FOLDER_ID]/sinks/[SINK_ID]" + *

For example: + *

`"projects/my-project/sinks/my-sink"` + * @param sink Required. The updated sink, whose name is the same identifier that appears as part + * of `sink_name`. + * @param updateMask Optional. Field mask that specifies the fields in `sink` that need an update. + * A sink field will be overwritten if, and only if, it is in the update mask. `name` and + * output only fields cannot be updated. + *

An empty `updateMask` is temporarily treated as using the following mask for backwards + * compatibility purposes: + *

`destination,filter,includeChildren` + *

At some point in the future, behavior will be removed and specifying an empty + * `updateMask` will be an error. + *

For a detailed `FieldMask` definition, see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask + *

For example: `updateMask=filter` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogSink updateSink(LogSinkName sinkName, LogSink sink, FieldMask updateMask) { + UpdateSinkRequest request = + UpdateSinkRequest.newBuilder() + .setSinkName(sinkName == null ? null : sinkName.toString()) + .setSink(sink) + .setUpdateMask(updateMask) + .build(); + return updateSink(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a sink. This method replaces the following fields in the existing sink with values from + * the new sink: `destination`, and `filter`. + * + *

The updated sink might also have a new `writer_identity`; see the `unique_writer_identity` + * field. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   String sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString();
+   *   LogSink sink = LogSink.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   LogSink response = configClient.updateSink(sinkName, sink, updateMask);
+   * }
+   * }
+ * + * @param sinkName Required. The full resource name of the sink to update, including the parent + * resource and the sink identifier: + *

"projects/[PROJECT_ID]/sinks/[SINK_ID]" + * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + * "folders/[FOLDER_ID]/sinks/[SINK_ID]" + *

For example: + *

`"projects/my-project/sinks/my-sink"` + * @param sink Required. The updated sink, whose name is the same identifier that appears as part + * of `sink_name`. + * @param updateMask Optional. Field mask that specifies the fields in `sink` that need an update. + * A sink field will be overwritten if, and only if, it is in the update mask. `name` and + * output only fields cannot be updated. + *

An empty `updateMask` is temporarily treated as using the following mask for backwards + * compatibility purposes: + *

`destination,filter,includeChildren` + *

At some point in the future, behavior will be removed and specifying an empty + * `updateMask` will be an error. + *

For a detailed `FieldMask` definition, see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask + *

For example: `updateMask=filter` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogSink updateSink(String sinkName, LogSink sink, FieldMask updateMask) { + UpdateSinkRequest request = + UpdateSinkRequest.newBuilder() + .setSinkName(sinkName) + .setSink(sink) + .setUpdateMask(updateMask) + .build(); + return updateSink(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a sink. This method replaces the following fields in the existing sink with values from + * the new sink: `destination`, and `filter`. + * + *

The updated sink might also have a new `writer_identity`; see the `unique_writer_identity` + * field. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   UpdateSinkRequest request =
+   *       UpdateSinkRequest.newBuilder()
+   *           .setSinkName(LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString())
+   *           .setSink(LogSink.newBuilder().build())
+   *           .setUniqueWriterIdentity(true)
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   LogSink response = configClient.updateSink(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 LogSink updateSink(UpdateSinkRequest request) { + return updateSinkCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates a sink. This method replaces the following fields in the existing sink with values from + * the new sink: `destination`, and `filter`. + * + *

The updated sink might also have a new `writer_identity`; see the `unique_writer_identity` + * field. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   UpdateSinkRequest request =
+   *       UpdateSinkRequest.newBuilder()
+   *           .setSinkName(LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString())
+   *           .setSink(LogSink.newBuilder().build())
+   *           .setUniqueWriterIdentity(true)
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = configClient.updateSinkCallable().futureCall(request);
+   *   // Do something.
+   *   LogSink response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateSinkCallable() { + return stub.updateSinkCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a sink. If the sink has a unique `writer_identity`, then that service account is also + * deleted. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]");
+   *   configClient.deleteSink(sinkName);
+   * }
+   * }
+ * + * @param sinkName Required. The full resource name of the sink to delete, including the parent + * resource and the sink identifier: + *

"projects/[PROJECT_ID]/sinks/[SINK_ID]" + * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + * "folders/[FOLDER_ID]/sinks/[SINK_ID]" + *

For example: + *

`"projects/my-project/sinks/my-sink"` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteSink(LogSinkName sinkName) { + DeleteSinkRequest request = + DeleteSinkRequest.newBuilder() + .setSinkName(sinkName == null ? null : sinkName.toString()) + .build(); + deleteSink(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a sink. If the sink has a unique `writer_identity`, then that service account is also + * deleted. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   String sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString();
+   *   configClient.deleteSink(sinkName);
+   * }
+   * }
+ * + * @param sinkName Required. The full resource name of the sink to delete, including the parent + * resource and the sink identifier: + *

"projects/[PROJECT_ID]/sinks/[SINK_ID]" + * "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + * "folders/[FOLDER_ID]/sinks/[SINK_ID]" + *

For example: + *

`"projects/my-project/sinks/my-sink"` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteSink(String sinkName) { + DeleteSinkRequest request = DeleteSinkRequest.newBuilder().setSinkName(sinkName).build(); + deleteSink(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a sink. If the sink has a unique `writer_identity`, then that service account is also + * deleted. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   DeleteSinkRequest request =
+   *       DeleteSinkRequest.newBuilder()
+   *           .setSinkName(LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString())
+   *           .build();
+   *   configClient.deleteSink(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteSink(DeleteSinkRequest request) { + deleteSinkCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a sink. If the sink has a unique `writer_identity`, then that service account is also + * deleted. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   DeleteSinkRequest request =
+   *       DeleteSinkRequest.newBuilder()
+   *           .setSinkName(LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString())
+   *           .build();
+   *   ApiFuture future = configClient.deleteSinkCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteSinkCallable() { + return stub.deleteSinkCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Asynchronously creates a linked dataset in BigQuery which makes it possible to use BigQuery to + * read the logs stored in the log bucket. A log bucket may currently only contain one link. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   LogBucketName parent =
+   *       LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]");
+   *   Link link = Link.newBuilder().build();
+   *   String linkId = "linkId-1102667083";
+   *   Link response = configClient.createLinkAsync(parent, link, linkId).get();
+   * }
+   * }
+ * + * @param parent Required. The full resource name of the bucket to create a link for. + *

"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * @param link Required. The new link. + * @param linkId Required. The ID to use for the link. The link_id can have up to 100 characters. + * A valid link_id must only have alphanumeric characters and underscores within it. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createLinkAsync( + LogBucketName parent, Link link, String linkId) { + CreateLinkRequest request = + CreateLinkRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setLink(link) + .setLinkId(linkId) + .build(); + return createLinkAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Asynchronously creates a linked dataset in BigQuery which makes it possible to use BigQuery to + * read the logs stored in the log bucket. A log bucket may currently only contain one link. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   String parent =
+   *       LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]")
+   *           .toString();
+   *   Link link = Link.newBuilder().build();
+   *   String linkId = "linkId-1102667083";
+   *   Link response = configClient.createLinkAsync(parent, link, linkId).get();
+   * }
+   * }
+ * + * @param parent Required. The full resource name of the bucket to create a link for. + *

"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + * @param link Required. The new link. + * @param linkId Required. The ID to use for the link. The link_id can have up to 100 characters. + * A valid link_id must only have alphanumeric characters and underscores within it. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createLinkAsync( + String parent, Link link, String linkId) { + CreateLinkRequest request = + CreateLinkRequest.newBuilder().setParent(parent).setLink(link).setLinkId(linkId).build(); + return createLinkAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Asynchronously creates a linked dataset in BigQuery which makes it possible to use BigQuery to + * read the logs stored in the log bucket. A log bucket may currently only contain one link. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   CreateLinkRequest request =
+   *       CreateLinkRequest.newBuilder()
+   *           .setParent(
+   *               LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]")
+   *                   .toString())
+   *           .setLink(Link.newBuilder().build())
+   *           .setLinkId("linkId-1102667083")
+   *           .build();
+   *   Link response = configClient.createLinkAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createLinkAsync(CreateLinkRequest request) { + return createLinkOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Asynchronously creates a linked dataset in BigQuery which makes it possible to use BigQuery to + * read the logs stored in the log bucket. A log bucket may currently only contain one link. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   CreateLinkRequest request =
+   *       CreateLinkRequest.newBuilder()
+   *           .setParent(
+   *               LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]")
+   *                   .toString())
+   *           .setLink(Link.newBuilder().build())
+   *           .setLinkId("linkId-1102667083")
+   *           .build();
+   *   OperationFuture future =
+   *       configClient.createLinkOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Link response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + createLinkOperationCallable() { + return stub.createLinkOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Asynchronously creates a linked dataset in BigQuery which makes it possible to use BigQuery to + * read the logs stored in the log bucket. A log bucket may currently only contain one link. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   CreateLinkRequest request =
+   *       CreateLinkRequest.newBuilder()
+   *           .setParent(
+   *               LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]")
+   *                   .toString())
+   *           .setLink(Link.newBuilder().build())
+   *           .setLinkId("linkId-1102667083")
+   *           .build();
+   *   ApiFuture future = configClient.createLinkCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createLinkCallable() { + return stub.createLinkCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a link. This will also delete the corresponding BigQuery linked dataset. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   LinkName name =
+   *       LinkName.ofProjectLocationBucketLinkName("[PROJECT]", "[LOCATION]", "[BUCKET]", "[LINK]");
+   *   configClient.deleteLinkAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The full resource name of the link to delete. + *

"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteLinkAsync(LinkName name) { + DeleteLinkRequest request = + DeleteLinkRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return deleteLinkAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a link. This will also delete the corresponding BigQuery linked dataset. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   String name =
+   *       LinkName.ofProjectLocationBucketLinkName("[PROJECT]", "[LOCATION]", "[BUCKET]", "[LINK]")
+   *           .toString();
+   *   configClient.deleteLinkAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The full resource name of the link to delete. + *

"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteLinkAsync(String name) { + DeleteLinkRequest request = DeleteLinkRequest.newBuilder().setName(name).build(); + return deleteLinkAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a link. This will also delete the corresponding BigQuery linked dataset. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   DeleteLinkRequest request =
+   *       DeleteLinkRequest.newBuilder()
+   *           .setName(
+   *               LinkName.ofProjectLocationBucketLinkName(
+   *                       "[PROJECT]", "[LOCATION]", "[BUCKET]", "[LINK]")
+   *                   .toString())
+   *           .build();
+   *   configClient.deleteLinkAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteLinkAsync(DeleteLinkRequest request) { + return deleteLinkOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a link. This will also delete the corresponding BigQuery linked dataset. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   DeleteLinkRequest request =
+   *       DeleteLinkRequest.newBuilder()
+   *           .setName(
+   *               LinkName.ofProjectLocationBucketLinkName(
+   *                       "[PROJECT]", "[LOCATION]", "[BUCKET]", "[LINK]")
+   *                   .toString())
+   *           .build();
+   *   OperationFuture future =
+   *       configClient.deleteLinkOperationCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final OperationCallable + deleteLinkOperationCallable() { + return stub.deleteLinkOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a link. This will also delete the corresponding BigQuery linked dataset. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   DeleteLinkRequest request =
+   *       DeleteLinkRequest.newBuilder()
+   *           .setName(
+   *               LinkName.ofProjectLocationBucketLinkName(
+   *                       "[PROJECT]", "[LOCATION]", "[BUCKET]", "[LINK]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future = configClient.deleteLinkCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteLinkCallable() { + return stub.deleteLinkCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists links. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   LogBucketName parent =
+   *       LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]");
+   *   for (Link element : configClient.listLinks(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent resource whose links are to be listed: + *

"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/ + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListLinksPagedResponse listLinks(LogBucketName parent) { + ListLinksRequest request = + ListLinksRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + return listLinks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists links. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   String parent =
+   *       LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]")
+   *           .toString();
+   *   for (Link element : configClient.listLinks(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent resource whose links are to be listed: + *

"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/ + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListLinksPagedResponse listLinks(String parent) { + ListLinksRequest request = ListLinksRequest.newBuilder().setParent(parent).build(); + return listLinks(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists links. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   ListLinksRequest request =
+   *       ListLinksRequest.newBuilder()
+   *           .setParent(
+   *               LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]")
+   *                   .toString())
+   *           .setPageToken("pageToken873572522")
+   *           .setPageSize(883849137)
+   *           .build();
+   *   for (Link element : configClient.listLinks(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListLinksPagedResponse listLinks(ListLinksRequest request) { + return listLinksPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists links. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   ListLinksRequest request =
+   *       ListLinksRequest.newBuilder()
+   *           .setParent(
+   *               LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]")
+   *                   .toString())
+   *           .setPageToken("pageToken873572522")
+   *           .setPageSize(883849137)
+   *           .build();
+   *   ApiFuture future = configClient.listLinksPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Link element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listLinksPagedCallable() { + return stub.listLinksPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists links. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   ListLinksRequest request =
+   *       ListLinksRequest.newBuilder()
+   *           .setParent(
+   *               LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]")
+   *                   .toString())
+   *           .setPageToken("pageToken873572522")
+   *           .setPageSize(883849137)
+   *           .build();
+   *   while (true) {
+   *     ListLinksResponse response = configClient.listLinksCallable().call(request);
+   *     for (Link element : response.getLinksList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listLinksCallable() { + return stub.listLinksCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a link. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   LinkName name =
+   *       LinkName.ofProjectLocationBucketLinkName("[PROJECT]", "[LOCATION]", "[BUCKET]", "[LINK]");
+   *   Link response = configClient.getLink(name);
+   * }
+   * }
+ * + * @param name Required. The resource name of the link: + *

"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID] + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Link getLink(LinkName name) { + GetLinkRequest request = + GetLinkRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getLink(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a link. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   String name =
+   *       LinkName.ofProjectLocationBucketLinkName("[PROJECT]", "[LOCATION]", "[BUCKET]", "[LINK]")
+   *           .toString();
+   *   Link response = configClient.getLink(name);
+   * }
+   * }
+ * + * @param name Required. The resource name of the link: + *

"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + * "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID] + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Link getLink(String name) { + GetLinkRequest request = GetLinkRequest.newBuilder().setName(name).build(); + return getLink(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a link. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   GetLinkRequest request =
+   *       GetLinkRequest.newBuilder()
+   *           .setName(
+   *               LinkName.ofProjectLocationBucketLinkName(
+   *                       "[PROJECT]", "[LOCATION]", "[BUCKET]", "[LINK]")
+   *                   .toString())
+   *           .build();
+   *   Link response = configClient.getLink(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 Link getLink(GetLinkRequest request) { + return getLinkCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a link. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   GetLinkRequest request =
+   *       GetLinkRequest.newBuilder()
+   *           .setName(
+   *               LinkName.ofProjectLocationBucketLinkName(
+   *                       "[PROJECT]", "[LOCATION]", "[BUCKET]", "[LINK]")
+   *                   .toString())
+   *           .build();
+   *   ApiFuture future = configClient.getLinkCallable().futureCall(request);
+   *   // Do something.
+   *   Link response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getLinkCallable() { + return stub.getLinkCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all the exclusions on the _Default sink in a parent resource. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]");
+   *   for (LogExclusion element : configClient.listExclusions(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent resource whose exclusions are to be listed. + *

"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListExclusionsPagedResponse listExclusions(BillingAccountName parent) { + ListExclusionsRequest request = + ListExclusionsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listExclusions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all the exclusions on the _Default sink in a parent resource. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   FolderName parent = FolderName.of("[FOLDER]");
+   *   for (LogExclusion element : configClient.listExclusions(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent resource whose exclusions are to be listed. + *

"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListExclusionsPagedResponse listExclusions(FolderName parent) { + ListExclusionsRequest request = + ListExclusionsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listExclusions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all the exclusions on the _Default sink in a parent resource. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+   *   for (LogExclusion element : configClient.listExclusions(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent resource whose exclusions are to be listed. + *

"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListExclusionsPagedResponse listExclusions(OrganizationName parent) { + ListExclusionsRequest request = + ListExclusionsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listExclusions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all the exclusions on the _Default sink in a parent resource. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   for (LogExclusion element : configClient.listExclusions(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent resource whose exclusions are to be listed. + *

"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListExclusionsPagedResponse listExclusions(ProjectName parent) { + ListExclusionsRequest request = + ListExclusionsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listExclusions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all the exclusions on the _Default sink in a parent resource. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   String parent = ProjectName.of("[PROJECT]").toString();
+   *   for (LogExclusion element : configClient.listExclusions(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent resource whose exclusions are to be listed. + *

"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListExclusionsPagedResponse listExclusions(String parent) { + ListExclusionsRequest request = ListExclusionsRequest.newBuilder().setParent(parent).build(); + return listExclusions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all the exclusions on the _Default sink in a parent resource. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   ListExclusionsRequest request =
+   *       ListExclusionsRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .setPageToken("pageToken873572522")
+   *           .setPageSize(883849137)
+   *           .build();
+   *   for (LogExclusion element : configClient.listExclusions(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListExclusionsPagedResponse listExclusions(ListExclusionsRequest request) { + return listExclusionsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all the exclusions on the _Default sink in a parent resource. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   ListExclusionsRequest request =
+   *       ListExclusionsRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .setPageToken("pageToken873572522")
+   *           .setPageSize(883849137)
+   *           .build();
+   *   ApiFuture future =
+   *       configClient.listExclusionsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (LogExclusion element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listExclusionsPagedCallable() { + return stub.listExclusionsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all the exclusions on the _Default sink in a parent resource. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   ListExclusionsRequest request =
+   *       ListExclusionsRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .setPageToken("pageToken873572522")
+   *           .setPageSize(883849137)
+   *           .build();
+   *   while (true) {
+   *     ListExclusionsResponse response = configClient.listExclusionsCallable().call(request);
+   *     for (LogExclusion element : response.getExclusionsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listExclusionsCallable() { + return stub.listExclusionsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the description of an exclusion in the _Default sink. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   LogExclusionName name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]");
+   *   LogExclusion response = configClient.getExclusion(name);
+   * }
+   * }
+ * + * @param name Required. The resource name of an existing exclusion: + *

"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + *

For example: + *

`"projects/my-project/exclusions/my-exclusion"` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogExclusion getExclusion(LogExclusionName name) { + GetExclusionRequest request = + GetExclusionRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getExclusion(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the description of an exclusion in the _Default sink. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   String name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString();
+   *   LogExclusion response = configClient.getExclusion(name);
+   * }
+   * }
+ * + * @param name Required. The resource name of an existing exclusion: + *

"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + *

For example: + *

`"projects/my-project/exclusions/my-exclusion"` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogExclusion getExclusion(String name) { + GetExclusionRequest request = GetExclusionRequest.newBuilder().setName(name).build(); + return getExclusion(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the description of an exclusion in the _Default sink. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   GetExclusionRequest request =
+   *       GetExclusionRequest.newBuilder()
+   *           .setName(
+   *               LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString())
+   *           .build();
+   *   LogExclusion response = configClient.getExclusion(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 LogExclusion getExclusion(GetExclusionRequest request) { + return getExclusionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the description of an exclusion in the _Default sink. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   GetExclusionRequest request =
+   *       GetExclusionRequest.newBuilder()
+   *           .setName(
+   *               LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString())
+   *           .build();
+   *   ApiFuture future = configClient.getExclusionCallable().futureCall(request);
+   *   // Do something.
+   *   LogExclusion response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getExclusionCallable() { + return stub.getExclusionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new exclusion in the _Default sink in a specified parent resource. Only log entries + * belonging to that resource can be excluded. You can have up to 10 exclusions in a resource. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]");
+   *   LogExclusion exclusion = LogExclusion.newBuilder().build();
+   *   LogExclusion response = configClient.createExclusion(parent, exclusion);
+   * }
+   * }
+ * + * @param parent Required. The parent resource in which to create the exclusion: + *

"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + *

For examples: + *

`"projects/my-logging-project"` `"organizations/123456789"` + * @param exclusion Required. The new exclusion, whose `name` parameter is an exclusion name that + * is not already used in the parent resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogExclusion createExclusion(BillingAccountName parent, LogExclusion exclusion) { + CreateExclusionRequest request = + CreateExclusionRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setExclusion(exclusion) + .build(); + return createExclusion(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new exclusion in the _Default sink in a specified parent resource. Only log entries + * belonging to that resource can be excluded. You can have up to 10 exclusions in a resource. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   FolderName parent = FolderName.of("[FOLDER]");
+   *   LogExclusion exclusion = LogExclusion.newBuilder().build();
+   *   LogExclusion response = configClient.createExclusion(parent, exclusion);
+   * }
+   * }
+ * + * @param parent Required. The parent resource in which to create the exclusion: + *

"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + *

For examples: + *

`"projects/my-logging-project"` `"organizations/123456789"` + * @param exclusion Required. The new exclusion, whose `name` parameter is an exclusion name that + * is not already used in the parent resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogExclusion createExclusion(FolderName parent, LogExclusion exclusion) { + CreateExclusionRequest request = + CreateExclusionRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setExclusion(exclusion) + .build(); + return createExclusion(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new exclusion in the _Default sink in a specified parent resource. Only log entries + * belonging to that resource can be excluded. You can have up to 10 exclusions in a resource. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+   *   LogExclusion exclusion = LogExclusion.newBuilder().build();
+   *   LogExclusion response = configClient.createExclusion(parent, exclusion);
+   * }
+   * }
+ * + * @param parent Required. The parent resource in which to create the exclusion: + *

"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + *

For examples: + *

`"projects/my-logging-project"` `"organizations/123456789"` + * @param exclusion Required. The new exclusion, whose `name` parameter is an exclusion name that + * is not already used in the parent resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogExclusion createExclusion(OrganizationName parent, LogExclusion exclusion) { + CreateExclusionRequest request = + CreateExclusionRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setExclusion(exclusion) + .build(); + return createExclusion(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new exclusion in the _Default sink in a specified parent resource. Only log entries + * belonging to that resource can be excluded. You can have up to 10 exclusions in a resource. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   LogExclusion exclusion = LogExclusion.newBuilder().build();
+   *   LogExclusion response = configClient.createExclusion(parent, exclusion);
+   * }
+   * }
+ * + * @param parent Required. The parent resource in which to create the exclusion: + *

"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + *

For examples: + *

`"projects/my-logging-project"` `"organizations/123456789"` + * @param exclusion Required. The new exclusion, whose `name` parameter is an exclusion name that + * is not already used in the parent resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogExclusion createExclusion(ProjectName parent, LogExclusion exclusion) { + CreateExclusionRequest request = + CreateExclusionRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setExclusion(exclusion) + .build(); + return createExclusion(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new exclusion in the _Default sink in a specified parent resource. Only log entries + * belonging to that resource can be excluded. You can have up to 10 exclusions in a resource. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   String parent = ProjectName.of("[PROJECT]").toString();
+   *   LogExclusion exclusion = LogExclusion.newBuilder().build();
+   *   LogExclusion response = configClient.createExclusion(parent, exclusion);
+   * }
+   * }
+ * + * @param parent Required. The parent resource in which to create the exclusion: + *

"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + *

For examples: + *

`"projects/my-logging-project"` `"organizations/123456789"` + * @param exclusion Required. The new exclusion, whose `name` parameter is an exclusion name that + * is not already used in the parent resource. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogExclusion createExclusion(String parent, LogExclusion exclusion) { + CreateExclusionRequest request = + CreateExclusionRequest.newBuilder().setParent(parent).setExclusion(exclusion).build(); + return createExclusion(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new exclusion in the _Default sink in a specified parent resource. Only log entries + * belonging to that resource can be excluded. You can have up to 10 exclusions in a resource. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   CreateExclusionRequest request =
+   *       CreateExclusionRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .setExclusion(LogExclusion.newBuilder().build())
+   *           .build();
+   *   LogExclusion response = configClient.createExclusion(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 LogExclusion createExclusion(CreateExclusionRequest request) { + return createExclusionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new exclusion in the _Default sink in a specified parent resource. Only log entries + * belonging to that resource can be excluded. You can have up to 10 exclusions in a resource. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   CreateExclusionRequest request =
+   *       CreateExclusionRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .setExclusion(LogExclusion.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = configClient.createExclusionCallable().futureCall(request);
+   *   // Do something.
+   *   LogExclusion response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createExclusionCallable() { + return stub.createExclusionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Changes one or more properties of an existing exclusion in the _Default sink. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   LogExclusionName name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]");
+   *   LogExclusion exclusion = LogExclusion.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   LogExclusion response = configClient.updateExclusion(name, exclusion, updateMask);
+   * }
+   * }
+ * + * @param name Required. The resource name of the exclusion to update: + *

"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + *

For example: + *

`"projects/my-project/exclusions/my-exclusion"` + * @param exclusion Required. New values for the existing exclusion. Only the fields specified in + * `update_mask` are relevant. + * @param updateMask Required. A non-empty list of fields to change in the existing exclusion. New + * values for the fields are taken from the corresponding fields in the + * [LogExclusion][google.logging.v2.LogExclusion] included in this request. Fields not + * mentioned in `update_mask` are not changed and are ignored in the request. + *

For example, to change the filter and description of an exclusion, specify an + * `update_mask` of `"filter,description"`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogExclusion updateExclusion( + LogExclusionName name, LogExclusion exclusion, FieldMask updateMask) { + UpdateExclusionRequest request = + UpdateExclusionRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setExclusion(exclusion) + .setUpdateMask(updateMask) + .build(); + return updateExclusion(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Changes one or more properties of an existing exclusion in the _Default sink. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   String name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString();
+   *   LogExclusion exclusion = LogExclusion.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   LogExclusion response = configClient.updateExclusion(name, exclusion, updateMask);
+   * }
+   * }
+ * + * @param name Required. The resource name of the exclusion to update: + *

"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + *

For example: + *

`"projects/my-project/exclusions/my-exclusion"` + * @param exclusion Required. New values for the existing exclusion. Only the fields specified in + * `update_mask` are relevant. + * @param updateMask Required. A non-empty list of fields to change in the existing exclusion. New + * values for the fields are taken from the corresponding fields in the + * [LogExclusion][google.logging.v2.LogExclusion] included in this request. Fields not + * mentioned in `update_mask` are not changed and are ignored in the request. + *

For example, to change the filter and description of an exclusion, specify an + * `update_mask` of `"filter,description"`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogExclusion updateExclusion( + String name, LogExclusion exclusion, FieldMask updateMask) { + UpdateExclusionRequest request = + UpdateExclusionRequest.newBuilder() + .setName(name) + .setExclusion(exclusion) + .setUpdateMask(updateMask) + .build(); + return updateExclusion(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Changes one or more properties of an existing exclusion in the _Default sink. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   UpdateExclusionRequest request =
+   *       UpdateExclusionRequest.newBuilder()
+   *           .setName(
+   *               LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString())
+   *           .setExclusion(LogExclusion.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   LogExclusion response = configClient.updateExclusion(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 LogExclusion updateExclusion(UpdateExclusionRequest request) { + return updateExclusionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Changes one or more properties of an existing exclusion in the _Default sink. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   UpdateExclusionRequest request =
+   *       UpdateExclusionRequest.newBuilder()
+   *           .setName(
+   *               LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString())
+   *           .setExclusion(LogExclusion.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = configClient.updateExclusionCallable().futureCall(request);
+   *   // Do something.
+   *   LogExclusion response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateExclusionCallable() { + return stub.updateExclusionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes an exclusion in the _Default sink. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   LogExclusionName name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]");
+   *   configClient.deleteExclusion(name);
+   * }
+   * }
+ * + * @param name Required. The resource name of an existing exclusion to delete: + *

"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + *

For example: + *

`"projects/my-project/exclusions/my-exclusion"` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteExclusion(LogExclusionName name) { + DeleteExclusionRequest request = + DeleteExclusionRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteExclusion(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes an exclusion in the _Default sink. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   String name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString();
+   *   configClient.deleteExclusion(name);
+   * }
+   * }
+ * + * @param name Required. The resource name of an existing exclusion to delete: + *

"projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" + * "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" + * "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" + *

For example: + *

`"projects/my-project/exclusions/my-exclusion"` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteExclusion(String name) { + DeleteExclusionRequest request = DeleteExclusionRequest.newBuilder().setName(name).build(); + deleteExclusion(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes an exclusion in the _Default sink. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   DeleteExclusionRequest request =
+   *       DeleteExclusionRequest.newBuilder()
+   *           .setName(
+   *               LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString())
+   *           .build();
+   *   configClient.deleteExclusion(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteExclusion(DeleteExclusionRequest request) { + deleteExclusionCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes an exclusion in the _Default sink. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   DeleteExclusionRequest request =
+   *       DeleteExclusionRequest.newBuilder()
+   *           .setName(
+   *               LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString())
+   *           .build();
+   *   ApiFuture future = configClient.deleteExclusionCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteExclusionCallable() { + return stub.deleteExclusionCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the Logging CMEK settings for the given resource. + * + *

Note: CMEK for the Log Router can be configured for Google Cloud projects, folders, + * organizations and billing accounts. Once configured for an organization, it applies to all + * projects and folders in the Google Cloud organization. + * + *

See [Enabling CMEK for Log + * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for more information. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   GetCmekSettingsRequest request =
+   *       GetCmekSettingsRequest.newBuilder()
+   *           .setName(CmekSettingsName.ofProjectName("[PROJECT]").toString())
+   *           .build();
+   *   CmekSettings response = configClient.getCmekSettings(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 CmekSettings getCmekSettings(GetCmekSettingsRequest request) { + return getCmekSettingsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the Logging CMEK settings for the given resource. + * + *

Note: CMEK for the Log Router can be configured for Google Cloud projects, folders, + * organizations and billing accounts. Once configured for an organization, it applies to all + * projects and folders in the Google Cloud organization. + * + *

See [Enabling CMEK for Log + * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for more information. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   GetCmekSettingsRequest request =
+   *       GetCmekSettingsRequest.newBuilder()
+   *           .setName(CmekSettingsName.ofProjectName("[PROJECT]").toString())
+   *           .build();
+   *   ApiFuture future = configClient.getCmekSettingsCallable().futureCall(request);
+   *   // Do something.
+   *   CmekSettings response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getCmekSettingsCallable() { + return stub.getCmekSettingsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the Log Router CMEK settings for the given resource. + * + *

Note: CMEK for the Log Router can currently only be configured for Google Cloud + * organizations. Once configured, it applies to all projects and folders in the Google Cloud + * organization. + * + *

[UpdateCmekSettings][google.logging.v2.ConfigServiceV2.UpdateCmekSettings] will fail if 1) + * `kms_key_name` is invalid, or 2) the associated service account does not have the required + * `roles/cloudkms.cryptoKeyEncrypterDecrypter` role assigned for the key, or 3) access to the key + * is disabled. + * + *

See [Enabling CMEK for Log + * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for more information. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   UpdateCmekSettingsRequest request =
+   *       UpdateCmekSettingsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setCmekSettings(CmekSettings.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   CmekSettings response = configClient.updateCmekSettings(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 CmekSettings updateCmekSettings(UpdateCmekSettingsRequest request) { + return updateCmekSettingsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the Log Router CMEK settings for the given resource. + * + *

Note: CMEK for the Log Router can currently only be configured for Google Cloud + * organizations. Once configured, it applies to all projects and folders in the Google Cloud + * organization. + * + *

[UpdateCmekSettings][google.logging.v2.ConfigServiceV2.UpdateCmekSettings] will fail if 1) + * `kms_key_name` is invalid, or 2) the associated service account does not have the required + * `roles/cloudkms.cryptoKeyEncrypterDecrypter` role assigned for the key, or 3) access to the key + * is disabled. + * + *

See [Enabling CMEK for Log + * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for more information. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   UpdateCmekSettingsRequest request =
+   *       UpdateCmekSettingsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setCmekSettings(CmekSettings.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       configClient.updateCmekSettingsCallable().futureCall(request);
+   *   // Do something.
+   *   CmekSettings response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateCmekSettingsCallable() { + return stub.updateCmekSettingsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the Log Router settings for the given resource. + * + *

Note: Settings for the Log Router can be get for Google Cloud projects, folders, + * organizations and billing accounts. Currently it can only be configured for organizations. Once + * configured for an organization, it applies to all projects and folders in the Google Cloud + * organization. + * + *

See [Enabling CMEK for Log + * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for more information. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   SettingsName name = SettingsName.ofProjectName("[PROJECT]");
+   *   Settings response = configClient.getSettings(name);
+   * }
+   * }
+ * + * @param name Required. The resource for which to retrieve settings. + *

"projects/[PROJECT_ID]/settings" "organizations/[ORGANIZATION_ID]/settings" + * "billingAccounts/[BILLING_ACCOUNT_ID]/settings" "folders/[FOLDER_ID]/settings" + *

For example: + *

`"organizations/12345/settings"` + *

Note: Settings for the Log Router can be get for Google Cloud projects, folders, + * organizations and billing accounts. Currently it can only be configured for organizations. + * Once configured for an organization, it applies to all projects and folders in the Google + * Cloud organization. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Settings getSettings(SettingsName name) { + GetSettingsRequest request = + GetSettingsRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getSettings(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the Log Router settings for the given resource. + * + *

Note: Settings for the Log Router can be get for Google Cloud projects, folders, + * organizations and billing accounts. Currently it can only be configured for organizations. Once + * configured for an organization, it applies to all projects and folders in the Google Cloud + * organization. + * + *

See [Enabling CMEK for Log + * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for more information. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   String name = SettingsName.ofProjectName("[PROJECT]").toString();
+   *   Settings response = configClient.getSettings(name);
+   * }
+   * }
+ * + * @param name Required. The resource for which to retrieve settings. + *

"projects/[PROJECT_ID]/settings" "organizations/[ORGANIZATION_ID]/settings" + * "billingAccounts/[BILLING_ACCOUNT_ID]/settings" "folders/[FOLDER_ID]/settings" + *

For example: + *

`"organizations/12345/settings"` + *

Note: Settings for the Log Router can be get for Google Cloud projects, folders, + * organizations and billing accounts. Currently it can only be configured for organizations. + * Once configured for an organization, it applies to all projects and folders in the Google + * Cloud organization. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Settings getSettings(String name) { + GetSettingsRequest request = GetSettingsRequest.newBuilder().setName(name).build(); + return getSettings(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the Log Router settings for the given resource. + * + *

Note: Settings for the Log Router can be get for Google Cloud projects, folders, + * organizations and billing accounts. Currently it can only be configured for organizations. Once + * configured for an organization, it applies to all projects and folders in the Google Cloud + * organization. + * + *

See [Enabling CMEK for Log + * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for more information. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   GetSettingsRequest request =
+   *       GetSettingsRequest.newBuilder()
+   *           .setName(SettingsName.ofProjectName("[PROJECT]").toString())
+   *           .build();
+   *   Settings response = configClient.getSettings(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 Settings getSettings(GetSettingsRequest request) { + return getSettingsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the Log Router settings for the given resource. + * + *

Note: Settings for the Log Router can be get for Google Cloud projects, folders, + * organizations and billing accounts. Currently it can only be configured for organizations. Once + * configured for an organization, it applies to all projects and folders in the Google Cloud + * organization. + * + *

See [Enabling CMEK for Log + * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for more information. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   GetSettingsRequest request =
+   *       GetSettingsRequest.newBuilder()
+   *           .setName(SettingsName.ofProjectName("[PROJECT]").toString())
+   *           .build();
+   *   ApiFuture future = configClient.getSettingsCallable().futureCall(request);
+   *   // Do something.
+   *   Settings response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getSettingsCallable() { + return stub.getSettingsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the Log Router settings for the given resource. + * + *

Note: Settings for the Log Router can currently only be configured for Google Cloud + * organizations. Once configured, it applies to all projects and folders in the Google Cloud + * organization. + * + *

[UpdateSettings][google.logging.v2.ConfigServiceV2.UpdateSettings] will fail if 1) + * `kms_key_name` is invalid, or 2) the associated service account does not have the required + * `roles/cloudkms.cryptoKeyEncrypterDecrypter` role assigned for the key, or 3) access to the key + * is disabled. 4) `location_id` is not supported by Logging. 5) `location_id` violate OrgPolicy. + * + *

See [Enabling CMEK for Log + * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for more information. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   Settings settings = Settings.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Settings response = configClient.updateSettings(settings, updateMask);
+   * }
+   * }
+ * + * @param settings Required. The settings to update. + *

See [Enabling CMEK for Log + * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for more + * information. + * @param updateMask Optional. Field mask identifying which fields from `settings` should be + * updated. A field will be overwritten if and only if it is in the update mask. Output only + * fields cannot be updated. + *

See [FieldMask][google.protobuf.FieldMask] for more information. + *

For example: `"updateMask=kmsKeyName"` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Settings updateSettings(Settings settings, FieldMask updateMask) { + UpdateSettingsRequest request = + UpdateSettingsRequest.newBuilder().setSettings(settings).setUpdateMask(updateMask).build(); + return updateSettings(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the Log Router settings for the given resource. + * + *

Note: Settings for the Log Router can currently only be configured for Google Cloud + * organizations. Once configured, it applies to all projects and folders in the Google Cloud + * organization. + * + *

[UpdateSettings][google.logging.v2.ConfigServiceV2.UpdateSettings] will fail if 1) + * `kms_key_name` is invalid, or 2) the associated service account does not have the required + * `roles/cloudkms.cryptoKeyEncrypterDecrypter` role assigned for the key, or 3) access to the key + * is disabled. 4) `location_id` is not supported by Logging. 5) `location_id` violate OrgPolicy. + * + *

See [Enabling CMEK for Log + * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for more information. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   UpdateSettingsRequest request =
+   *       UpdateSettingsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setSettings(Settings.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   Settings response = configClient.updateSettings(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 Settings updateSettings(UpdateSettingsRequest request) { + return updateSettingsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the Log Router settings for the given resource. + * + *

Note: Settings for the Log Router can currently only be configured for Google Cloud + * organizations. Once configured, it applies to all projects and folders in the Google Cloud + * organization. + * + *

[UpdateSettings][google.logging.v2.ConfigServiceV2.UpdateSettings] will fail if 1) + * `kms_key_name` is invalid, or 2) the associated service account does not have the required + * `roles/cloudkms.cryptoKeyEncrypterDecrypter` role assigned for the key, or 3) access to the key + * is disabled. 4) `location_id` is not supported by Logging. 5) `location_id` violate OrgPolicy. + * + *

See [Enabling CMEK for Log + * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for more information. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   UpdateSettingsRequest request =
+   *       UpdateSettingsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setSettings(Settings.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = configClient.updateSettingsCallable().futureCall(request);
+   *   // Do something.
+   *   Settings response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateSettingsCallable() { + return stub.updateSettingsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Copies a set of log entries from a log bucket to a Cloud Storage bucket. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   CopyLogEntriesRequest request =
+   *       CopyLogEntriesRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setDestination("destination-1429847026")
+   *           .build();
+   *   CopyLogEntriesResponse response = configClient.copyLogEntriesAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture copyLogEntriesAsync( + CopyLogEntriesRequest request) { + return copyLogEntriesOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Copies a set of log entries from a log bucket to a Cloud Storage bucket. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   CopyLogEntriesRequest request =
+   *       CopyLogEntriesRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setDestination("destination-1429847026")
+   *           .build();
+   *   OperationFuture future =
+   *       configClient.copyLogEntriesOperationCallable().futureCall(request);
+   *   // Do something.
+   *   CopyLogEntriesResponse response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + CopyLogEntriesRequest, CopyLogEntriesResponse, CopyLogEntriesMetadata> + copyLogEntriesOperationCallable() { + return stub.copyLogEntriesOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Copies a set of log entries from a log bucket to a Cloud Storage bucket. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ConfigClient configClient = ConfigClient.create()) {
+   *   CopyLogEntriesRequest request =
+   *       CopyLogEntriesRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setDestination("destination-1429847026")
+   *           .build();
+   *   ApiFuture future = configClient.copyLogEntriesCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable copyLogEntriesCallable() { + return stub.copyLogEntriesCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListBucketsPagedResponse + extends AbstractPagedListResponse< + ListBucketsRequest, + ListBucketsResponse, + LogBucket, + ListBucketsPage, + ListBucketsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListBucketsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, input -> new ListBucketsPagedResponse(input), MoreExecutors.directExecutor()); + } + + private ListBucketsPagedResponse(ListBucketsPage page) { + super(page, ListBucketsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListBucketsPage + extends AbstractPage { + + private ListBucketsPage( + PageContext context, + ListBucketsResponse response) { + super(context, response); + } + + private static ListBucketsPage createEmptyPage() { + return new ListBucketsPage(null, null); + } + + @Override + protected ListBucketsPage createPage( + PageContext context, + ListBucketsResponse response) { + return new ListBucketsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListBucketsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListBucketsRequest, + ListBucketsResponse, + LogBucket, + ListBucketsPage, + ListBucketsFixedSizeCollection> { + + private ListBucketsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListBucketsFixedSizeCollection createEmptyCollection() { + return new ListBucketsFixedSizeCollection(null, 0); + } + + @Override + protected ListBucketsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListBucketsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListViewsPagedResponse + extends AbstractPagedListResponse< + ListViewsRequest, + ListViewsResponse, + LogView, + ListViewsPage, + ListViewsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListViewsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, input -> new ListViewsPagedResponse(input), MoreExecutors.directExecutor()); + } + + private ListViewsPagedResponse(ListViewsPage page) { + super(page, ListViewsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListViewsPage + extends AbstractPage { + + private ListViewsPage( + PageContext context, + ListViewsResponse response) { + super(context, response); + } + + private static ListViewsPage createEmptyPage() { + return new ListViewsPage(null, null); + } + + @Override + protected ListViewsPage createPage( + PageContext context, + ListViewsResponse response) { + return new ListViewsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListViewsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListViewsRequest, + ListViewsResponse, + LogView, + ListViewsPage, + ListViewsFixedSizeCollection> { + + private ListViewsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListViewsFixedSizeCollection createEmptyCollection() { + return new ListViewsFixedSizeCollection(null, 0); + } + + @Override + protected ListViewsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListViewsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListSinksPagedResponse + extends AbstractPagedListResponse< + ListSinksRequest, + ListSinksResponse, + LogSink, + ListSinksPage, + ListSinksFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListSinksPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, input -> new ListSinksPagedResponse(input), MoreExecutors.directExecutor()); + } + + private ListSinksPagedResponse(ListSinksPage page) { + super(page, ListSinksFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListSinksPage + extends AbstractPage { + + private ListSinksPage( + PageContext context, + ListSinksResponse response) { + super(context, response); + } + + private static ListSinksPage createEmptyPage() { + return new ListSinksPage(null, null); + } + + @Override + protected ListSinksPage createPage( + PageContext context, + ListSinksResponse response) { + return new ListSinksPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListSinksFixedSizeCollection + extends AbstractFixedSizeCollection< + ListSinksRequest, + ListSinksResponse, + LogSink, + ListSinksPage, + ListSinksFixedSizeCollection> { + + private ListSinksFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListSinksFixedSizeCollection createEmptyCollection() { + return new ListSinksFixedSizeCollection(null, 0); + } + + @Override + protected ListSinksFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListSinksFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListLinksPagedResponse + extends AbstractPagedListResponse< + ListLinksRequest, ListLinksResponse, Link, ListLinksPage, ListLinksFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLinksPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, input -> new ListLinksPagedResponse(input), MoreExecutors.directExecutor()); + } + + private ListLinksPagedResponse(ListLinksPage page) { + super(page, ListLinksFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLinksPage + extends AbstractPage { + + private ListLinksPage( + PageContext context, + ListLinksResponse response) { + super(context, response); + } + + private static ListLinksPage createEmptyPage() { + return new ListLinksPage(null, null); + } + + @Override + protected ListLinksPage createPage( + PageContext context, + ListLinksResponse response) { + return new ListLinksPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLinksFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLinksRequest, ListLinksResponse, Link, ListLinksPage, ListLinksFixedSizeCollection> { + + private ListLinksFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLinksFixedSizeCollection createEmptyCollection() { + return new ListLinksFixedSizeCollection(null, 0); + } + + @Override + protected ListLinksFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLinksFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListExclusionsPagedResponse + extends AbstractPagedListResponse< + ListExclusionsRequest, + ListExclusionsResponse, + LogExclusion, + ListExclusionsPage, + ListExclusionsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListExclusionsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListExclusionsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListExclusionsPagedResponse(ListExclusionsPage page) { + super(page, ListExclusionsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListExclusionsPage + extends AbstractPage< + ListExclusionsRequest, ListExclusionsResponse, LogExclusion, ListExclusionsPage> { + + private ListExclusionsPage( + PageContext context, + ListExclusionsResponse response) { + super(context, response); + } + + private static ListExclusionsPage createEmptyPage() { + return new ListExclusionsPage(null, null); + } + + @Override + protected ListExclusionsPage createPage( + PageContext context, + ListExclusionsResponse response) { + return new ListExclusionsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListExclusionsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListExclusionsRequest, + ListExclusionsResponse, + LogExclusion, + ListExclusionsPage, + ListExclusionsFixedSizeCollection> { + + private ListExclusionsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListExclusionsFixedSizeCollection createEmptyCollection() { + return new ListExclusionsFixedSizeCollection(null, 0); + } + + @Override + protected ListExclusionsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListExclusionsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-logging/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/ConfigSettings.java b/java-logging/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/ConfigSettings.java new file mode 100644 index 000000000000..aeed6d1ca7de --- /dev/null +++ b/java-logging/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/ConfigSettings.java @@ -0,0 +1,665 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2; + +import static com.google.cloud.logging.v2.ConfigClient.ListBucketsPagedResponse; +import static com.google.cloud.logging.v2.ConfigClient.ListExclusionsPagedResponse; +import static com.google.cloud.logging.v2.ConfigClient.ListLinksPagedResponse; +import static com.google.cloud.logging.v2.ConfigClient.ListSinksPagedResponse; +import static com.google.cloud.logging.v2.ConfigClient.ListViewsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.logging.v2.stub.ConfigServiceV2StubSettings; +import com.google.logging.v2.BucketMetadata; +import com.google.logging.v2.CmekSettings; +import com.google.logging.v2.CopyLogEntriesMetadata; +import com.google.logging.v2.CopyLogEntriesRequest; +import com.google.logging.v2.CopyLogEntriesResponse; +import com.google.logging.v2.CreateBucketRequest; +import com.google.logging.v2.CreateExclusionRequest; +import com.google.logging.v2.CreateLinkRequest; +import com.google.logging.v2.CreateSinkRequest; +import com.google.logging.v2.CreateViewRequest; +import com.google.logging.v2.DeleteBucketRequest; +import com.google.logging.v2.DeleteExclusionRequest; +import com.google.logging.v2.DeleteLinkRequest; +import com.google.logging.v2.DeleteSinkRequest; +import com.google.logging.v2.DeleteViewRequest; +import com.google.logging.v2.GetBucketRequest; +import com.google.logging.v2.GetCmekSettingsRequest; +import com.google.logging.v2.GetExclusionRequest; +import com.google.logging.v2.GetLinkRequest; +import com.google.logging.v2.GetSettingsRequest; +import com.google.logging.v2.GetSinkRequest; +import com.google.logging.v2.GetViewRequest; +import com.google.logging.v2.Link; +import com.google.logging.v2.LinkMetadata; +import com.google.logging.v2.ListBucketsRequest; +import com.google.logging.v2.ListBucketsResponse; +import com.google.logging.v2.ListExclusionsRequest; +import com.google.logging.v2.ListExclusionsResponse; +import com.google.logging.v2.ListLinksRequest; +import com.google.logging.v2.ListLinksResponse; +import com.google.logging.v2.ListSinksRequest; +import com.google.logging.v2.ListSinksResponse; +import com.google.logging.v2.ListViewsRequest; +import com.google.logging.v2.ListViewsResponse; +import com.google.logging.v2.LogBucket; +import com.google.logging.v2.LogExclusion; +import com.google.logging.v2.LogSink; +import com.google.logging.v2.LogView; +import com.google.logging.v2.Settings; +import com.google.logging.v2.UndeleteBucketRequest; +import com.google.logging.v2.UpdateBucketRequest; +import com.google.logging.v2.UpdateCmekSettingsRequest; +import com.google.logging.v2.UpdateExclusionRequest; +import com.google.logging.v2.UpdateSettingsRequest; +import com.google.logging.v2.UpdateSinkRequest; +import com.google.logging.v2.UpdateViewRequest; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link ConfigClient}. + * + *

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

    + *
  • The default service address (logging.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 + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of getBucket: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * ConfigSettings.Builder configSettingsBuilder = ConfigSettings.newBuilder();
+ * configSettingsBuilder
+ *     .getBucketSettings()
+ *     .setRetrySettings(
+ *         configSettingsBuilder
+ *             .getBucketSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeoutDuration(Duration.ofSeconds(300))
+ *             .build());
+ * ConfigSettings configSettings = configSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. + * + *

To configure the RetrySettings of a Long Running Operation method, create an + * OperationTimedPollAlgorithm object and update the RPC's polling algorithm. For example, to + * configure the RetrySettings for createBucketAsync: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * ConfigSettings.Builder configSettingsBuilder = ConfigSettings.newBuilder();
+ * TimedRetryAlgorithm timedRetryAlgorithm =
+ *     OperationalTimedPollAlgorithm.create(
+ *         RetrySettings.newBuilder()
+ *             .setInitialRetryDelayDuration(Duration.ofMillis(500))
+ *             .setRetryDelayMultiplier(1.5)
+ *             .setMaxRetryDelayDuration(Duration.ofMillis(5000))
+ *             .setTotalTimeoutDuration(Duration.ofHours(24))
+ *             .build());
+ * configSettingsBuilder
+ *     .createClusterOperationSettings()
+ *     .setPollingAlgorithm(timedRetryAlgorithm)
+ *     .build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class ConfigSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to listBuckets. */ + public PagedCallSettings + listBucketsSettings() { + return ((ConfigServiceV2StubSettings) getStubSettings()).listBucketsSettings(); + } + + /** Returns the object with the settings used for calls to getBucket. */ + public UnaryCallSettings getBucketSettings() { + return ((ConfigServiceV2StubSettings) getStubSettings()).getBucketSettings(); + } + + /** Returns the object with the settings used for calls to createBucketAsync. */ + public UnaryCallSettings createBucketAsyncSettings() { + return ((ConfigServiceV2StubSettings) getStubSettings()).createBucketAsyncSettings(); + } + + /** Returns the object with the settings used for calls to createBucketAsync. */ + public OperationCallSettings + createBucketAsyncOperationSettings() { + return ((ConfigServiceV2StubSettings) getStubSettings()).createBucketAsyncOperationSettings(); + } + + /** Returns the object with the settings used for calls to updateBucketAsync. */ + public UnaryCallSettings updateBucketAsyncSettings() { + return ((ConfigServiceV2StubSettings) getStubSettings()).updateBucketAsyncSettings(); + } + + /** Returns the object with the settings used for calls to updateBucketAsync. */ + public OperationCallSettings + updateBucketAsyncOperationSettings() { + return ((ConfigServiceV2StubSettings) getStubSettings()).updateBucketAsyncOperationSettings(); + } + + /** Returns the object with the settings used for calls to createBucket. */ + public UnaryCallSettings createBucketSettings() { + return ((ConfigServiceV2StubSettings) getStubSettings()).createBucketSettings(); + } + + /** Returns the object with the settings used for calls to updateBucket. */ + public UnaryCallSettings updateBucketSettings() { + return ((ConfigServiceV2StubSettings) getStubSettings()).updateBucketSettings(); + } + + /** Returns the object with the settings used for calls to deleteBucket. */ + public UnaryCallSettings deleteBucketSettings() { + return ((ConfigServiceV2StubSettings) getStubSettings()).deleteBucketSettings(); + } + + /** Returns the object with the settings used for calls to undeleteBucket. */ + public UnaryCallSettings undeleteBucketSettings() { + return ((ConfigServiceV2StubSettings) getStubSettings()).undeleteBucketSettings(); + } + + /** Returns the object with the settings used for calls to listViews. */ + public PagedCallSettings + listViewsSettings() { + return ((ConfigServiceV2StubSettings) getStubSettings()).listViewsSettings(); + } + + /** Returns the object with the settings used for calls to getView. */ + public UnaryCallSettings getViewSettings() { + return ((ConfigServiceV2StubSettings) getStubSettings()).getViewSettings(); + } + + /** Returns the object with the settings used for calls to createView. */ + public UnaryCallSettings createViewSettings() { + return ((ConfigServiceV2StubSettings) getStubSettings()).createViewSettings(); + } + + /** Returns the object with the settings used for calls to updateView. */ + public UnaryCallSettings updateViewSettings() { + return ((ConfigServiceV2StubSettings) getStubSettings()).updateViewSettings(); + } + + /** Returns the object with the settings used for calls to deleteView. */ + public UnaryCallSettings deleteViewSettings() { + return ((ConfigServiceV2StubSettings) getStubSettings()).deleteViewSettings(); + } + + /** Returns the object with the settings used for calls to listSinks. */ + public PagedCallSettings + listSinksSettings() { + return ((ConfigServiceV2StubSettings) getStubSettings()).listSinksSettings(); + } + + /** Returns the object with the settings used for calls to getSink. */ + public UnaryCallSettings getSinkSettings() { + return ((ConfigServiceV2StubSettings) getStubSettings()).getSinkSettings(); + } + + /** Returns the object with the settings used for calls to createSink. */ + public UnaryCallSettings createSinkSettings() { + return ((ConfigServiceV2StubSettings) getStubSettings()).createSinkSettings(); + } + + /** Returns the object with the settings used for calls to updateSink. */ + public UnaryCallSettings updateSinkSettings() { + return ((ConfigServiceV2StubSettings) getStubSettings()).updateSinkSettings(); + } + + /** Returns the object with the settings used for calls to deleteSink. */ + public UnaryCallSettings deleteSinkSettings() { + return ((ConfigServiceV2StubSettings) getStubSettings()).deleteSinkSettings(); + } + + /** Returns the object with the settings used for calls to createLink. */ + public UnaryCallSettings createLinkSettings() { + return ((ConfigServiceV2StubSettings) getStubSettings()).createLinkSettings(); + } + + /** Returns the object with the settings used for calls to createLink. */ + public OperationCallSettings + createLinkOperationSettings() { + return ((ConfigServiceV2StubSettings) getStubSettings()).createLinkOperationSettings(); + } + + /** Returns the object with the settings used for calls to deleteLink. */ + public UnaryCallSettings deleteLinkSettings() { + return ((ConfigServiceV2StubSettings) getStubSettings()).deleteLinkSettings(); + } + + /** Returns the object with the settings used for calls to deleteLink. */ + public OperationCallSettings + deleteLinkOperationSettings() { + return ((ConfigServiceV2StubSettings) getStubSettings()).deleteLinkOperationSettings(); + } + + /** Returns the object with the settings used for calls to listLinks. */ + public PagedCallSettings + listLinksSettings() { + return ((ConfigServiceV2StubSettings) getStubSettings()).listLinksSettings(); + } + + /** Returns the object with the settings used for calls to getLink. */ + public UnaryCallSettings getLinkSettings() { + return ((ConfigServiceV2StubSettings) getStubSettings()).getLinkSettings(); + } + + /** Returns the object with the settings used for calls to listExclusions. */ + public PagedCallSettings< + ListExclusionsRequest, ListExclusionsResponse, ListExclusionsPagedResponse> + listExclusionsSettings() { + return ((ConfigServiceV2StubSettings) getStubSettings()).listExclusionsSettings(); + } + + /** Returns the object with the settings used for calls to getExclusion. */ + public UnaryCallSettings getExclusionSettings() { + return ((ConfigServiceV2StubSettings) getStubSettings()).getExclusionSettings(); + } + + /** Returns the object with the settings used for calls to createExclusion. */ + public UnaryCallSettings createExclusionSettings() { + return ((ConfigServiceV2StubSettings) getStubSettings()).createExclusionSettings(); + } + + /** Returns the object with the settings used for calls to updateExclusion. */ + public UnaryCallSettings updateExclusionSettings() { + return ((ConfigServiceV2StubSettings) getStubSettings()).updateExclusionSettings(); + } + + /** Returns the object with the settings used for calls to deleteExclusion. */ + public UnaryCallSettings deleteExclusionSettings() { + return ((ConfigServiceV2StubSettings) getStubSettings()).deleteExclusionSettings(); + } + + /** Returns the object with the settings used for calls to getCmekSettings. */ + public UnaryCallSettings getCmekSettingsSettings() { + return ((ConfigServiceV2StubSettings) getStubSettings()).getCmekSettingsSettings(); + } + + /** Returns the object with the settings used for calls to updateCmekSettings. */ + public UnaryCallSettings updateCmekSettingsSettings() { + return ((ConfigServiceV2StubSettings) getStubSettings()).updateCmekSettingsSettings(); + } + + /** Returns the object with the settings used for calls to getSettings. */ + public UnaryCallSettings getSettingsSettings() { + return ((ConfigServiceV2StubSettings) getStubSettings()).getSettingsSettings(); + } + + /** Returns the object with the settings used for calls to updateSettings. */ + public UnaryCallSettings updateSettingsSettings() { + return ((ConfigServiceV2StubSettings) getStubSettings()).updateSettingsSettings(); + } + + /** Returns the object with the settings used for calls to copyLogEntries. */ + public UnaryCallSettings copyLogEntriesSettings() { + return ((ConfigServiceV2StubSettings) getStubSettings()).copyLogEntriesSettings(); + } + + /** Returns the object with the settings used for calls to copyLogEntries. */ + public OperationCallSettings< + CopyLogEntriesRequest, CopyLogEntriesResponse, CopyLogEntriesMetadata> + copyLogEntriesOperationSettings() { + return ((ConfigServiceV2StubSettings) getStubSettings()).copyLogEntriesOperationSettings(); + } + + public static final ConfigSettings create(ConfigServiceV2StubSettings stub) throws IOException { + return new ConfigSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return ConfigServiceV2StubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return ConfigServiceV2StubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return ConfigServiceV2StubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return ConfigServiceV2StubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return ConfigServiceV2StubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return ConfigServiceV2StubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ConfigServiceV2StubSettings.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 ConfigSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for ConfigSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(ConfigServiceV2StubSettings.newBuilder(clientContext)); + } + + protected Builder(ConfigSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(ConfigServiceV2StubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(ConfigServiceV2StubSettings.newBuilder()); + } + + public ConfigServiceV2StubSettings.Builder getStubSettingsBuilder() { + return ((ConfigServiceV2StubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to listBuckets. */ + public PagedCallSettings.Builder< + ListBucketsRequest, ListBucketsResponse, ListBucketsPagedResponse> + listBucketsSettings() { + return getStubSettingsBuilder().listBucketsSettings(); + } + + /** Returns the builder for the settings used for calls to getBucket. */ + public UnaryCallSettings.Builder getBucketSettings() { + return getStubSettingsBuilder().getBucketSettings(); + } + + /** Returns the builder for the settings used for calls to createBucketAsync. */ + public UnaryCallSettings.Builder createBucketAsyncSettings() { + return getStubSettingsBuilder().createBucketAsyncSettings(); + } + + /** Returns the builder for the settings used for calls to createBucketAsync. */ + public OperationCallSettings.Builder + createBucketAsyncOperationSettings() { + return getStubSettingsBuilder().createBucketAsyncOperationSettings(); + } + + /** Returns the builder for the settings used for calls to updateBucketAsync. */ + public UnaryCallSettings.Builder updateBucketAsyncSettings() { + return getStubSettingsBuilder().updateBucketAsyncSettings(); + } + + /** Returns the builder for the settings used for calls to updateBucketAsync. */ + public OperationCallSettings.Builder + updateBucketAsyncOperationSettings() { + return getStubSettingsBuilder().updateBucketAsyncOperationSettings(); + } + + /** Returns the builder for the settings used for calls to createBucket. */ + public UnaryCallSettings.Builder createBucketSettings() { + return getStubSettingsBuilder().createBucketSettings(); + } + + /** Returns the builder for the settings used for calls to updateBucket. */ + public UnaryCallSettings.Builder updateBucketSettings() { + return getStubSettingsBuilder().updateBucketSettings(); + } + + /** Returns the builder for the settings used for calls to deleteBucket. */ + public UnaryCallSettings.Builder deleteBucketSettings() { + return getStubSettingsBuilder().deleteBucketSettings(); + } + + /** Returns the builder for the settings used for calls to undeleteBucket. */ + public UnaryCallSettings.Builder undeleteBucketSettings() { + return getStubSettingsBuilder().undeleteBucketSettings(); + } + + /** Returns the builder for the settings used for calls to listViews. */ + public PagedCallSettings.Builder + listViewsSettings() { + return getStubSettingsBuilder().listViewsSettings(); + } + + /** Returns the builder for the settings used for calls to getView. */ + public UnaryCallSettings.Builder getViewSettings() { + return getStubSettingsBuilder().getViewSettings(); + } + + /** Returns the builder for the settings used for calls to createView. */ + public UnaryCallSettings.Builder createViewSettings() { + return getStubSettingsBuilder().createViewSettings(); + } + + /** Returns the builder for the settings used for calls to updateView. */ + public UnaryCallSettings.Builder updateViewSettings() { + return getStubSettingsBuilder().updateViewSettings(); + } + + /** Returns the builder for the settings used for calls to deleteView. */ + public UnaryCallSettings.Builder deleteViewSettings() { + return getStubSettingsBuilder().deleteViewSettings(); + } + + /** Returns the builder for the settings used for calls to listSinks. */ + public PagedCallSettings.Builder + listSinksSettings() { + return getStubSettingsBuilder().listSinksSettings(); + } + + /** Returns the builder for the settings used for calls to getSink. */ + public UnaryCallSettings.Builder getSinkSettings() { + return getStubSettingsBuilder().getSinkSettings(); + } + + /** Returns the builder for the settings used for calls to createSink. */ + public UnaryCallSettings.Builder createSinkSettings() { + return getStubSettingsBuilder().createSinkSettings(); + } + + /** Returns the builder for the settings used for calls to updateSink. */ + public UnaryCallSettings.Builder updateSinkSettings() { + return getStubSettingsBuilder().updateSinkSettings(); + } + + /** Returns the builder for the settings used for calls to deleteSink. */ + public UnaryCallSettings.Builder deleteSinkSettings() { + return getStubSettingsBuilder().deleteSinkSettings(); + } + + /** Returns the builder for the settings used for calls to createLink. */ + public UnaryCallSettings.Builder createLinkSettings() { + return getStubSettingsBuilder().createLinkSettings(); + } + + /** Returns the builder for the settings used for calls to createLink. */ + public OperationCallSettings.Builder + createLinkOperationSettings() { + return getStubSettingsBuilder().createLinkOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deleteLink. */ + public UnaryCallSettings.Builder deleteLinkSettings() { + return getStubSettingsBuilder().deleteLinkSettings(); + } + + /** Returns the builder for the settings used for calls to deleteLink. */ + public OperationCallSettings.Builder + deleteLinkOperationSettings() { + return getStubSettingsBuilder().deleteLinkOperationSettings(); + } + + /** Returns the builder for the settings used for calls to listLinks. */ + public PagedCallSettings.Builder + listLinksSettings() { + return getStubSettingsBuilder().listLinksSettings(); + } + + /** Returns the builder for the settings used for calls to getLink. */ + public UnaryCallSettings.Builder getLinkSettings() { + return getStubSettingsBuilder().getLinkSettings(); + } + + /** Returns the builder for the settings used for calls to listExclusions. */ + public PagedCallSettings.Builder< + ListExclusionsRequest, ListExclusionsResponse, ListExclusionsPagedResponse> + listExclusionsSettings() { + return getStubSettingsBuilder().listExclusionsSettings(); + } + + /** Returns the builder for the settings used for calls to getExclusion. */ + public UnaryCallSettings.Builder getExclusionSettings() { + return getStubSettingsBuilder().getExclusionSettings(); + } + + /** Returns the builder for the settings used for calls to createExclusion. */ + public UnaryCallSettings.Builder + createExclusionSettings() { + return getStubSettingsBuilder().createExclusionSettings(); + } + + /** Returns the builder for the settings used for calls to updateExclusion. */ + public UnaryCallSettings.Builder + updateExclusionSettings() { + return getStubSettingsBuilder().updateExclusionSettings(); + } + + /** Returns the builder for the settings used for calls to deleteExclusion. */ + public UnaryCallSettings.Builder deleteExclusionSettings() { + return getStubSettingsBuilder().deleteExclusionSettings(); + } + + /** Returns the builder for the settings used for calls to getCmekSettings. */ + public UnaryCallSettings.Builder + getCmekSettingsSettings() { + return getStubSettingsBuilder().getCmekSettingsSettings(); + } + + /** Returns the builder for the settings used for calls to updateCmekSettings. */ + public UnaryCallSettings.Builder + updateCmekSettingsSettings() { + return getStubSettingsBuilder().updateCmekSettingsSettings(); + } + + /** Returns the builder for the settings used for calls to getSettings. */ + public UnaryCallSettings.Builder getSettingsSettings() { + return getStubSettingsBuilder().getSettingsSettings(); + } + + /** Returns the builder for the settings used for calls to updateSettings. */ + public UnaryCallSettings.Builder updateSettingsSettings() { + return getStubSettingsBuilder().updateSettingsSettings(); + } + + /** Returns the builder for the settings used for calls to copyLogEntries. */ + public UnaryCallSettings.Builder copyLogEntriesSettings() { + return getStubSettingsBuilder().copyLogEntriesSettings(); + } + + /** Returns the builder for the settings used for calls to copyLogEntries. */ + public OperationCallSettings.Builder< + CopyLogEntriesRequest, CopyLogEntriesResponse, CopyLogEntriesMetadata> + copyLogEntriesOperationSettings() { + return getStubSettingsBuilder().copyLogEntriesOperationSettings(); + } + + @Override + public ConfigSettings build() throws IOException { + return new ConfigSettings(this); + } + } +} diff --git a/java-logging/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/LoggingClient.java b/java-logging/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/LoggingClient.java new file mode 100644 index 000000000000..d4e84c3b31f8 --- /dev/null +++ b/java-logging/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/LoggingClient.java @@ -0,0 +1,1536 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2; + +import com.google.api.MonitoredResource; +import com.google.api.MonitoredResourceDescriptor; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.logging.v2.stub.LoggingServiceV2Stub; +import com.google.cloud.logging.v2.stub.LoggingServiceV2StubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.logging.v2.BillingAccountName; +import com.google.logging.v2.DeleteLogRequest; +import com.google.logging.v2.FolderName; +import com.google.logging.v2.ListLogEntriesRequest; +import com.google.logging.v2.ListLogEntriesResponse; +import com.google.logging.v2.ListLogsRequest; +import com.google.logging.v2.ListLogsResponse; +import com.google.logging.v2.ListMonitoredResourceDescriptorsRequest; +import com.google.logging.v2.ListMonitoredResourceDescriptorsResponse; +import com.google.logging.v2.LogEntry; +import com.google.logging.v2.LogName; +import com.google.logging.v2.OrganizationName; +import com.google.logging.v2.ProjectName; +import com.google.logging.v2.TailLogEntriesRequest; +import com.google.logging.v2.TailLogEntriesResponse; +import com.google.logging.v2.WriteLogEntriesRequest; +import com.google.logging.v2.WriteLogEntriesResponse; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Service for ingesting and querying logs. + * + *

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
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (LoggingClient loggingClient = LoggingClient.create()) {
+ *   LogName logName = LogName.ofProjectLogName("[PROJECT]", "[LOG]");
+ *   loggingClient.deleteLog(logName);
+ * }
+ * }
+ * + *

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

DeleteLog

Deletes all the log entries in a log for the _Default Log Bucket. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted. Entries received after the delete operation with a timestamp before the operation will be deleted.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • deleteLog(DeleteLogRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • deleteLog(LogName logName) + *

  • deleteLog(String logName) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • deleteLogCallable() + *

+ *

WriteLogEntries

Writes log entries to Logging. This API method is the only way to send log entries to Logging. This method is used, directly or indirectly, by the Logging agent (fluentd) and all logging libraries configured to use Logging. A single request may contain log entries for a maximum of 1000 different resources (projects, organizations, billing accounts or folders)

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • writeLogEntries(WriteLogEntriesRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • writeLogEntries(LogName logName, MonitoredResource resource, Map<String, String> labels, List<LogEntry> entries) + *

  • writeLogEntries(String logName, MonitoredResource resource, Map<String, String> labels, List<LogEntry> entries) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • writeLogEntriesCallable() + *

+ *

ListLogEntries

Lists log entries. Use this method to retrieve log entries that originated from a project/folder/organization/billing account. For ways to export log entries, see [Exporting Logs](https://cloud.google.com/logging/docs/export).

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listLogEntries(ListLogEntriesRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • listLogEntries(List<String> resourceNames, String filter, String orderBy) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listLogEntriesPagedCallable() + *

  • listLogEntriesCallable() + *

+ *

ListMonitoredResourceDescriptors

Lists the descriptors for monitored resource types used by Logging.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listMonitoredResourceDescriptors(ListMonitoredResourceDescriptorsRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listMonitoredResourceDescriptorsPagedCallable() + *

  • listMonitoredResourceDescriptorsCallable() + *

+ *

ListLogs

Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listLogs(ListLogsRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • listLogs(BillingAccountName parent) + *

  • listLogs(FolderName parent) + *

  • listLogs(OrganizationName parent) + *

  • listLogs(ProjectName parent) + *

  • listLogs(String parent) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listLogsPagedCallable() + *

  • listLogsCallable() + *

+ *

TailLogEntries

Streaming read of log entries as they are ingested. Until the stream is terminated, it will continue reading logs.

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • tailLogEntriesCallable() + *

+ *
+ * + *

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 LoggingSettings to create(). + * For example: + * + *

To customize credentials: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * LoggingSettings loggingSettings =
+ *     LoggingSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * LoggingClient loggingClient = LoggingClient.create(loggingSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * LoggingSettings loggingSettings = LoggingSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * LoggingClient loggingClient = LoggingClient.create(loggingSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class LoggingClient implements BackgroundResource { + private final LoggingSettings settings; + private final LoggingServiceV2Stub stub; + + /** Constructs an instance of LoggingClient with default settings. */ + public static final LoggingClient create() throws IOException { + return create(LoggingSettings.newBuilder().build()); + } + + /** + * Constructs an instance of LoggingClient, 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 LoggingClient create(LoggingSettings settings) throws IOException { + return new LoggingClient(settings); + } + + /** + * Constructs an instance of LoggingClient, using the given stub for making calls. This is for + * advanced usage - prefer using create(LoggingSettings). + */ + public static final LoggingClient create(LoggingServiceV2Stub stub) { + return new LoggingClient(stub); + } + + /** + * Constructs an instance of LoggingClient, 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 LoggingClient(LoggingSettings settings) throws IOException { + this.settings = settings; + this.stub = ((LoggingServiceV2StubSettings) settings.getStubSettings()).createStub(); + } + + protected LoggingClient(LoggingServiceV2Stub stub) { + this.settings = null; + this.stub = stub; + } + + public final LoggingSettings getSettings() { + return settings; + } + + public LoggingServiceV2Stub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes all the log entries in a log for the _Default Log Bucket. The log reappears if it + * receives new entries. Log entries written shortly before the delete operation might not be + * deleted. Entries received after the delete operation with a timestamp before the operation will + * be deleted. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (LoggingClient loggingClient = LoggingClient.create()) {
+   *   LogName logName = LogName.ofProjectLogName("[PROJECT]", "[LOG]");
+   *   loggingClient.deleteLog(logName);
+   * }
+   * }
+ * + * @param logName Required. The resource name of the log to delete: + *
    + *
  • `projects/[PROJECT_ID]/logs/[LOG_ID]` + *
  • `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]` + *
  • `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]` + *
  • `folders/[FOLDER_ID]/logs/[LOG_ID]` + *
+ *

`[LOG_ID]` must be URL-encoded. For example, `"projects/my-project-id/logs/syslog"`, + * `"organizations/123/logs/cloudaudit.googleapis.com%2Factivity"`. + *

For more information about log names, see [LogEntry][google.logging.v2.LogEntry]. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteLog(LogName logName) { + DeleteLogRequest request = + DeleteLogRequest.newBuilder() + .setLogName(logName == null ? null : logName.toString()) + .build(); + deleteLog(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes all the log entries in a log for the _Default Log Bucket. The log reappears if it + * receives new entries. Log entries written shortly before the delete operation might not be + * deleted. Entries received after the delete operation with a timestamp before the operation will + * be deleted. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (LoggingClient loggingClient = LoggingClient.create()) {
+   *   String logName = LogName.ofProjectLogName("[PROJECT]", "[LOG]").toString();
+   *   loggingClient.deleteLog(logName);
+   * }
+   * }
+ * + * @param logName Required. The resource name of the log to delete: + *
    + *
  • `projects/[PROJECT_ID]/logs/[LOG_ID]` + *
  • `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]` + *
  • `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]` + *
  • `folders/[FOLDER_ID]/logs/[LOG_ID]` + *
+ *

`[LOG_ID]` must be URL-encoded. For example, `"projects/my-project-id/logs/syslog"`, + * `"organizations/123/logs/cloudaudit.googleapis.com%2Factivity"`. + *

For more information about log names, see [LogEntry][google.logging.v2.LogEntry]. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteLog(String logName) { + DeleteLogRequest request = DeleteLogRequest.newBuilder().setLogName(logName).build(); + deleteLog(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes all the log entries in a log for the _Default Log Bucket. The log reappears if it + * receives new entries. Log entries written shortly before the delete operation might not be + * deleted. Entries received after the delete operation with a timestamp before the operation will + * be deleted. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (LoggingClient loggingClient = LoggingClient.create()) {
+   *   DeleteLogRequest request =
+   *       DeleteLogRequest.newBuilder()
+   *           .setLogName(LogName.ofProjectLogName("[PROJECT]", "[LOG]").toString())
+   *           .build();
+   *   loggingClient.deleteLog(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteLog(DeleteLogRequest request) { + deleteLogCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes all the log entries in a log for the _Default Log Bucket. The log reappears if it + * receives new entries. Log entries written shortly before the delete operation might not be + * deleted. Entries received after the delete operation with a timestamp before the operation will + * be deleted. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (LoggingClient loggingClient = LoggingClient.create()) {
+   *   DeleteLogRequest request =
+   *       DeleteLogRequest.newBuilder()
+   *           .setLogName(LogName.ofProjectLogName("[PROJECT]", "[LOG]").toString())
+   *           .build();
+   *   ApiFuture future = loggingClient.deleteLogCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteLogCallable() { + return stub.deleteLogCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Writes log entries to Logging. This API method is the only way to send log entries to Logging. + * This method is used, directly or indirectly, by the Logging agent (fluentd) and all logging + * libraries configured to use Logging. A single request may contain log entries for a maximum of + * 1000 different resources (projects, organizations, billing accounts or folders) + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (LoggingClient loggingClient = LoggingClient.create()) {
+   *   LogName logName = LogName.ofProjectLogName("[PROJECT]", "[LOG]");
+   *   MonitoredResource resource = MonitoredResource.newBuilder().build();
+   *   Map labels = new HashMap<>();
+   *   List entries = new ArrayList<>();
+   *   WriteLogEntriesResponse response =
+   *       loggingClient.writeLogEntries(logName, resource, labels, entries);
+   * }
+   * }
+ * + * @param logName Optional. A default log resource name that is assigned to all log entries in + * `entries` that do not specify a value for `log_name`: + *
    + *
  • `projects/[PROJECT_ID]/logs/[LOG_ID]` + *
  • `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]` + *
  • `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]` + *
  • `folders/[FOLDER_ID]/logs/[LOG_ID]` + *
+ *

`[LOG_ID]` must be URL-encoded. For example: + *

"projects/my-project-id/logs/syslog" + * "organizations/123/logs/cloudaudit.googleapis.com%2Factivity" + *

The permission `logging.logEntries.create` is needed on each project, organization, + * billing account, or folder that is receiving new log entries, whether the resource is + * specified in `logName` or in an individual log entry. + * @param resource Optional. A default monitored resource object that is assigned to all log + * entries in `entries` that do not specify a value for `resource`. Example: + *

{ "type": "gce_instance", "labels": { "zone": "us-central1-a", "instance_id": + * "00000000000000000000" }} + *

See [LogEntry][google.logging.v2.LogEntry]. + * @param labels Optional. Default labels that are added to the `labels` field of all log entries + * in `entries`. If a log entry already has a label with the same key as a label in this + * parameter, then the log entry's label is not changed. See + * [LogEntry][google.logging.v2.LogEntry]. + * @param entries Required. The log entries to send to Logging. The order of log entries in this + * list does not matter. Values supplied in this method's `log_name`, `resource`, and `labels` + * fields are copied into those log entries in this list that do not include values for their + * corresponding fields. For more information, see the [LogEntry][google.logging.v2.LogEntry] + * type. + *

If the `timestamp` or `insert_id` fields are missing in log entries, then this method + * supplies the current time or a unique identifier, respectively. The supplied values are + * chosen so that, among the log entries that did not supply their own values, the entries + * earlier in the list will sort before the entries later in the list. See the `entries.list` + * method. + *

Log entries with timestamps that are more than the [logs retention + * period](https://cloud.google.com/logging/quotas) in the past or more than 24 hours in the + * future will not be available when calling `entries.list`. However, those log entries can + * still be [exported with + * LogSinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs). + *

To improve throughput and to avoid exceeding the [quota + * limit](https://cloud.google.com/logging/quotas) for calls to `entries.write`, you should + * try to include several log entries in this list, rather than calling this method for each + * individual log entry. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final WriteLogEntriesResponse writeLogEntries( + LogName logName, + MonitoredResource resource, + Map labels, + List entries) { + WriteLogEntriesRequest request = + WriteLogEntriesRequest.newBuilder() + .setLogName(logName == null ? null : logName.toString()) + .setResource(resource) + .putAllLabels(labels) + .addAllEntries(entries) + .build(); + return writeLogEntries(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Writes log entries to Logging. This API method is the only way to send log entries to Logging. + * This method is used, directly or indirectly, by the Logging agent (fluentd) and all logging + * libraries configured to use Logging. A single request may contain log entries for a maximum of + * 1000 different resources (projects, organizations, billing accounts or folders) + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (LoggingClient loggingClient = LoggingClient.create()) {
+   *   String logName = LogName.ofProjectLogName("[PROJECT]", "[LOG]").toString();
+   *   MonitoredResource resource = MonitoredResource.newBuilder().build();
+   *   Map labels = new HashMap<>();
+   *   List entries = new ArrayList<>();
+   *   WriteLogEntriesResponse response =
+   *       loggingClient.writeLogEntries(logName, resource, labels, entries);
+   * }
+   * }
+ * + * @param logName Optional. A default log resource name that is assigned to all log entries in + * `entries` that do not specify a value for `log_name`: + *
    + *
  • `projects/[PROJECT_ID]/logs/[LOG_ID]` + *
  • `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]` + *
  • `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]` + *
  • `folders/[FOLDER_ID]/logs/[LOG_ID]` + *
+ *

`[LOG_ID]` must be URL-encoded. For example: + *

"projects/my-project-id/logs/syslog" + * "organizations/123/logs/cloudaudit.googleapis.com%2Factivity" + *

The permission `logging.logEntries.create` is needed on each project, organization, + * billing account, or folder that is receiving new log entries, whether the resource is + * specified in `logName` or in an individual log entry. + * @param resource Optional. A default monitored resource object that is assigned to all log + * entries in `entries` that do not specify a value for `resource`. Example: + *

{ "type": "gce_instance", "labels": { "zone": "us-central1-a", "instance_id": + * "00000000000000000000" }} + *

See [LogEntry][google.logging.v2.LogEntry]. + * @param labels Optional. Default labels that are added to the `labels` field of all log entries + * in `entries`. If a log entry already has a label with the same key as a label in this + * parameter, then the log entry's label is not changed. See + * [LogEntry][google.logging.v2.LogEntry]. + * @param entries Required. The log entries to send to Logging. The order of log entries in this + * list does not matter. Values supplied in this method's `log_name`, `resource`, and `labels` + * fields are copied into those log entries in this list that do not include values for their + * corresponding fields. For more information, see the [LogEntry][google.logging.v2.LogEntry] + * type. + *

If the `timestamp` or `insert_id` fields are missing in log entries, then this method + * supplies the current time or a unique identifier, respectively. The supplied values are + * chosen so that, among the log entries that did not supply their own values, the entries + * earlier in the list will sort before the entries later in the list. See the `entries.list` + * method. + *

Log entries with timestamps that are more than the [logs retention + * period](https://cloud.google.com/logging/quotas) in the past or more than 24 hours in the + * future will not be available when calling `entries.list`. However, those log entries can + * still be [exported with + * LogSinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs). + *

To improve throughput and to avoid exceeding the [quota + * limit](https://cloud.google.com/logging/quotas) for calls to `entries.write`, you should + * try to include several log entries in this list, rather than calling this method for each + * individual log entry. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final WriteLogEntriesResponse writeLogEntries( + String logName, + MonitoredResource resource, + Map labels, + List entries) { + WriteLogEntriesRequest request = + WriteLogEntriesRequest.newBuilder() + .setLogName(logName) + .setResource(resource) + .putAllLabels(labels) + .addAllEntries(entries) + .build(); + return writeLogEntries(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Writes log entries to Logging. This API method is the only way to send log entries to Logging. + * This method is used, directly or indirectly, by the Logging agent (fluentd) and all logging + * libraries configured to use Logging. A single request may contain log entries for a maximum of + * 1000 different resources (projects, organizations, billing accounts or folders) + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (LoggingClient loggingClient = LoggingClient.create()) {
+   *   WriteLogEntriesRequest request =
+   *       WriteLogEntriesRequest.newBuilder()
+   *           .setLogName(LogName.ofProjectLogName("[PROJECT]", "[LOG]").toString())
+   *           .setResource(MonitoredResource.newBuilder().build())
+   *           .putAllLabels(new HashMap())
+   *           .addAllEntries(new ArrayList())
+   *           .setPartialSuccess(true)
+   *           .setDryRun(true)
+   *           .build();
+   *   WriteLogEntriesResponse response = loggingClient.writeLogEntries(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 WriteLogEntriesResponse writeLogEntries(WriteLogEntriesRequest request) { + return writeLogEntriesCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Writes log entries to Logging. This API method is the only way to send log entries to Logging. + * This method is used, directly or indirectly, by the Logging agent (fluentd) and all logging + * libraries configured to use Logging. A single request may contain log entries for a maximum of + * 1000 different resources (projects, organizations, billing accounts or folders) + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (LoggingClient loggingClient = LoggingClient.create()) {
+   *   WriteLogEntriesRequest request =
+   *       WriteLogEntriesRequest.newBuilder()
+   *           .setLogName(LogName.ofProjectLogName("[PROJECT]", "[LOG]").toString())
+   *           .setResource(MonitoredResource.newBuilder().build())
+   *           .putAllLabels(new HashMap())
+   *           .addAllEntries(new ArrayList())
+   *           .setPartialSuccess(true)
+   *           .setDryRun(true)
+   *           .build();
+   *   ApiFuture future =
+   *       loggingClient.writeLogEntriesCallable().futureCall(request);
+   *   // Do something.
+   *   WriteLogEntriesResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + writeLogEntriesCallable() { + return stub.writeLogEntriesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists log entries. Use this method to retrieve log entries that originated from a + * project/folder/organization/billing account. For ways to export log entries, see [Exporting + * Logs](https://cloud.google.com/logging/docs/export). + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (LoggingClient loggingClient = LoggingClient.create()) {
+   *   List resourceNames = new ArrayList<>();
+   *   String filter = "filter-1274492040";
+   *   String orderBy = "orderBy-1207110587";
+   *   for (LogEntry element :
+   *       loggingClient.listLogEntries(resourceNames, filter, orderBy).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param resourceNames Required. Names of one or more parent resources from which to retrieve log + * entries: + *
    + *
  • `projects/[PROJECT_ID]` + *
  • `organizations/[ORGANIZATION_ID]` + *
  • `billingAccounts/[BILLING_ACCOUNT_ID]` + *
  • `folders/[FOLDER_ID]` + *
+ *

May alternatively be one or more views: + *

* + * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` * + * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * + * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + * * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + *

Projects listed in the `project_ids` field are added to this list. A maximum of 100 + * resources may be specified in a single request. + * @param filter Optional. Only log entries that match the filter are returned. An empty filter + * matches all log entries in the resources listed in `resource_names`. Referencing a parent + * resource that is not listed in `resource_names` will cause the filter to return no results. + * The maximum length of a filter is 20,000 characters. + * @param orderBy Optional. How the results should be sorted. Presently, the only permitted values + * are `"timestamp asc"` (default) and `"timestamp desc"`. The first option returns entries in + * order of increasing values of `LogEntry.timestamp` (oldest first), and the second option + * returns entries in order of decreasing timestamps (newest first). Entries with equal + * timestamps are returned in order of their `insert_id` values. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListLogEntriesPagedResponse listLogEntries( + List resourceNames, String filter, String orderBy) { + ListLogEntriesRequest request = + ListLogEntriesRequest.newBuilder() + .addAllResourceNames(resourceNames) + .setFilter(filter) + .setOrderBy(orderBy) + .build(); + return listLogEntries(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists log entries. Use this method to retrieve log entries that originated from a + * project/folder/organization/billing account. For ways to export log entries, see [Exporting + * Logs](https://cloud.google.com/logging/docs/export). + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (LoggingClient loggingClient = LoggingClient.create()) {
+   *   ListLogEntriesRequest request =
+   *       ListLogEntriesRequest.newBuilder()
+   *           .addAllResourceNames(new ArrayList())
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (LogEntry element : loggingClient.listLogEntries(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListLogEntriesPagedResponse listLogEntries(ListLogEntriesRequest request) { + return listLogEntriesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists log entries. Use this method to retrieve log entries that originated from a + * project/folder/organization/billing account. For ways to export log entries, see [Exporting + * Logs](https://cloud.google.com/logging/docs/export). + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (LoggingClient loggingClient = LoggingClient.create()) {
+   *   ListLogEntriesRequest request =
+   *       ListLogEntriesRequest.newBuilder()
+   *           .addAllResourceNames(new ArrayList())
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future = loggingClient.listLogEntriesPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (LogEntry element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listLogEntriesPagedCallable() { + return stub.listLogEntriesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists log entries. Use this method to retrieve log entries that originated from a + * project/folder/organization/billing account. For ways to export log entries, see [Exporting + * Logs](https://cloud.google.com/logging/docs/export). + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (LoggingClient loggingClient = LoggingClient.create()) {
+   *   ListLogEntriesRequest request =
+   *       ListLogEntriesRequest.newBuilder()
+   *           .addAllResourceNames(new ArrayList())
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListLogEntriesResponse response = loggingClient.listLogEntriesCallable().call(request);
+   *     for (LogEntry element : response.getEntriesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listLogEntriesCallable() { + return stub.listLogEntriesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the descriptors for monitored resource types used by Logging. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (LoggingClient loggingClient = LoggingClient.create()) {
+   *   ListMonitoredResourceDescriptorsRequest request =
+   *       ListMonitoredResourceDescriptorsRequest.newBuilder()
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (MonitoredResourceDescriptor element :
+   *       loggingClient.listMonitoredResourceDescriptors(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListMonitoredResourceDescriptorsPagedResponse listMonitoredResourceDescriptors( + ListMonitoredResourceDescriptorsRequest request) { + return listMonitoredResourceDescriptorsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the descriptors for monitored resource types used by Logging. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (LoggingClient loggingClient = LoggingClient.create()) {
+   *   ListMonitoredResourceDescriptorsRequest request =
+   *       ListMonitoredResourceDescriptorsRequest.newBuilder()
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       loggingClient.listMonitoredResourceDescriptorsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (MonitoredResourceDescriptor element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable< + ListMonitoredResourceDescriptorsRequest, ListMonitoredResourceDescriptorsPagedResponse> + listMonitoredResourceDescriptorsPagedCallable() { + return stub.listMonitoredResourceDescriptorsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the descriptors for monitored resource types used by Logging. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (LoggingClient loggingClient = LoggingClient.create()) {
+   *   ListMonitoredResourceDescriptorsRequest request =
+   *       ListMonitoredResourceDescriptorsRequest.newBuilder()
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListMonitoredResourceDescriptorsResponse response =
+   *         loggingClient.listMonitoredResourceDescriptorsCallable().call(request);
+   *     for (MonitoredResourceDescriptor element : response.getResourceDescriptorsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable< + ListMonitoredResourceDescriptorsRequest, ListMonitoredResourceDescriptorsResponse> + listMonitoredResourceDescriptorsCallable() { + return stub.listMonitoredResourceDescriptorsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have + * entries are listed. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (LoggingClient loggingClient = LoggingClient.create()) {
+   *   BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]");
+   *   for (String element : loggingClient.listLogs(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The resource name to list logs for: + *
    + *
  • `projects/[PROJECT_ID]` + *
  • `organizations/[ORGANIZATION_ID]` + *
  • `billingAccounts/[BILLING_ACCOUNT_ID]` + *
  • `folders/[FOLDER_ID]` + *
+ * + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListLogsPagedResponse listLogs(BillingAccountName parent) { + ListLogsRequest request = + ListLogsRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + return listLogs(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have + * entries are listed. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (LoggingClient loggingClient = LoggingClient.create()) {
+   *   FolderName parent = FolderName.of("[FOLDER]");
+   *   for (String element : loggingClient.listLogs(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The resource name to list logs for: + *
    + *
  • `projects/[PROJECT_ID]` + *
  • `organizations/[ORGANIZATION_ID]` + *
  • `billingAccounts/[BILLING_ACCOUNT_ID]` + *
  • `folders/[FOLDER_ID]` + *
+ * + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListLogsPagedResponse listLogs(FolderName parent) { + ListLogsRequest request = + ListLogsRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + return listLogs(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have + * entries are listed. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (LoggingClient loggingClient = LoggingClient.create()) {
+   *   OrganizationName parent = OrganizationName.of("[ORGANIZATION]");
+   *   for (String element : loggingClient.listLogs(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The resource name to list logs for: + *
    + *
  • `projects/[PROJECT_ID]` + *
  • `organizations/[ORGANIZATION_ID]` + *
  • `billingAccounts/[BILLING_ACCOUNT_ID]` + *
  • `folders/[FOLDER_ID]` + *
+ * + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListLogsPagedResponse listLogs(OrganizationName parent) { + ListLogsRequest request = + ListLogsRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + return listLogs(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have + * entries are listed. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (LoggingClient loggingClient = LoggingClient.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   for (String element : loggingClient.listLogs(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The resource name to list logs for: + *
    + *
  • `projects/[PROJECT_ID]` + *
  • `organizations/[ORGANIZATION_ID]` + *
  • `billingAccounts/[BILLING_ACCOUNT_ID]` + *
  • `folders/[FOLDER_ID]` + *
+ * + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListLogsPagedResponse listLogs(ProjectName parent) { + ListLogsRequest request = + ListLogsRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + return listLogs(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have + * entries are listed. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (LoggingClient loggingClient = LoggingClient.create()) {
+   *   String parent = ProjectName.of("[PROJECT]").toString();
+   *   for (String element : loggingClient.listLogs(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The resource name to list logs for: + *
    + *
  • `projects/[PROJECT_ID]` + *
  • `organizations/[ORGANIZATION_ID]` + *
  • `billingAccounts/[BILLING_ACCOUNT_ID]` + *
  • `folders/[FOLDER_ID]` + *
+ * + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListLogsPagedResponse listLogs(String parent) { + ListLogsRequest request = ListLogsRequest.newBuilder().setParent(parent).build(); + return listLogs(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have + * entries are listed. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (LoggingClient loggingClient = LoggingClient.create()) {
+   *   ListLogsRequest request =
+   *       ListLogsRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .addAllResourceNames(new ArrayList())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (String element : loggingClient.listLogs(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListLogsPagedResponse listLogs(ListLogsRequest request) { + return listLogsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have + * entries are listed. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (LoggingClient loggingClient = LoggingClient.create()) {
+   *   ListLogsRequest request =
+   *       ListLogsRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .addAllResourceNames(new ArrayList())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future = loggingClient.listLogsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (String element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listLogsPagedCallable() { + return stub.listLogsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have + * entries are listed. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (LoggingClient loggingClient = LoggingClient.create()) {
+   *   ListLogsRequest request =
+   *       ListLogsRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .addAllResourceNames(new ArrayList())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListLogsResponse response = loggingClient.listLogsCallable().call(request);
+   *     for (String element : response.getLogNamesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listLogsCallable() { + return stub.listLogsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Streaming read of log entries as they are ingested. Until the stream is terminated, it will + * continue reading logs. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (LoggingClient loggingClient = LoggingClient.create()) {
+   *   BidiStream bidiStream =
+   *       loggingClient.tailLogEntriesCallable().call();
+   *   TailLogEntriesRequest request =
+   *       TailLogEntriesRequest.newBuilder()
+   *           .addAllResourceNames(new ArrayList())
+   *           .setFilter("filter-1274492040")
+   *           .setBufferWindow(Duration.newBuilder().build())
+   *           .build();
+   *   bidiStream.send(request);
+   *   for (TailLogEntriesResponse response : bidiStream) {
+   *     // Do something when a response is received.
+   *   }
+   * }
+   * }
+ */ + public final BidiStreamingCallable + tailLogEntriesCallable() { + return stub.tailLogEntriesCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListLogEntriesPagedResponse + extends AbstractPagedListResponse< + ListLogEntriesRequest, + ListLogEntriesResponse, + LogEntry, + ListLogEntriesPage, + ListLogEntriesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLogEntriesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListLogEntriesPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListLogEntriesPagedResponse(ListLogEntriesPage page) { + super(page, ListLogEntriesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLogEntriesPage + extends AbstractPage< + ListLogEntriesRequest, ListLogEntriesResponse, LogEntry, ListLogEntriesPage> { + + private ListLogEntriesPage( + PageContext context, + ListLogEntriesResponse response) { + super(context, response); + } + + private static ListLogEntriesPage createEmptyPage() { + return new ListLogEntriesPage(null, null); + } + + @Override + protected ListLogEntriesPage createPage( + PageContext context, + ListLogEntriesResponse response) { + return new ListLogEntriesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLogEntriesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLogEntriesRequest, + ListLogEntriesResponse, + LogEntry, + ListLogEntriesPage, + ListLogEntriesFixedSizeCollection> { + + private ListLogEntriesFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLogEntriesFixedSizeCollection createEmptyCollection() { + return new ListLogEntriesFixedSizeCollection(null, 0); + } + + @Override + protected ListLogEntriesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLogEntriesFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListMonitoredResourceDescriptorsPagedResponse + extends AbstractPagedListResponse< + ListMonitoredResourceDescriptorsRequest, + ListMonitoredResourceDescriptorsResponse, + MonitoredResourceDescriptor, + ListMonitoredResourceDescriptorsPage, + ListMonitoredResourceDescriptorsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext< + ListMonitoredResourceDescriptorsRequest, + ListMonitoredResourceDescriptorsResponse, + MonitoredResourceDescriptor> + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListMonitoredResourceDescriptorsPage.createEmptyPage() + .createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListMonitoredResourceDescriptorsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListMonitoredResourceDescriptorsPagedResponse( + ListMonitoredResourceDescriptorsPage page) { + super(page, ListMonitoredResourceDescriptorsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListMonitoredResourceDescriptorsPage + extends AbstractPage< + ListMonitoredResourceDescriptorsRequest, + ListMonitoredResourceDescriptorsResponse, + MonitoredResourceDescriptor, + ListMonitoredResourceDescriptorsPage> { + + private ListMonitoredResourceDescriptorsPage( + PageContext< + ListMonitoredResourceDescriptorsRequest, + ListMonitoredResourceDescriptorsResponse, + MonitoredResourceDescriptor> + context, + ListMonitoredResourceDescriptorsResponse response) { + super(context, response); + } + + private static ListMonitoredResourceDescriptorsPage createEmptyPage() { + return new ListMonitoredResourceDescriptorsPage(null, null); + } + + @Override + protected ListMonitoredResourceDescriptorsPage createPage( + PageContext< + ListMonitoredResourceDescriptorsRequest, + ListMonitoredResourceDescriptorsResponse, + MonitoredResourceDescriptor> + context, + ListMonitoredResourceDescriptorsResponse response) { + return new ListMonitoredResourceDescriptorsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext< + ListMonitoredResourceDescriptorsRequest, + ListMonitoredResourceDescriptorsResponse, + MonitoredResourceDescriptor> + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListMonitoredResourceDescriptorsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListMonitoredResourceDescriptorsRequest, + ListMonitoredResourceDescriptorsResponse, + MonitoredResourceDescriptor, + ListMonitoredResourceDescriptorsPage, + ListMonitoredResourceDescriptorsFixedSizeCollection> { + + private ListMonitoredResourceDescriptorsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListMonitoredResourceDescriptorsFixedSizeCollection createEmptyCollection() { + return new ListMonitoredResourceDescriptorsFixedSizeCollection(null, 0); + } + + @Override + protected ListMonitoredResourceDescriptorsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListMonitoredResourceDescriptorsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListLogsPagedResponse + extends AbstractPagedListResponse< + ListLogsRequest, ListLogsResponse, String, ListLogsPage, ListLogsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLogsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, input -> new ListLogsPagedResponse(input), MoreExecutors.directExecutor()); + } + + private ListLogsPagedResponse(ListLogsPage page) { + super(page, ListLogsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLogsPage + extends AbstractPage { + + private ListLogsPage( + PageContext context, ListLogsResponse response) { + super(context, response); + } + + private static ListLogsPage createEmptyPage() { + return new ListLogsPage(null, null); + } + + @Override + protected ListLogsPage createPage( + PageContext context, ListLogsResponse response) { + return new ListLogsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLogsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLogsRequest, ListLogsResponse, String, ListLogsPage, ListLogsFixedSizeCollection> { + + private ListLogsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLogsFixedSizeCollection createEmptyCollection() { + return new ListLogsFixedSizeCollection(null, 0); + } + + @Override + protected ListLogsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLogsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-logging/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/LoggingSettings.java b/java-logging/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/LoggingSettings.java new file mode 100644 index 000000000000..688bc32697a4 --- /dev/null +++ b/java-logging/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/LoggingSettings.java @@ -0,0 +1,283 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2; + +import static com.google.cloud.logging.v2.LoggingClient.ListLogEntriesPagedResponse; +import static com.google.cloud.logging.v2.LoggingClient.ListLogsPagedResponse; +import static com.google.cloud.logging.v2.LoggingClient.ListMonitoredResourceDescriptorsPagedResponse; + +import com.google.api.core.ApiFunction; +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.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.logging.v2.stub.LoggingServiceV2StubSettings; +import com.google.logging.v2.DeleteLogRequest; +import com.google.logging.v2.ListLogEntriesRequest; +import com.google.logging.v2.ListLogEntriesResponse; +import com.google.logging.v2.ListLogsRequest; +import com.google.logging.v2.ListLogsResponse; +import com.google.logging.v2.ListMonitoredResourceDescriptorsRequest; +import com.google.logging.v2.ListMonitoredResourceDescriptorsResponse; +import com.google.logging.v2.TailLogEntriesRequest; +import com.google.logging.v2.TailLogEntriesResponse; +import com.google.logging.v2.WriteLogEntriesRequest; +import com.google.logging.v2.WriteLogEntriesResponse; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link LoggingClient}. + * + *

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

    + *
  • The default service address (logging.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 + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of deleteLog: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * LoggingSettings.Builder loggingSettingsBuilder = LoggingSettings.newBuilder();
+ * loggingSettingsBuilder
+ *     .deleteLogSettings()
+ *     .setRetrySettings(
+ *         loggingSettingsBuilder
+ *             .deleteLogSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeoutDuration(Duration.ofSeconds(300))
+ *             .build());
+ * LoggingSettings loggingSettings = loggingSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. + */ +@Generated("by gapic-generator-java") +public class LoggingSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to deleteLog. */ + public UnaryCallSettings deleteLogSettings() { + return ((LoggingServiceV2StubSettings) getStubSettings()).deleteLogSettings(); + } + + /** Returns the object with the settings used for calls to writeLogEntries. */ + public BatchingCallSettings + writeLogEntriesSettings() { + return ((LoggingServiceV2StubSettings) getStubSettings()).writeLogEntriesSettings(); + } + + /** Returns the object with the settings used for calls to listLogEntries. */ + public PagedCallSettings< + ListLogEntriesRequest, ListLogEntriesResponse, ListLogEntriesPagedResponse> + listLogEntriesSettings() { + return ((LoggingServiceV2StubSettings) getStubSettings()).listLogEntriesSettings(); + } + + /** Returns the object with the settings used for calls to listMonitoredResourceDescriptors. */ + public PagedCallSettings< + ListMonitoredResourceDescriptorsRequest, + ListMonitoredResourceDescriptorsResponse, + ListMonitoredResourceDescriptorsPagedResponse> + listMonitoredResourceDescriptorsSettings() { + return ((LoggingServiceV2StubSettings) getStubSettings()) + .listMonitoredResourceDescriptorsSettings(); + } + + /** Returns the object with the settings used for calls to listLogs. */ + public PagedCallSettings + listLogsSettings() { + return ((LoggingServiceV2StubSettings) getStubSettings()).listLogsSettings(); + } + + /** Returns the object with the settings used for calls to tailLogEntries. */ + public StreamingCallSettings + tailLogEntriesSettings() { + return ((LoggingServiceV2StubSettings) getStubSettings()).tailLogEntriesSettings(); + } + + public static final LoggingSettings create(LoggingServiceV2StubSettings stub) throws IOException { + return new LoggingSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return LoggingServiceV2StubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return LoggingServiceV2StubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return LoggingServiceV2StubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return LoggingServiceV2StubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return LoggingServiceV2StubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return LoggingServiceV2StubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return LoggingServiceV2StubSettings.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 LoggingSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for LoggingSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(LoggingServiceV2StubSettings.newBuilder(clientContext)); + } + + protected Builder(LoggingSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(LoggingServiceV2StubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(LoggingServiceV2StubSettings.newBuilder()); + } + + public LoggingServiceV2StubSettings.Builder getStubSettingsBuilder() { + return ((LoggingServiceV2StubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to deleteLog. */ + public UnaryCallSettings.Builder deleteLogSettings() { + return getStubSettingsBuilder().deleteLogSettings(); + } + + /** Returns the builder for the settings used for calls to writeLogEntries. */ + public BatchingCallSettings.Builder + writeLogEntriesSettings() { + return getStubSettingsBuilder().writeLogEntriesSettings(); + } + + /** Returns the builder for the settings used for calls to listLogEntries. */ + public PagedCallSettings.Builder< + ListLogEntriesRequest, ListLogEntriesResponse, ListLogEntriesPagedResponse> + listLogEntriesSettings() { + return getStubSettingsBuilder().listLogEntriesSettings(); + } + + /** Returns the builder for the settings used for calls to listMonitoredResourceDescriptors. */ + public PagedCallSettings.Builder< + ListMonitoredResourceDescriptorsRequest, + ListMonitoredResourceDescriptorsResponse, + ListMonitoredResourceDescriptorsPagedResponse> + listMonitoredResourceDescriptorsSettings() { + return getStubSettingsBuilder().listMonitoredResourceDescriptorsSettings(); + } + + /** Returns the builder for the settings used for calls to listLogs. */ + public PagedCallSettings.Builder + listLogsSettings() { + return getStubSettingsBuilder().listLogsSettings(); + } + + /** Returns the builder for the settings used for calls to tailLogEntries. */ + public StreamingCallSettings.Builder + tailLogEntriesSettings() { + return getStubSettingsBuilder().tailLogEntriesSettings(); + } + + @Override + public LoggingSettings build() throws IOException { + return new LoggingSettings(this); + } + } +} diff --git a/java-logging/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/MetricsClient.java b/java-logging/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/MetricsClient.java new file mode 100644 index 000000000000..cbeed2501ec6 --- /dev/null +++ b/java-logging/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/MetricsClient.java @@ -0,0 +1,1003 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.logging.v2.stub.MetricsServiceV2Stub; +import com.google.cloud.logging.v2.stub.MetricsServiceV2StubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.logging.v2.CreateLogMetricRequest; +import com.google.logging.v2.DeleteLogMetricRequest; +import com.google.logging.v2.GetLogMetricRequest; +import com.google.logging.v2.ListLogMetricsRequest; +import com.google.logging.v2.ListLogMetricsResponse; +import com.google.logging.v2.LogMetric; +import com.google.logging.v2.LogMetricName; +import com.google.logging.v2.ProjectName; +import com.google.logging.v2.UpdateLogMetricRequest; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Service for configuring logs-based metrics. + * + *

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
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (MetricsClient metricsClient = MetricsClient.create()) {
+ *   LogMetricName metricName = LogMetricName.of("[PROJECT]", "[METRIC]");
+ *   LogMetric response = metricsClient.getLogMetric(metricName);
+ * }
+ * }
+ * + *

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

ListLogMetrics

Lists logs-based metrics.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listLogMetrics(ListLogMetricsRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • listLogMetrics(ProjectName parent) + *

  • listLogMetrics(String parent) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listLogMetricsPagedCallable() + *

  • listLogMetricsCallable() + *

+ *

GetLogMetric

Gets a logs-based metric.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getLogMetric(GetLogMetricRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • getLogMetric(LogMetricName metricName) + *

  • getLogMetric(String metricName) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getLogMetricCallable() + *

+ *

CreateLogMetric

Creates a logs-based metric.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • createLogMetric(CreateLogMetricRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • createLogMetric(ProjectName parent, LogMetric metric) + *

  • createLogMetric(String parent, LogMetric metric) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • createLogMetricCallable() + *

+ *

UpdateLogMetric

Creates or updates a logs-based metric.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • updateLogMetric(UpdateLogMetricRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • updateLogMetric(LogMetricName metricName, LogMetric metric) + *

  • updateLogMetric(String metricName, LogMetric metric) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • updateLogMetricCallable() + *

+ *

DeleteLogMetric

Deletes a logs-based metric.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • deleteLogMetric(DeleteLogMetricRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • deleteLogMetric(LogMetricName metricName) + *

  • deleteLogMetric(String metricName) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • deleteLogMetricCallable() + *

+ *
+ * + *

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 MetricsSettings to create(). + * For example: + * + *

To customize credentials: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * MetricsSettings metricsSettings =
+ *     MetricsSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * MetricsClient metricsClient = MetricsClient.create(metricsSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * MetricsSettings metricsSettings = MetricsSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * MetricsClient metricsClient = MetricsClient.create(metricsSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class MetricsClient implements BackgroundResource { + private final MetricsSettings settings; + private final MetricsServiceV2Stub stub; + + /** Constructs an instance of MetricsClient with default settings. */ + public static final MetricsClient create() throws IOException { + return create(MetricsSettings.newBuilder().build()); + } + + /** + * Constructs an instance of MetricsClient, 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 MetricsClient create(MetricsSettings settings) throws IOException { + return new MetricsClient(settings); + } + + /** + * Constructs an instance of MetricsClient, using the given stub for making calls. This is for + * advanced usage - prefer using create(MetricsSettings). + */ + public static final MetricsClient create(MetricsServiceV2Stub stub) { + return new MetricsClient(stub); + } + + /** + * Constructs an instance of MetricsClient, 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 MetricsClient(MetricsSettings settings) throws IOException { + this.settings = settings; + this.stub = ((MetricsServiceV2StubSettings) settings.getStubSettings()).createStub(); + } + + protected MetricsClient(MetricsServiceV2Stub stub) { + this.settings = null; + this.stub = stub; + } + + public final MetricsSettings getSettings() { + return settings; + } + + public MetricsServiceV2Stub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists logs-based metrics. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MetricsClient metricsClient = MetricsClient.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   for (LogMetric element : metricsClient.listLogMetrics(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The name of the project containing the metrics: + *

"projects/[PROJECT_ID]" + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListLogMetricsPagedResponse listLogMetrics(ProjectName parent) { + ListLogMetricsRequest request = + ListLogMetricsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listLogMetrics(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists logs-based metrics. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MetricsClient metricsClient = MetricsClient.create()) {
+   *   String parent = ProjectName.of("[PROJECT]").toString();
+   *   for (LogMetric element : metricsClient.listLogMetrics(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The name of the project containing the metrics: + *

"projects/[PROJECT_ID]" + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListLogMetricsPagedResponse listLogMetrics(String parent) { + ListLogMetricsRequest request = ListLogMetricsRequest.newBuilder().setParent(parent).build(); + return listLogMetrics(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists logs-based metrics. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MetricsClient metricsClient = MetricsClient.create()) {
+   *   ListLogMetricsRequest request =
+   *       ListLogMetricsRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .setPageToken("pageToken873572522")
+   *           .setPageSize(883849137)
+   *           .build();
+   *   for (LogMetric element : metricsClient.listLogMetrics(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListLogMetricsPagedResponse listLogMetrics(ListLogMetricsRequest request) { + return listLogMetricsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists logs-based metrics. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MetricsClient metricsClient = MetricsClient.create()) {
+   *   ListLogMetricsRequest request =
+   *       ListLogMetricsRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .setPageToken("pageToken873572522")
+   *           .setPageSize(883849137)
+   *           .build();
+   *   ApiFuture future = metricsClient.listLogMetricsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (LogMetric element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listLogMetricsPagedCallable() { + return stub.listLogMetricsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists logs-based metrics. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MetricsClient metricsClient = MetricsClient.create()) {
+   *   ListLogMetricsRequest request =
+   *       ListLogMetricsRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .setPageToken("pageToken873572522")
+   *           .setPageSize(883849137)
+   *           .build();
+   *   while (true) {
+   *     ListLogMetricsResponse response = metricsClient.listLogMetricsCallable().call(request);
+   *     for (LogMetric element : response.getMetricsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listLogMetricsCallable() { + return stub.listLogMetricsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a logs-based metric. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MetricsClient metricsClient = MetricsClient.create()) {
+   *   LogMetricName metricName = LogMetricName.of("[PROJECT]", "[METRIC]");
+   *   LogMetric response = metricsClient.getLogMetric(metricName);
+   * }
+   * }
+ * + * @param metricName Required. The resource name of the desired metric: + *

"projects/[PROJECT_ID]/metrics/[METRIC_ID]" + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogMetric getLogMetric(LogMetricName metricName) { + GetLogMetricRequest request = + GetLogMetricRequest.newBuilder() + .setMetricName(metricName == null ? null : metricName.toString()) + .build(); + return getLogMetric(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a logs-based metric. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MetricsClient metricsClient = MetricsClient.create()) {
+   *   String metricName = LogMetricName.of("[PROJECT]", "[METRIC]").toString();
+   *   LogMetric response = metricsClient.getLogMetric(metricName);
+   * }
+   * }
+ * + * @param metricName Required. The resource name of the desired metric: + *

"projects/[PROJECT_ID]/metrics/[METRIC_ID]" + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogMetric getLogMetric(String metricName) { + GetLogMetricRequest request = + GetLogMetricRequest.newBuilder().setMetricName(metricName).build(); + return getLogMetric(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a logs-based metric. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MetricsClient metricsClient = MetricsClient.create()) {
+   *   GetLogMetricRequest request =
+   *       GetLogMetricRequest.newBuilder()
+   *           .setMetricName(LogMetricName.of("[PROJECT]", "[METRIC]").toString())
+   *           .build();
+   *   LogMetric response = metricsClient.getLogMetric(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 LogMetric getLogMetric(GetLogMetricRequest request) { + return getLogMetricCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets a logs-based metric. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MetricsClient metricsClient = MetricsClient.create()) {
+   *   GetLogMetricRequest request =
+   *       GetLogMetricRequest.newBuilder()
+   *           .setMetricName(LogMetricName.of("[PROJECT]", "[METRIC]").toString())
+   *           .build();
+   *   ApiFuture future = metricsClient.getLogMetricCallable().futureCall(request);
+   *   // Do something.
+   *   LogMetric response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getLogMetricCallable() { + return stub.getLogMetricCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a logs-based metric. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MetricsClient metricsClient = MetricsClient.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   LogMetric metric = LogMetric.newBuilder().build();
+   *   LogMetric response = metricsClient.createLogMetric(parent, metric);
+   * }
+   * }
+ * + * @param parent Required. The resource name of the project in which to create the metric: + *

"projects/[PROJECT_ID]" + *

The new metric must be provided in the request. + * @param metric Required. The new logs-based metric, which must not have an identifier that + * already exists. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogMetric createLogMetric(ProjectName parent, LogMetric metric) { + CreateLogMetricRequest request = + CreateLogMetricRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setMetric(metric) + .build(); + return createLogMetric(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a logs-based metric. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MetricsClient metricsClient = MetricsClient.create()) {
+   *   String parent = ProjectName.of("[PROJECT]").toString();
+   *   LogMetric metric = LogMetric.newBuilder().build();
+   *   LogMetric response = metricsClient.createLogMetric(parent, metric);
+   * }
+   * }
+ * + * @param parent Required. The resource name of the project in which to create the metric: + *

"projects/[PROJECT_ID]" + *

The new metric must be provided in the request. + * @param metric Required. The new logs-based metric, which must not have an identifier that + * already exists. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogMetric createLogMetric(String parent, LogMetric metric) { + CreateLogMetricRequest request = + CreateLogMetricRequest.newBuilder().setParent(parent).setMetric(metric).build(); + return createLogMetric(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a logs-based metric. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MetricsClient metricsClient = MetricsClient.create()) {
+   *   CreateLogMetricRequest request =
+   *       CreateLogMetricRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .setMetric(LogMetric.newBuilder().build())
+   *           .build();
+   *   LogMetric response = metricsClient.createLogMetric(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 LogMetric createLogMetric(CreateLogMetricRequest request) { + return createLogMetricCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a logs-based metric. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MetricsClient metricsClient = MetricsClient.create()) {
+   *   CreateLogMetricRequest request =
+   *       CreateLogMetricRequest.newBuilder()
+   *           .setParent(ProjectName.of("[PROJECT]").toString())
+   *           .setMetric(LogMetric.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = metricsClient.createLogMetricCallable().futureCall(request);
+   *   // Do something.
+   *   LogMetric response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createLogMetricCallable() { + return stub.createLogMetricCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates or updates a logs-based metric. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MetricsClient metricsClient = MetricsClient.create()) {
+   *   LogMetricName metricName = LogMetricName.of("[PROJECT]", "[METRIC]");
+   *   LogMetric metric = LogMetric.newBuilder().build();
+   *   LogMetric response = metricsClient.updateLogMetric(metricName, metric);
+   * }
+   * }
+ * + * @param metricName Required. The resource name of the metric to update: + *

"projects/[PROJECT_ID]/metrics/[METRIC_ID]" + *

The updated metric must be provided in the request and it's `name` field must be the + * same as `[METRIC_ID]` If the metric does not exist in `[PROJECT_ID]`, then a new metric is + * created. + * @param metric Required. The updated metric. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogMetric updateLogMetric(LogMetricName metricName, LogMetric metric) { + UpdateLogMetricRequest request = + UpdateLogMetricRequest.newBuilder() + .setMetricName(metricName == null ? null : metricName.toString()) + .setMetric(metric) + .build(); + return updateLogMetric(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates or updates a logs-based metric. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MetricsClient metricsClient = MetricsClient.create()) {
+   *   String metricName = LogMetricName.of("[PROJECT]", "[METRIC]").toString();
+   *   LogMetric metric = LogMetric.newBuilder().build();
+   *   LogMetric response = metricsClient.updateLogMetric(metricName, metric);
+   * }
+   * }
+ * + * @param metricName Required. The resource name of the metric to update: + *

"projects/[PROJECT_ID]/metrics/[METRIC_ID]" + *

The updated metric must be provided in the request and it's `name` field must be the + * same as `[METRIC_ID]` If the metric does not exist in `[PROJECT_ID]`, then a new metric is + * created. + * @param metric Required. The updated metric. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LogMetric updateLogMetric(String metricName, LogMetric metric) { + UpdateLogMetricRequest request = + UpdateLogMetricRequest.newBuilder().setMetricName(metricName).setMetric(metric).build(); + return updateLogMetric(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates or updates a logs-based metric. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MetricsClient metricsClient = MetricsClient.create()) {
+   *   UpdateLogMetricRequest request =
+   *       UpdateLogMetricRequest.newBuilder()
+   *           .setMetricName(LogMetricName.of("[PROJECT]", "[METRIC]").toString())
+   *           .setMetric(LogMetric.newBuilder().build())
+   *           .build();
+   *   LogMetric response = metricsClient.updateLogMetric(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 LogMetric updateLogMetric(UpdateLogMetricRequest request) { + return updateLogMetricCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates or updates a logs-based metric. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MetricsClient metricsClient = MetricsClient.create()) {
+   *   UpdateLogMetricRequest request =
+   *       UpdateLogMetricRequest.newBuilder()
+   *           .setMetricName(LogMetricName.of("[PROJECT]", "[METRIC]").toString())
+   *           .setMetric(LogMetric.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = metricsClient.updateLogMetricCallable().futureCall(request);
+   *   // Do something.
+   *   LogMetric response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateLogMetricCallable() { + return stub.updateLogMetricCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a logs-based metric. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MetricsClient metricsClient = MetricsClient.create()) {
+   *   LogMetricName metricName = LogMetricName.of("[PROJECT]", "[METRIC]");
+   *   metricsClient.deleteLogMetric(metricName);
+   * }
+   * }
+ * + * @param metricName Required. The resource name of the metric to delete: + *

"projects/[PROJECT_ID]/metrics/[METRIC_ID]" + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteLogMetric(LogMetricName metricName) { + DeleteLogMetricRequest request = + DeleteLogMetricRequest.newBuilder() + .setMetricName(metricName == null ? null : metricName.toString()) + .build(); + deleteLogMetric(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a logs-based metric. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MetricsClient metricsClient = MetricsClient.create()) {
+   *   String metricName = LogMetricName.of("[PROJECT]", "[METRIC]").toString();
+   *   metricsClient.deleteLogMetric(metricName);
+   * }
+   * }
+ * + * @param metricName Required. The resource name of the metric to delete: + *

"projects/[PROJECT_ID]/metrics/[METRIC_ID]" + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteLogMetric(String metricName) { + DeleteLogMetricRequest request = + DeleteLogMetricRequest.newBuilder().setMetricName(metricName).build(); + deleteLogMetric(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a logs-based metric. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MetricsClient metricsClient = MetricsClient.create()) {
+   *   DeleteLogMetricRequest request =
+   *       DeleteLogMetricRequest.newBuilder()
+   *           .setMetricName(LogMetricName.of("[PROJECT]", "[METRIC]").toString())
+   *           .build();
+   *   metricsClient.deleteLogMetric(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteLogMetric(DeleteLogMetricRequest request) { + deleteLogMetricCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a logs-based metric. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MetricsClient metricsClient = MetricsClient.create()) {
+   *   DeleteLogMetricRequest request =
+   *       DeleteLogMetricRequest.newBuilder()
+   *           .setMetricName(LogMetricName.of("[PROJECT]", "[METRIC]").toString())
+   *           .build();
+   *   ApiFuture future = metricsClient.deleteLogMetricCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteLogMetricCallable() { + return stub.deleteLogMetricCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListLogMetricsPagedResponse + extends AbstractPagedListResponse< + ListLogMetricsRequest, + ListLogMetricsResponse, + LogMetric, + ListLogMetricsPage, + ListLogMetricsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLogMetricsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListLogMetricsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListLogMetricsPagedResponse(ListLogMetricsPage page) { + super(page, ListLogMetricsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLogMetricsPage + extends AbstractPage< + ListLogMetricsRequest, ListLogMetricsResponse, LogMetric, ListLogMetricsPage> { + + private ListLogMetricsPage( + PageContext context, + ListLogMetricsResponse response) { + super(context, response); + } + + private static ListLogMetricsPage createEmptyPage() { + return new ListLogMetricsPage(null, null); + } + + @Override + protected ListLogMetricsPage createPage( + PageContext context, + ListLogMetricsResponse response) { + return new ListLogMetricsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLogMetricsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLogMetricsRequest, + ListLogMetricsResponse, + LogMetric, + ListLogMetricsPage, + ListLogMetricsFixedSizeCollection> { + + private ListLogMetricsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLogMetricsFixedSizeCollection createEmptyCollection() { + return new ListLogMetricsFixedSizeCollection(null, 0); + } + + @Override + protected ListLogMetricsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLogMetricsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-logging/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/MetricsSettings.java b/java-logging/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/MetricsSettings.java new file mode 100644 index 000000000000..d75380296cb7 --- /dev/null +++ b/java-logging/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/MetricsSettings.java @@ -0,0 +1,250 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2; + +import static com.google.cloud.logging.v2.MetricsClient.ListLogMetricsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.logging.v2.stub.MetricsServiceV2StubSettings; +import com.google.logging.v2.CreateLogMetricRequest; +import com.google.logging.v2.DeleteLogMetricRequest; +import com.google.logging.v2.GetLogMetricRequest; +import com.google.logging.v2.ListLogMetricsRequest; +import com.google.logging.v2.ListLogMetricsResponse; +import com.google.logging.v2.LogMetric; +import com.google.logging.v2.UpdateLogMetricRequest; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link MetricsClient}. + * + *

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

    + *
  • The default service address (logging.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 + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of getLogMetric: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * MetricsSettings.Builder metricsSettingsBuilder = MetricsSettings.newBuilder();
+ * metricsSettingsBuilder
+ *     .getLogMetricSettings()
+ *     .setRetrySettings(
+ *         metricsSettingsBuilder
+ *             .getLogMetricSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeoutDuration(Duration.ofSeconds(300))
+ *             .build());
+ * MetricsSettings metricsSettings = metricsSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. + */ +@Generated("by gapic-generator-java") +public class MetricsSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to listLogMetrics. */ + public PagedCallSettings< + ListLogMetricsRequest, ListLogMetricsResponse, ListLogMetricsPagedResponse> + listLogMetricsSettings() { + return ((MetricsServiceV2StubSettings) getStubSettings()).listLogMetricsSettings(); + } + + /** Returns the object with the settings used for calls to getLogMetric. */ + public UnaryCallSettings getLogMetricSettings() { + return ((MetricsServiceV2StubSettings) getStubSettings()).getLogMetricSettings(); + } + + /** Returns the object with the settings used for calls to createLogMetric. */ + public UnaryCallSettings createLogMetricSettings() { + return ((MetricsServiceV2StubSettings) getStubSettings()).createLogMetricSettings(); + } + + /** Returns the object with the settings used for calls to updateLogMetric. */ + public UnaryCallSettings updateLogMetricSettings() { + return ((MetricsServiceV2StubSettings) getStubSettings()).updateLogMetricSettings(); + } + + /** Returns the object with the settings used for calls to deleteLogMetric. */ + public UnaryCallSettings deleteLogMetricSettings() { + return ((MetricsServiceV2StubSettings) getStubSettings()).deleteLogMetricSettings(); + } + + public static final MetricsSettings create(MetricsServiceV2StubSettings stub) throws IOException { + return new MetricsSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return MetricsServiceV2StubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return MetricsServiceV2StubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return MetricsServiceV2StubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return MetricsServiceV2StubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return MetricsServiceV2StubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return MetricsServiceV2StubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return MetricsServiceV2StubSettings.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 MetricsSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for MetricsSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(MetricsServiceV2StubSettings.newBuilder(clientContext)); + } + + protected Builder(MetricsSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(MetricsServiceV2StubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(MetricsServiceV2StubSettings.newBuilder()); + } + + public MetricsServiceV2StubSettings.Builder getStubSettingsBuilder() { + return ((MetricsServiceV2StubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to listLogMetrics. */ + public PagedCallSettings.Builder< + ListLogMetricsRequest, ListLogMetricsResponse, ListLogMetricsPagedResponse> + listLogMetricsSettings() { + return getStubSettingsBuilder().listLogMetricsSettings(); + } + + /** Returns the builder for the settings used for calls to getLogMetric. */ + public UnaryCallSettings.Builder getLogMetricSettings() { + return getStubSettingsBuilder().getLogMetricSettings(); + } + + /** Returns the builder for the settings used for calls to createLogMetric. */ + public UnaryCallSettings.Builder createLogMetricSettings() { + return getStubSettingsBuilder().createLogMetricSettings(); + } + + /** Returns the builder for the settings used for calls to updateLogMetric. */ + public UnaryCallSettings.Builder updateLogMetricSettings() { + return getStubSettingsBuilder().updateLogMetricSettings(); + } + + /** Returns the builder for the settings used for calls to deleteLogMetric. */ + public UnaryCallSettings.Builder deleteLogMetricSettings() { + return getStubSettingsBuilder().deleteLogMetricSettings(); + } + + @Override + public MetricsSettings build() throws IOException { + return new MetricsSettings(this); + } + } +} diff --git a/java-logging/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/gapic_metadata.json b/java-logging/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/gapic_metadata.json new file mode 100644 index 000000000000..e29e092e0dd7 --- /dev/null +++ b/java-logging/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/gapic_metadata.json @@ -0,0 +1,165 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.logging.v2", + "libraryPackage": "com.google.cloud.logging.v2", + "services": { + "LoggingServiceV2": { + "clients": { + "grpc": { + "libraryClient": "LoggingClient", + "rpcs": { + "DeleteLog": { + "methods": ["deleteLog", "deleteLog", "deleteLog", "deleteLogCallable"] + }, + "ListLogEntries": { + "methods": ["listLogEntries", "listLogEntries", "listLogEntriesPagedCallable", "listLogEntriesCallable"] + }, + "ListLogs": { + "methods": ["listLogs", "listLogs", "listLogs", "listLogs", "listLogs", "listLogs", "listLogsPagedCallable", "listLogsCallable"] + }, + "ListMonitoredResourceDescriptors": { + "methods": ["listMonitoredResourceDescriptors", "listMonitoredResourceDescriptorsPagedCallable", "listMonitoredResourceDescriptorsCallable"] + }, + "TailLogEntries": { + "methods": ["tailLogEntriesCallable"] + }, + "WriteLogEntries": { + "methods": ["writeLogEntries", "writeLogEntries", "writeLogEntries", "writeLogEntriesCallable"] + } + } + } + } + }, + "ConfigServiceV2": { + "clients": { + "grpc": { + "libraryClient": "ConfigClient", + "rpcs": { + "CopyLogEntries": { + "methods": ["copyLogEntriesAsync", "copyLogEntriesOperationCallable", "copyLogEntriesCallable"] + }, + "CreateBucket": { + "methods": ["createBucket", "createBucketCallable"] + }, + "CreateBucketAsync": { + "methods": ["createBucketAsyncAsync", "createBucketAsyncOperationCallable", "createBucketAsyncCallable"] + }, + "CreateExclusion": { + "methods": ["createExclusion", "createExclusion", "createExclusion", "createExclusion", "createExclusion", "createExclusion", "createExclusionCallable"] + }, + "CreateLink": { + "methods": ["createLinkAsync", "createLinkAsync", "createLinkAsync", "createLinkOperationCallable", "createLinkCallable"] + }, + "CreateSink": { + "methods": ["createSink", "createSink", "createSink", "createSink", "createSink", "createSink", "createSinkCallable"] + }, + "CreateView": { + "methods": ["createView", "createViewCallable"] + }, + "DeleteBucket": { + "methods": ["deleteBucket", "deleteBucketCallable"] + }, + "DeleteExclusion": { + "methods": ["deleteExclusion", "deleteExclusion", "deleteExclusion", "deleteExclusionCallable"] + }, + "DeleteLink": { + "methods": ["deleteLinkAsync", "deleteLinkAsync", "deleteLinkAsync", "deleteLinkOperationCallable", "deleteLinkCallable"] + }, + "DeleteSink": { + "methods": ["deleteSink", "deleteSink", "deleteSink", "deleteSinkCallable"] + }, + "DeleteView": { + "methods": ["deleteView", "deleteViewCallable"] + }, + "GetBucket": { + "methods": ["getBucket", "getBucketCallable"] + }, + "GetCmekSettings": { + "methods": ["getCmekSettings", "getCmekSettingsCallable"] + }, + "GetExclusion": { + "methods": ["getExclusion", "getExclusion", "getExclusion", "getExclusionCallable"] + }, + "GetLink": { + "methods": ["getLink", "getLink", "getLink", "getLinkCallable"] + }, + "GetSettings": { + "methods": ["getSettings", "getSettings", "getSettings", "getSettingsCallable"] + }, + "GetSink": { + "methods": ["getSink", "getSink", "getSink", "getSinkCallable"] + }, + "GetView": { + "methods": ["getView", "getViewCallable"] + }, + "ListBuckets": { + "methods": ["listBuckets", "listBuckets", "listBuckets", "listBuckets", "listBuckets", "listBuckets", "listBucketsPagedCallable", "listBucketsCallable"] + }, + "ListExclusions": { + "methods": ["listExclusions", "listExclusions", "listExclusions", "listExclusions", "listExclusions", "listExclusions", "listExclusionsPagedCallable", "listExclusionsCallable"] + }, + "ListLinks": { + "methods": ["listLinks", "listLinks", "listLinks", "listLinksPagedCallable", "listLinksCallable"] + }, + "ListSinks": { + "methods": ["listSinks", "listSinks", "listSinks", "listSinks", "listSinks", "listSinks", "listSinksPagedCallable", "listSinksCallable"] + }, + "ListViews": { + "methods": ["listViews", "listViews", "listViewsPagedCallable", "listViewsCallable"] + }, + "UndeleteBucket": { + "methods": ["undeleteBucket", "undeleteBucketCallable"] + }, + "UpdateBucket": { + "methods": ["updateBucket", "updateBucketCallable"] + }, + "UpdateBucketAsync": { + "methods": ["updateBucketAsyncAsync", "updateBucketAsyncOperationCallable", "updateBucketAsyncCallable"] + }, + "UpdateCmekSettings": { + "methods": ["updateCmekSettings", "updateCmekSettingsCallable"] + }, + "UpdateExclusion": { + "methods": ["updateExclusion", "updateExclusion", "updateExclusion", "updateExclusionCallable"] + }, + "UpdateSettings": { + "methods": ["updateSettings", "updateSettings", "updateSettingsCallable"] + }, + "UpdateSink": { + "methods": ["updateSink", "updateSink", "updateSink", "updateSink", "updateSink", "updateSinkCallable"] + }, + "UpdateView": { + "methods": ["updateView", "updateViewCallable"] + } + } + } + } + }, + "MetricsServiceV2": { + "clients": { + "grpc": { + "libraryClient": "MetricsClient", + "rpcs": { + "CreateLogMetric": { + "methods": ["createLogMetric", "createLogMetric", "createLogMetric", "createLogMetricCallable"] + }, + "DeleteLogMetric": { + "methods": ["deleteLogMetric", "deleteLogMetric", "deleteLogMetric", "deleteLogMetricCallable"] + }, + "GetLogMetric": { + "methods": ["getLogMetric", "getLogMetric", "getLogMetric", "getLogMetricCallable"] + }, + "ListLogMetrics": { + "methods": ["listLogMetrics", "listLogMetrics", "listLogMetrics", "listLogMetricsPagedCallable", "listLogMetricsCallable"] + }, + "UpdateLogMetric": { + "methods": ["updateLogMetric", "updateLogMetric", "updateLogMetric", "updateLogMetricCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/java-logging/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/package-info.java b/java-logging/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/package-info.java new file mode 100644 index 000000000000..5629715624bd --- /dev/null +++ b/java-logging/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/package-info.java @@ -0,0 +1,84 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * A client to Cloud Logging API + * + *

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

======================= LoggingClient ======================= + * + *

Service Description: Service for ingesting and querying logs. + * + *

Sample for LoggingClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (LoggingClient loggingClient = LoggingClient.create()) {
+ *   LogName logName = LogName.ofProjectLogName("[PROJECT]", "[LOG]");
+ *   loggingClient.deleteLog(logName);
+ * }
+ * }
+ * + *

======================= ConfigClient ======================= + * + *

Service Description: Service for configuring sinks used to route log entries. + * + *

Sample for ConfigClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (ConfigClient configClient = ConfigClient.create()) {
+ *   GetBucketRequest request =
+ *       GetBucketRequest.newBuilder()
+ *           .setName(
+ *               LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]")
+ *                   .toString())
+ *           .build();
+ *   LogBucket response = configClient.getBucket(request);
+ * }
+ * }
+ * + *

======================= MetricsClient ======================= + * + *

Service Description: Service for configuring logs-based metrics. + * + *

Sample for MetricsClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (MetricsClient metricsClient = MetricsClient.create()) {
+ *   LogMetricName metricName = LogMetricName.of("[PROJECT]", "[METRIC]");
+ *   LogMetric response = metricsClient.getLogMetric(metricName);
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.cloud.logging.v2; + +import javax.annotation.Generated; diff --git a/java-logging/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/ConfigServiceV2Stub.java b/java-logging/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/ConfigServiceV2Stub.java new file mode 100644 index 000000000000..e5b734ebba9e --- /dev/null +++ b/java-logging/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/ConfigServiceV2Stub.java @@ -0,0 +1,268 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.stub; + +import static com.google.cloud.logging.v2.ConfigClient.ListBucketsPagedResponse; +import static com.google.cloud.logging.v2.ConfigClient.ListExclusionsPagedResponse; +import static com.google.cloud.logging.v2.ConfigClient.ListLinksPagedResponse; +import static com.google.cloud.logging.v2.ConfigClient.ListSinksPagedResponse; +import static com.google.cloud.logging.v2.ConfigClient.ListViewsPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.logging.v2.BucketMetadata; +import com.google.logging.v2.CmekSettings; +import com.google.logging.v2.CopyLogEntriesMetadata; +import com.google.logging.v2.CopyLogEntriesRequest; +import com.google.logging.v2.CopyLogEntriesResponse; +import com.google.logging.v2.CreateBucketRequest; +import com.google.logging.v2.CreateExclusionRequest; +import com.google.logging.v2.CreateLinkRequest; +import com.google.logging.v2.CreateSinkRequest; +import com.google.logging.v2.CreateViewRequest; +import com.google.logging.v2.DeleteBucketRequest; +import com.google.logging.v2.DeleteExclusionRequest; +import com.google.logging.v2.DeleteLinkRequest; +import com.google.logging.v2.DeleteSinkRequest; +import com.google.logging.v2.DeleteViewRequest; +import com.google.logging.v2.GetBucketRequest; +import com.google.logging.v2.GetCmekSettingsRequest; +import com.google.logging.v2.GetExclusionRequest; +import com.google.logging.v2.GetLinkRequest; +import com.google.logging.v2.GetSettingsRequest; +import com.google.logging.v2.GetSinkRequest; +import com.google.logging.v2.GetViewRequest; +import com.google.logging.v2.Link; +import com.google.logging.v2.LinkMetadata; +import com.google.logging.v2.ListBucketsRequest; +import com.google.logging.v2.ListBucketsResponse; +import com.google.logging.v2.ListExclusionsRequest; +import com.google.logging.v2.ListExclusionsResponse; +import com.google.logging.v2.ListLinksRequest; +import com.google.logging.v2.ListLinksResponse; +import com.google.logging.v2.ListSinksRequest; +import com.google.logging.v2.ListSinksResponse; +import com.google.logging.v2.ListViewsRequest; +import com.google.logging.v2.ListViewsResponse; +import com.google.logging.v2.LogBucket; +import com.google.logging.v2.LogExclusion; +import com.google.logging.v2.LogSink; +import com.google.logging.v2.LogView; +import com.google.logging.v2.Settings; +import com.google.logging.v2.UndeleteBucketRequest; +import com.google.logging.v2.UpdateBucketRequest; +import com.google.logging.v2.UpdateCmekSettingsRequest; +import com.google.logging.v2.UpdateExclusionRequest; +import com.google.logging.v2.UpdateSettingsRequest; +import com.google.logging.v2.UpdateSinkRequest; +import com.google.logging.v2.UpdateViewRequest; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the ConfigServiceV2 service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class ConfigServiceV2Stub implements BackgroundResource { + + public OperationsStub getOperationsStub() { + throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); + } + + public UnaryCallable listBucketsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listBucketsPagedCallable()"); + } + + public UnaryCallable listBucketsCallable() { + throw new UnsupportedOperationException("Not implemented: listBucketsCallable()"); + } + + public UnaryCallable getBucketCallable() { + throw new UnsupportedOperationException("Not implemented: getBucketCallable()"); + } + + public OperationCallable + createBucketAsyncOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: createBucketAsyncOperationCallable()"); + } + + public UnaryCallable createBucketAsyncCallable() { + throw new UnsupportedOperationException("Not implemented: createBucketAsyncCallable()"); + } + + public OperationCallable + updateBucketAsyncOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: updateBucketAsyncOperationCallable()"); + } + + public UnaryCallable updateBucketAsyncCallable() { + throw new UnsupportedOperationException("Not implemented: updateBucketAsyncCallable()"); + } + + public UnaryCallable createBucketCallable() { + throw new UnsupportedOperationException("Not implemented: createBucketCallable()"); + } + + public UnaryCallable updateBucketCallable() { + throw new UnsupportedOperationException("Not implemented: updateBucketCallable()"); + } + + public UnaryCallable deleteBucketCallable() { + throw new UnsupportedOperationException("Not implemented: deleteBucketCallable()"); + } + + public UnaryCallable undeleteBucketCallable() { + throw new UnsupportedOperationException("Not implemented: undeleteBucketCallable()"); + } + + public UnaryCallable listViewsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listViewsPagedCallable()"); + } + + public UnaryCallable listViewsCallable() { + throw new UnsupportedOperationException("Not implemented: listViewsCallable()"); + } + + public UnaryCallable getViewCallable() { + throw new UnsupportedOperationException("Not implemented: getViewCallable()"); + } + + public UnaryCallable createViewCallable() { + throw new UnsupportedOperationException("Not implemented: createViewCallable()"); + } + + public UnaryCallable updateViewCallable() { + throw new UnsupportedOperationException("Not implemented: updateViewCallable()"); + } + + public UnaryCallable deleteViewCallable() { + throw new UnsupportedOperationException("Not implemented: deleteViewCallable()"); + } + + public UnaryCallable listSinksPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listSinksPagedCallable()"); + } + + public UnaryCallable listSinksCallable() { + throw new UnsupportedOperationException("Not implemented: listSinksCallable()"); + } + + public UnaryCallable getSinkCallable() { + throw new UnsupportedOperationException("Not implemented: getSinkCallable()"); + } + + public UnaryCallable createSinkCallable() { + throw new UnsupportedOperationException("Not implemented: createSinkCallable()"); + } + + public UnaryCallable updateSinkCallable() { + throw new UnsupportedOperationException("Not implemented: updateSinkCallable()"); + } + + public UnaryCallable deleteSinkCallable() { + throw new UnsupportedOperationException("Not implemented: deleteSinkCallable()"); + } + + public OperationCallable createLinkOperationCallable() { + throw new UnsupportedOperationException("Not implemented: createLinkOperationCallable()"); + } + + public UnaryCallable createLinkCallable() { + throw new UnsupportedOperationException("Not implemented: createLinkCallable()"); + } + + public OperationCallable deleteLinkOperationCallable() { + throw new UnsupportedOperationException("Not implemented: deleteLinkOperationCallable()"); + } + + public UnaryCallable deleteLinkCallable() { + throw new UnsupportedOperationException("Not implemented: deleteLinkCallable()"); + } + + public UnaryCallable listLinksPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLinksPagedCallable()"); + } + + public UnaryCallable listLinksCallable() { + throw new UnsupportedOperationException("Not implemented: listLinksCallable()"); + } + + public UnaryCallable getLinkCallable() { + throw new UnsupportedOperationException("Not implemented: getLinkCallable()"); + } + + public UnaryCallable + listExclusionsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listExclusionsPagedCallable()"); + } + + public UnaryCallable listExclusionsCallable() { + throw new UnsupportedOperationException("Not implemented: listExclusionsCallable()"); + } + + public UnaryCallable getExclusionCallable() { + throw new UnsupportedOperationException("Not implemented: getExclusionCallable()"); + } + + public UnaryCallable createExclusionCallable() { + throw new UnsupportedOperationException("Not implemented: createExclusionCallable()"); + } + + public UnaryCallable updateExclusionCallable() { + throw new UnsupportedOperationException("Not implemented: updateExclusionCallable()"); + } + + public UnaryCallable deleteExclusionCallable() { + throw new UnsupportedOperationException("Not implemented: deleteExclusionCallable()"); + } + + public UnaryCallable getCmekSettingsCallable() { + throw new UnsupportedOperationException("Not implemented: getCmekSettingsCallable()"); + } + + public UnaryCallable updateCmekSettingsCallable() { + throw new UnsupportedOperationException("Not implemented: updateCmekSettingsCallable()"); + } + + public UnaryCallable getSettingsCallable() { + throw new UnsupportedOperationException("Not implemented: getSettingsCallable()"); + } + + public UnaryCallable updateSettingsCallable() { + throw new UnsupportedOperationException("Not implemented: updateSettingsCallable()"); + } + + public OperationCallable + copyLogEntriesOperationCallable() { + throw new UnsupportedOperationException("Not implemented: copyLogEntriesOperationCallable()"); + } + + public UnaryCallable copyLogEntriesCallable() { + throw new UnsupportedOperationException("Not implemented: copyLogEntriesCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-logging/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/ConfigServiceV2StubSettings.java b/java-logging/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/ConfigServiceV2StubSettings.java new file mode 100644 index 000000000000..b3ccd40a1f34 --- /dev/null +++ b/java-logging/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/ConfigServiceV2StubSettings.java @@ -0,0 +1,1607 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.stub; + +import static com.google.cloud.logging.v2.ConfigClient.ListBucketsPagedResponse; +import static com.google.cloud.logging.v2.ConfigClient.ListExclusionsPagedResponse; +import static com.google.cloud.logging.v2.ConfigClient.ListLinksPagedResponse; +import static com.google.cloud.logging.v2.ConfigClient.ListSinksPagedResponse; +import static com.google.cloud.logging.v2.ConfigClient.ListViewsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ObsoleteApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.grpc.ProtoOperationTransformers; +import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.logging.v2.BucketMetadata; +import com.google.logging.v2.CmekSettings; +import com.google.logging.v2.CopyLogEntriesMetadata; +import com.google.logging.v2.CopyLogEntriesRequest; +import com.google.logging.v2.CopyLogEntriesResponse; +import com.google.logging.v2.CreateBucketRequest; +import com.google.logging.v2.CreateExclusionRequest; +import com.google.logging.v2.CreateLinkRequest; +import com.google.logging.v2.CreateSinkRequest; +import com.google.logging.v2.CreateViewRequest; +import com.google.logging.v2.DeleteBucketRequest; +import com.google.logging.v2.DeleteExclusionRequest; +import com.google.logging.v2.DeleteLinkRequest; +import com.google.logging.v2.DeleteSinkRequest; +import com.google.logging.v2.DeleteViewRequest; +import com.google.logging.v2.GetBucketRequest; +import com.google.logging.v2.GetCmekSettingsRequest; +import com.google.logging.v2.GetExclusionRequest; +import com.google.logging.v2.GetLinkRequest; +import com.google.logging.v2.GetSettingsRequest; +import com.google.logging.v2.GetSinkRequest; +import com.google.logging.v2.GetViewRequest; +import com.google.logging.v2.Link; +import com.google.logging.v2.LinkMetadata; +import com.google.logging.v2.ListBucketsRequest; +import com.google.logging.v2.ListBucketsResponse; +import com.google.logging.v2.ListExclusionsRequest; +import com.google.logging.v2.ListExclusionsResponse; +import com.google.logging.v2.ListLinksRequest; +import com.google.logging.v2.ListLinksResponse; +import com.google.logging.v2.ListSinksRequest; +import com.google.logging.v2.ListSinksResponse; +import com.google.logging.v2.ListViewsRequest; +import com.google.logging.v2.ListViewsResponse; +import com.google.logging.v2.LogBucket; +import com.google.logging.v2.LogExclusion; +import com.google.logging.v2.LogSink; +import com.google.logging.v2.LogView; +import com.google.logging.v2.Settings; +import com.google.logging.v2.UndeleteBucketRequest; +import com.google.logging.v2.UpdateBucketRequest; +import com.google.logging.v2.UpdateCmekSettingsRequest; +import com.google.logging.v2.UpdateExclusionRequest; +import com.google.logging.v2.UpdateSettingsRequest; +import com.google.logging.v2.UpdateSinkRequest; +import com.google.logging.v2.UpdateViewRequest; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.time.Duration; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link ConfigServiceV2Stub}. + * + *

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

    + *
  • The default service address (logging.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 + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of getBucket: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * ConfigServiceV2StubSettings.Builder configSettingsBuilder =
+ *     ConfigServiceV2StubSettings.newBuilder();
+ * configSettingsBuilder
+ *     .getBucketSettings()
+ *     .setRetrySettings(
+ *         configSettingsBuilder
+ *             .getBucketSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeoutDuration(Duration.ofSeconds(300))
+ *             .build());
+ * ConfigServiceV2StubSettings configSettings = configSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. + * + *

To configure the RetrySettings of a Long Running Operation method, create an + * OperationTimedPollAlgorithm object and update the RPC's polling algorithm. For example, to + * configure the RetrySettings for createBucketAsync: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * ConfigServiceV2StubSettings.Builder configSettingsBuilder =
+ *     ConfigServiceV2StubSettings.newBuilder();
+ * TimedRetryAlgorithm timedRetryAlgorithm =
+ *     OperationalTimedPollAlgorithm.create(
+ *         RetrySettings.newBuilder()
+ *             .setInitialRetryDelayDuration(Duration.ofMillis(500))
+ *             .setRetryDelayMultiplier(1.5)
+ *             .setMaxRetryDelayDuration(Duration.ofMillis(5000))
+ *             .setTotalTimeoutDuration(Duration.ofHours(24))
+ *             .build());
+ * configSettingsBuilder
+ *     .createClusterOperationSettings()
+ *     .setPollingAlgorithm(timedRetryAlgorithm)
+ *     .build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class ConfigServiceV2StubSettings 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/cloud-platform.read-only") + .add("https://www.googleapis.com/auth/logging.admin") + .add("https://www.googleapis.com/auth/logging.read") + .build(); + + private final PagedCallSettings + listBucketsSettings; + private final UnaryCallSettings getBucketSettings; + private final UnaryCallSettings createBucketAsyncSettings; + private final OperationCallSettings + createBucketAsyncOperationSettings; + private final UnaryCallSettings updateBucketAsyncSettings; + private final OperationCallSettings + updateBucketAsyncOperationSettings; + private final UnaryCallSettings createBucketSettings; + private final UnaryCallSettings updateBucketSettings; + private final UnaryCallSettings deleteBucketSettings; + private final UnaryCallSettings undeleteBucketSettings; + private final PagedCallSettings + listViewsSettings; + private final UnaryCallSettings getViewSettings; + private final UnaryCallSettings createViewSettings; + private final UnaryCallSettings updateViewSettings; + private final UnaryCallSettings deleteViewSettings; + private final PagedCallSettings + listSinksSettings; + private final UnaryCallSettings getSinkSettings; + private final UnaryCallSettings createSinkSettings; + private final UnaryCallSettings updateSinkSettings; + private final UnaryCallSettings deleteSinkSettings; + private final UnaryCallSettings createLinkSettings; + private final OperationCallSettings + createLinkOperationSettings; + private final UnaryCallSettings deleteLinkSettings; + private final OperationCallSettings + deleteLinkOperationSettings; + private final PagedCallSettings + listLinksSettings; + private final UnaryCallSettings getLinkSettings; + private final PagedCallSettings< + ListExclusionsRequest, ListExclusionsResponse, ListExclusionsPagedResponse> + listExclusionsSettings; + private final UnaryCallSettings getExclusionSettings; + private final UnaryCallSettings createExclusionSettings; + private final UnaryCallSettings updateExclusionSettings; + private final UnaryCallSettings deleteExclusionSettings; + private final UnaryCallSettings getCmekSettingsSettings; + private final UnaryCallSettings + updateCmekSettingsSettings; + private final UnaryCallSettings getSettingsSettings; + private final UnaryCallSettings updateSettingsSettings; + private final UnaryCallSettings copyLogEntriesSettings; + private final OperationCallSettings< + CopyLogEntriesRequest, CopyLogEntriesResponse, CopyLogEntriesMetadata> + copyLogEntriesOperationSettings; + + private static final PagedListDescriptor + LIST_BUCKETS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListBucketsRequest injectToken(ListBucketsRequest payload, String token) { + return ListBucketsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListBucketsRequest injectPageSize(ListBucketsRequest payload, int pageSize) { + return ListBucketsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListBucketsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListBucketsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListBucketsResponse payload) { + return payload.getBucketsList(); + } + }; + + private static final PagedListDescriptor + LIST_VIEWS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListViewsRequest injectToken(ListViewsRequest payload, String token) { + return ListViewsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListViewsRequest injectPageSize(ListViewsRequest payload, int pageSize) { + return ListViewsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListViewsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListViewsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListViewsResponse payload) { + return payload.getViewsList(); + } + }; + + private static final PagedListDescriptor + LIST_SINKS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListSinksRequest injectToken(ListSinksRequest payload, String token) { + return ListSinksRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListSinksRequest injectPageSize(ListSinksRequest payload, int pageSize) { + return ListSinksRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListSinksRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListSinksResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListSinksResponse payload) { + return payload.getSinksList(); + } + }; + + private static final PagedListDescriptor + LIST_LINKS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLinksRequest injectToken(ListLinksRequest payload, String token) { + return ListLinksRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLinksRequest injectPageSize(ListLinksRequest payload, int pageSize) { + return ListLinksRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLinksRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLinksResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLinksResponse payload) { + return payload.getLinksList(); + } + }; + + private static final PagedListDescriptor< + ListExclusionsRequest, ListExclusionsResponse, LogExclusion> + LIST_EXCLUSIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListExclusionsRequest injectToken(ListExclusionsRequest payload, String token) { + return ListExclusionsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListExclusionsRequest injectPageSize( + ListExclusionsRequest payload, int pageSize) { + return ListExclusionsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListExclusionsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListExclusionsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListExclusionsResponse payload) { + return payload.getExclusionsList(); + } + }; + + private static final PagedListResponseFactory< + ListBucketsRequest, ListBucketsResponse, ListBucketsPagedResponse> + LIST_BUCKETS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListBucketsRequest, ListBucketsResponse, ListBucketsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListBucketsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_BUCKETS_PAGE_STR_DESC, request, context); + return ListBucketsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListViewsRequest, ListViewsResponse, ListViewsPagedResponse> + LIST_VIEWS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListViewsRequest, ListViewsResponse, ListViewsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListViewsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_VIEWS_PAGE_STR_DESC, request, context); + return ListViewsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListSinksRequest, ListSinksResponse, ListSinksPagedResponse> + LIST_SINKS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListSinksRequest, ListSinksResponse, ListSinksPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListSinksRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_SINKS_PAGE_STR_DESC, request, context); + return ListSinksPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListLinksRequest, ListLinksResponse, ListLinksPagedResponse> + LIST_LINKS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListLinksRequest, ListLinksResponse, ListLinksPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLinksRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_LINKS_PAGE_STR_DESC, request, context); + return ListLinksPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListExclusionsRequest, ListExclusionsResponse, ListExclusionsPagedResponse> + LIST_EXCLUSIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListExclusionsRequest, ListExclusionsResponse, ListExclusionsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListExclusionsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_EXCLUSIONS_PAGE_STR_DESC, request, context); + return ListExclusionsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to listBuckets. */ + public PagedCallSettings + listBucketsSettings() { + return listBucketsSettings; + } + + /** Returns the object with the settings used for calls to getBucket. */ + public UnaryCallSettings getBucketSettings() { + return getBucketSettings; + } + + /** Returns the object with the settings used for calls to createBucketAsync. */ + public UnaryCallSettings createBucketAsyncSettings() { + return createBucketAsyncSettings; + } + + /** Returns the object with the settings used for calls to createBucketAsync. */ + public OperationCallSettings + createBucketAsyncOperationSettings() { + return createBucketAsyncOperationSettings; + } + + /** Returns the object with the settings used for calls to updateBucketAsync. */ + public UnaryCallSettings updateBucketAsyncSettings() { + return updateBucketAsyncSettings; + } + + /** Returns the object with the settings used for calls to updateBucketAsync. */ + public OperationCallSettings + updateBucketAsyncOperationSettings() { + return updateBucketAsyncOperationSettings; + } + + /** Returns the object with the settings used for calls to createBucket. */ + public UnaryCallSettings createBucketSettings() { + return createBucketSettings; + } + + /** Returns the object with the settings used for calls to updateBucket. */ + public UnaryCallSettings updateBucketSettings() { + return updateBucketSettings; + } + + /** Returns the object with the settings used for calls to deleteBucket. */ + public UnaryCallSettings deleteBucketSettings() { + return deleteBucketSettings; + } + + /** Returns the object with the settings used for calls to undeleteBucket. */ + public UnaryCallSettings undeleteBucketSettings() { + return undeleteBucketSettings; + } + + /** Returns the object with the settings used for calls to listViews. */ + public PagedCallSettings + listViewsSettings() { + return listViewsSettings; + } + + /** Returns the object with the settings used for calls to getView. */ + public UnaryCallSettings getViewSettings() { + return getViewSettings; + } + + /** Returns the object with the settings used for calls to createView. */ + public UnaryCallSettings createViewSettings() { + return createViewSettings; + } + + /** Returns the object with the settings used for calls to updateView. */ + public UnaryCallSettings updateViewSettings() { + return updateViewSettings; + } + + /** Returns the object with the settings used for calls to deleteView. */ + public UnaryCallSettings deleteViewSettings() { + return deleteViewSettings; + } + + /** Returns the object with the settings used for calls to listSinks. */ + public PagedCallSettings + listSinksSettings() { + return listSinksSettings; + } + + /** Returns the object with the settings used for calls to getSink. */ + public UnaryCallSettings getSinkSettings() { + return getSinkSettings; + } + + /** Returns the object with the settings used for calls to createSink. */ + public UnaryCallSettings createSinkSettings() { + return createSinkSettings; + } + + /** Returns the object with the settings used for calls to updateSink. */ + public UnaryCallSettings updateSinkSettings() { + return updateSinkSettings; + } + + /** Returns the object with the settings used for calls to deleteSink. */ + public UnaryCallSettings deleteSinkSettings() { + return deleteSinkSettings; + } + + /** Returns the object with the settings used for calls to createLink. */ + public UnaryCallSettings createLinkSettings() { + return createLinkSettings; + } + + /** Returns the object with the settings used for calls to createLink. */ + public OperationCallSettings + createLinkOperationSettings() { + return createLinkOperationSettings; + } + + /** Returns the object with the settings used for calls to deleteLink. */ + public UnaryCallSettings deleteLinkSettings() { + return deleteLinkSettings; + } + + /** Returns the object with the settings used for calls to deleteLink. */ + public OperationCallSettings + deleteLinkOperationSettings() { + return deleteLinkOperationSettings; + } + + /** Returns the object with the settings used for calls to listLinks. */ + public PagedCallSettings + listLinksSettings() { + return listLinksSettings; + } + + /** Returns the object with the settings used for calls to getLink. */ + public UnaryCallSettings getLinkSettings() { + return getLinkSettings; + } + + /** Returns the object with the settings used for calls to listExclusions. */ + public PagedCallSettings< + ListExclusionsRequest, ListExclusionsResponse, ListExclusionsPagedResponse> + listExclusionsSettings() { + return listExclusionsSettings; + } + + /** Returns the object with the settings used for calls to getExclusion. */ + public UnaryCallSettings getExclusionSettings() { + return getExclusionSettings; + } + + /** Returns the object with the settings used for calls to createExclusion. */ + public UnaryCallSettings createExclusionSettings() { + return createExclusionSettings; + } + + /** Returns the object with the settings used for calls to updateExclusion. */ + public UnaryCallSettings updateExclusionSettings() { + return updateExclusionSettings; + } + + /** Returns the object with the settings used for calls to deleteExclusion. */ + public UnaryCallSettings deleteExclusionSettings() { + return deleteExclusionSettings; + } + + /** Returns the object with the settings used for calls to getCmekSettings. */ + public UnaryCallSettings getCmekSettingsSettings() { + return getCmekSettingsSettings; + } + + /** Returns the object with the settings used for calls to updateCmekSettings. */ + public UnaryCallSettings updateCmekSettingsSettings() { + return updateCmekSettingsSettings; + } + + /** Returns the object with the settings used for calls to getSettings. */ + public UnaryCallSettings getSettingsSettings() { + return getSettingsSettings; + } + + /** Returns the object with the settings used for calls to updateSettings. */ + public UnaryCallSettings updateSettingsSettings() { + return updateSettingsSettings; + } + + /** Returns the object with the settings used for calls to copyLogEntries. */ + public UnaryCallSettings copyLogEntriesSettings() { + return copyLogEntriesSettings; + } + + /** Returns the object with the settings used for calls to copyLogEntries. */ + public OperationCallSettings< + CopyLogEntriesRequest, CopyLogEntriesResponse, CopyLogEntriesMetadata> + copyLogEntriesOperationSettings() { + return copyLogEntriesOperationSettings; + } + + public ConfigServiceV2Stub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcConfigServiceV2Stub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "logging"; + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + @ObsoleteApi("Use getEndpoint() instead") + public static String getDefaultEndpoint() { + return "logging.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "logging.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(ConfigServiceV2StubSettings.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 ConfigServiceV2StubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listBucketsSettings = settingsBuilder.listBucketsSettings().build(); + getBucketSettings = settingsBuilder.getBucketSettings().build(); + createBucketAsyncSettings = settingsBuilder.createBucketAsyncSettings().build(); + createBucketAsyncOperationSettings = + settingsBuilder.createBucketAsyncOperationSettings().build(); + updateBucketAsyncSettings = settingsBuilder.updateBucketAsyncSettings().build(); + updateBucketAsyncOperationSettings = + settingsBuilder.updateBucketAsyncOperationSettings().build(); + createBucketSettings = settingsBuilder.createBucketSettings().build(); + updateBucketSettings = settingsBuilder.updateBucketSettings().build(); + deleteBucketSettings = settingsBuilder.deleteBucketSettings().build(); + undeleteBucketSettings = settingsBuilder.undeleteBucketSettings().build(); + listViewsSettings = settingsBuilder.listViewsSettings().build(); + getViewSettings = settingsBuilder.getViewSettings().build(); + createViewSettings = settingsBuilder.createViewSettings().build(); + updateViewSettings = settingsBuilder.updateViewSettings().build(); + deleteViewSettings = settingsBuilder.deleteViewSettings().build(); + listSinksSettings = settingsBuilder.listSinksSettings().build(); + getSinkSettings = settingsBuilder.getSinkSettings().build(); + createSinkSettings = settingsBuilder.createSinkSettings().build(); + updateSinkSettings = settingsBuilder.updateSinkSettings().build(); + deleteSinkSettings = settingsBuilder.deleteSinkSettings().build(); + createLinkSettings = settingsBuilder.createLinkSettings().build(); + createLinkOperationSettings = settingsBuilder.createLinkOperationSettings().build(); + deleteLinkSettings = settingsBuilder.deleteLinkSettings().build(); + deleteLinkOperationSettings = settingsBuilder.deleteLinkOperationSettings().build(); + listLinksSettings = settingsBuilder.listLinksSettings().build(); + getLinkSettings = settingsBuilder.getLinkSettings().build(); + listExclusionsSettings = settingsBuilder.listExclusionsSettings().build(); + getExclusionSettings = settingsBuilder.getExclusionSettings().build(); + createExclusionSettings = settingsBuilder.createExclusionSettings().build(); + updateExclusionSettings = settingsBuilder.updateExclusionSettings().build(); + deleteExclusionSettings = settingsBuilder.deleteExclusionSettings().build(); + getCmekSettingsSettings = settingsBuilder.getCmekSettingsSettings().build(); + updateCmekSettingsSettings = settingsBuilder.updateCmekSettingsSettings().build(); + getSettingsSettings = settingsBuilder.getSettingsSettings().build(); + updateSettingsSettings = settingsBuilder.updateSettingsSettings().build(); + copyLogEntriesSettings = settingsBuilder.copyLogEntriesSettings().build(); + copyLogEntriesOperationSettings = settingsBuilder.copyLogEntriesOperationSettings().build(); + } + + /** Builder for ConfigServiceV2StubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final PagedCallSettings.Builder< + ListBucketsRequest, ListBucketsResponse, ListBucketsPagedResponse> + listBucketsSettings; + private final UnaryCallSettings.Builder getBucketSettings; + private final UnaryCallSettings.Builder + createBucketAsyncSettings; + private final OperationCallSettings.Builder + createBucketAsyncOperationSettings; + private final UnaryCallSettings.Builder + updateBucketAsyncSettings; + private final OperationCallSettings.Builder + updateBucketAsyncOperationSettings; + private final UnaryCallSettings.Builder createBucketSettings; + private final UnaryCallSettings.Builder updateBucketSettings; + private final UnaryCallSettings.Builder deleteBucketSettings; + private final UnaryCallSettings.Builder undeleteBucketSettings; + private final PagedCallSettings.Builder< + ListViewsRequest, ListViewsResponse, ListViewsPagedResponse> + listViewsSettings; + private final UnaryCallSettings.Builder getViewSettings; + private final UnaryCallSettings.Builder createViewSettings; + private final UnaryCallSettings.Builder updateViewSettings; + private final UnaryCallSettings.Builder deleteViewSettings; + private final PagedCallSettings.Builder< + ListSinksRequest, ListSinksResponse, ListSinksPagedResponse> + listSinksSettings; + private final UnaryCallSettings.Builder getSinkSettings; + private final UnaryCallSettings.Builder createSinkSettings; + private final UnaryCallSettings.Builder updateSinkSettings; + private final UnaryCallSettings.Builder deleteSinkSettings; + private final UnaryCallSettings.Builder createLinkSettings; + private final OperationCallSettings.Builder + createLinkOperationSettings; + private final UnaryCallSettings.Builder deleteLinkSettings; + private final OperationCallSettings.Builder + deleteLinkOperationSettings; + private final PagedCallSettings.Builder< + ListLinksRequest, ListLinksResponse, ListLinksPagedResponse> + listLinksSettings; + private final UnaryCallSettings.Builder getLinkSettings; + private final PagedCallSettings.Builder< + ListExclusionsRequest, ListExclusionsResponse, ListExclusionsPagedResponse> + listExclusionsSettings; + private final UnaryCallSettings.Builder getExclusionSettings; + private final UnaryCallSettings.Builder + createExclusionSettings; + private final UnaryCallSettings.Builder + updateExclusionSettings; + private final UnaryCallSettings.Builder deleteExclusionSettings; + private final UnaryCallSettings.Builder + getCmekSettingsSettings; + private final UnaryCallSettings.Builder + updateCmekSettingsSettings; + private final UnaryCallSettings.Builder getSettingsSettings; + private final UnaryCallSettings.Builder updateSettingsSettings; + private final UnaryCallSettings.Builder + copyLogEntriesSettings; + private final OperationCallSettings.Builder< + CopyLogEntriesRequest, CopyLogEntriesResponse, CopyLogEntriesMetadata> + copyLogEntriesOperationSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "retry_policy_3_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.DEADLINE_EXCEEDED, + StatusCode.Code.INTERNAL, + StatusCode.Code.UNAVAILABLE))); + definitions.put( + "no_retry_4_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); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelayDuration(Duration.ofMillis(60000L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setTotalTimeoutDuration(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_3_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeoutDuration(Duration.ofMillis(120000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(120000L)) + .setTotalTimeoutDuration(Duration.ofMillis(120000L)) + .build(); + definitions.put("no_retry_4_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + listBucketsSettings = PagedCallSettings.newBuilder(LIST_BUCKETS_PAGE_STR_FACT); + getBucketSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createBucketAsyncSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createBucketAsyncOperationSettings = OperationCallSettings.newBuilder(); + updateBucketAsyncSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateBucketAsyncOperationSettings = OperationCallSettings.newBuilder(); + createBucketSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateBucketSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteBucketSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + undeleteBucketSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listViewsSettings = PagedCallSettings.newBuilder(LIST_VIEWS_PAGE_STR_FACT); + getViewSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createViewSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateViewSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteViewSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listSinksSettings = PagedCallSettings.newBuilder(LIST_SINKS_PAGE_STR_FACT); + getSinkSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createSinkSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateSinkSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteSinkSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createLinkSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createLinkOperationSettings = OperationCallSettings.newBuilder(); + deleteLinkSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteLinkOperationSettings = OperationCallSettings.newBuilder(); + listLinksSettings = PagedCallSettings.newBuilder(LIST_LINKS_PAGE_STR_FACT); + getLinkSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listExclusionsSettings = PagedCallSettings.newBuilder(LIST_EXCLUSIONS_PAGE_STR_FACT); + getExclusionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createExclusionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateExclusionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteExclusionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getCmekSettingsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateCmekSettingsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getSettingsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateSettingsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + copyLogEntriesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + copyLogEntriesOperationSettings = OperationCallSettings.newBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listBucketsSettings, + getBucketSettings, + createBucketAsyncSettings, + updateBucketAsyncSettings, + createBucketSettings, + updateBucketSettings, + deleteBucketSettings, + undeleteBucketSettings, + listViewsSettings, + getViewSettings, + createViewSettings, + updateViewSettings, + deleteViewSettings, + listSinksSettings, + getSinkSettings, + createSinkSettings, + updateSinkSettings, + deleteSinkSettings, + createLinkSettings, + deleteLinkSettings, + listLinksSettings, + getLinkSettings, + listExclusionsSettings, + getExclusionSettings, + createExclusionSettings, + updateExclusionSettings, + deleteExclusionSettings, + getCmekSettingsSettings, + updateCmekSettingsSettings, + getSettingsSettings, + updateSettingsSettings, + copyLogEntriesSettings); + initDefaults(this); + } + + protected Builder(ConfigServiceV2StubSettings settings) { + super(settings); + + listBucketsSettings = settings.listBucketsSettings.toBuilder(); + getBucketSettings = settings.getBucketSettings.toBuilder(); + createBucketAsyncSettings = settings.createBucketAsyncSettings.toBuilder(); + createBucketAsyncOperationSettings = settings.createBucketAsyncOperationSettings.toBuilder(); + updateBucketAsyncSettings = settings.updateBucketAsyncSettings.toBuilder(); + updateBucketAsyncOperationSettings = settings.updateBucketAsyncOperationSettings.toBuilder(); + createBucketSettings = settings.createBucketSettings.toBuilder(); + updateBucketSettings = settings.updateBucketSettings.toBuilder(); + deleteBucketSettings = settings.deleteBucketSettings.toBuilder(); + undeleteBucketSettings = settings.undeleteBucketSettings.toBuilder(); + listViewsSettings = settings.listViewsSettings.toBuilder(); + getViewSettings = settings.getViewSettings.toBuilder(); + createViewSettings = settings.createViewSettings.toBuilder(); + updateViewSettings = settings.updateViewSettings.toBuilder(); + deleteViewSettings = settings.deleteViewSettings.toBuilder(); + listSinksSettings = settings.listSinksSettings.toBuilder(); + getSinkSettings = settings.getSinkSettings.toBuilder(); + createSinkSettings = settings.createSinkSettings.toBuilder(); + updateSinkSettings = settings.updateSinkSettings.toBuilder(); + deleteSinkSettings = settings.deleteSinkSettings.toBuilder(); + createLinkSettings = settings.createLinkSettings.toBuilder(); + createLinkOperationSettings = settings.createLinkOperationSettings.toBuilder(); + deleteLinkSettings = settings.deleteLinkSettings.toBuilder(); + deleteLinkOperationSettings = settings.deleteLinkOperationSettings.toBuilder(); + listLinksSettings = settings.listLinksSettings.toBuilder(); + getLinkSettings = settings.getLinkSettings.toBuilder(); + listExclusionsSettings = settings.listExclusionsSettings.toBuilder(); + getExclusionSettings = settings.getExclusionSettings.toBuilder(); + createExclusionSettings = settings.createExclusionSettings.toBuilder(); + updateExclusionSettings = settings.updateExclusionSettings.toBuilder(); + deleteExclusionSettings = settings.deleteExclusionSettings.toBuilder(); + getCmekSettingsSettings = settings.getCmekSettingsSettings.toBuilder(); + updateCmekSettingsSettings = settings.updateCmekSettingsSettings.toBuilder(); + getSettingsSettings = settings.getSettingsSettings.toBuilder(); + updateSettingsSettings = settings.updateSettingsSettings.toBuilder(); + copyLogEntriesSettings = settings.copyLogEntriesSettings.toBuilder(); + copyLogEntriesOperationSettings = settings.copyLogEntriesOperationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listBucketsSettings, + getBucketSettings, + createBucketAsyncSettings, + updateBucketAsyncSettings, + createBucketSettings, + updateBucketSettings, + deleteBucketSettings, + undeleteBucketSettings, + listViewsSettings, + getViewSettings, + createViewSettings, + updateViewSettings, + deleteViewSettings, + listSinksSettings, + getSinkSettings, + createSinkSettings, + updateSinkSettings, + deleteSinkSettings, + createLinkSettings, + deleteLinkSettings, + listLinksSettings, + getLinkSettings, + listExclusionsSettings, + getExclusionSettings, + createExclusionSettings, + updateExclusionSettings, + deleteExclusionSettings, + getCmekSettingsSettings, + updateCmekSettingsSettings, + getSettingsSettings, + updateSettingsSettings, + copyLogEntriesSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .listBucketsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getBucketSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .createBucketAsyncSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .updateBucketAsyncSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .createBucketSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .updateBucketSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .deleteBucketSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .undeleteBucketSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .listViewsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getViewSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .createViewSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .updateViewSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .deleteViewSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .listSinksSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params")); + + builder + .getSinkSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params")); + + builder + .createSinkSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_4_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_4_params")); + + builder + .updateSinkSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params")); + + builder + .deleteSinkSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params")); + + builder + .createLinkSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .deleteLinkSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .listLinksSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getLinkSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .listExclusionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params")); + + builder + .getExclusionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params")); + + builder + .createExclusionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_4_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_4_params")); + + builder + .updateExclusionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_4_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_4_params")); + + builder + .deleteExclusionSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_3_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_3_params")); + + builder + .getCmekSettingsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .updateCmekSettingsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getSettingsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .updateSettingsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .copyLogEntriesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .createBucketAsyncOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(LogBucket.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(BucketMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelayDuration(Duration.ofMillis(45000L)) + .setInitialRpcTimeoutDuration(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ZERO) + .setTotalTimeoutDuration(Duration.ofMillis(300000L)) + .build())); + + builder + .updateBucketAsyncOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(LogBucket.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(BucketMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelayDuration(Duration.ofMillis(45000L)) + .setInitialRpcTimeoutDuration(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ZERO) + .setTotalTimeoutDuration(Duration.ofMillis(300000L)) + .build())); + + builder + .createLinkOperationSettings() + .setInitialCallSettings( + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer(ProtoOperationTransformers.ResponseTransformer.create(Link.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(LinkMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelayDuration(Duration.ofMillis(45000L)) + .setInitialRpcTimeoutDuration(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ZERO) + .setTotalTimeoutDuration(Duration.ofMillis(300000L)) + .build())); + + builder + .deleteLinkOperationSettings() + .setInitialCallSettings( + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(LinkMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelayDuration(Duration.ofMillis(45000L)) + .setInitialRpcTimeoutDuration(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ZERO) + .setTotalTimeoutDuration(Duration.ofMillis(300000L)) + .build())); + + builder + .copyLogEntriesOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(CopyLogEntriesResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(CopyLogEntriesMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelayDuration(Duration.ofMillis(45000L)) + .setInitialRpcTimeoutDuration(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ZERO) + .setTotalTimeoutDuration(Duration.ofMillis(300000L)) + .build())); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to listBuckets. */ + public PagedCallSettings.Builder< + ListBucketsRequest, ListBucketsResponse, ListBucketsPagedResponse> + listBucketsSettings() { + return listBucketsSettings; + } + + /** Returns the builder for the settings used for calls to getBucket. */ + public UnaryCallSettings.Builder getBucketSettings() { + return getBucketSettings; + } + + /** Returns the builder for the settings used for calls to createBucketAsync. */ + public UnaryCallSettings.Builder createBucketAsyncSettings() { + return createBucketAsyncSettings; + } + + /** Returns the builder for the settings used for calls to createBucketAsync. */ + public OperationCallSettings.Builder + createBucketAsyncOperationSettings() { + return createBucketAsyncOperationSettings; + } + + /** Returns the builder for the settings used for calls to updateBucketAsync. */ + public UnaryCallSettings.Builder updateBucketAsyncSettings() { + return updateBucketAsyncSettings; + } + + /** Returns the builder for the settings used for calls to updateBucketAsync. */ + public OperationCallSettings.Builder + updateBucketAsyncOperationSettings() { + return updateBucketAsyncOperationSettings; + } + + /** Returns the builder for the settings used for calls to createBucket. */ + public UnaryCallSettings.Builder createBucketSettings() { + return createBucketSettings; + } + + /** Returns the builder for the settings used for calls to updateBucket. */ + public UnaryCallSettings.Builder updateBucketSettings() { + return updateBucketSettings; + } + + /** Returns the builder for the settings used for calls to deleteBucket. */ + public UnaryCallSettings.Builder deleteBucketSettings() { + return deleteBucketSettings; + } + + /** Returns the builder for the settings used for calls to undeleteBucket. */ + public UnaryCallSettings.Builder undeleteBucketSettings() { + return undeleteBucketSettings; + } + + /** Returns the builder for the settings used for calls to listViews. */ + public PagedCallSettings.Builder + listViewsSettings() { + return listViewsSettings; + } + + /** Returns the builder for the settings used for calls to getView. */ + public UnaryCallSettings.Builder getViewSettings() { + return getViewSettings; + } + + /** Returns the builder for the settings used for calls to createView. */ + public UnaryCallSettings.Builder createViewSettings() { + return createViewSettings; + } + + /** Returns the builder for the settings used for calls to updateView. */ + public UnaryCallSettings.Builder updateViewSettings() { + return updateViewSettings; + } + + /** Returns the builder for the settings used for calls to deleteView. */ + public UnaryCallSettings.Builder deleteViewSettings() { + return deleteViewSettings; + } + + /** Returns the builder for the settings used for calls to listSinks. */ + public PagedCallSettings.Builder + listSinksSettings() { + return listSinksSettings; + } + + /** Returns the builder for the settings used for calls to getSink. */ + public UnaryCallSettings.Builder getSinkSettings() { + return getSinkSettings; + } + + /** Returns the builder for the settings used for calls to createSink. */ + public UnaryCallSettings.Builder createSinkSettings() { + return createSinkSettings; + } + + /** Returns the builder for the settings used for calls to updateSink. */ + public UnaryCallSettings.Builder updateSinkSettings() { + return updateSinkSettings; + } + + /** Returns the builder for the settings used for calls to deleteSink. */ + public UnaryCallSettings.Builder deleteSinkSettings() { + return deleteSinkSettings; + } + + /** Returns the builder for the settings used for calls to createLink. */ + public UnaryCallSettings.Builder createLinkSettings() { + return createLinkSettings; + } + + /** Returns the builder for the settings used for calls to createLink. */ + public OperationCallSettings.Builder + createLinkOperationSettings() { + return createLinkOperationSettings; + } + + /** Returns the builder for the settings used for calls to deleteLink. */ + public UnaryCallSettings.Builder deleteLinkSettings() { + return deleteLinkSettings; + } + + /** Returns the builder for the settings used for calls to deleteLink. */ + public OperationCallSettings.Builder + deleteLinkOperationSettings() { + return deleteLinkOperationSettings; + } + + /** Returns the builder for the settings used for calls to listLinks. */ + public PagedCallSettings.Builder + listLinksSettings() { + return listLinksSettings; + } + + /** Returns the builder for the settings used for calls to getLink. */ + public UnaryCallSettings.Builder getLinkSettings() { + return getLinkSettings; + } + + /** Returns the builder for the settings used for calls to listExclusions. */ + public PagedCallSettings.Builder< + ListExclusionsRequest, ListExclusionsResponse, ListExclusionsPagedResponse> + listExclusionsSettings() { + return listExclusionsSettings; + } + + /** Returns the builder for the settings used for calls to getExclusion. */ + public UnaryCallSettings.Builder getExclusionSettings() { + return getExclusionSettings; + } + + /** Returns the builder for the settings used for calls to createExclusion. */ + public UnaryCallSettings.Builder + createExclusionSettings() { + return createExclusionSettings; + } + + /** Returns the builder for the settings used for calls to updateExclusion. */ + public UnaryCallSettings.Builder + updateExclusionSettings() { + return updateExclusionSettings; + } + + /** Returns the builder for the settings used for calls to deleteExclusion. */ + public UnaryCallSettings.Builder deleteExclusionSettings() { + return deleteExclusionSettings; + } + + /** Returns the builder for the settings used for calls to getCmekSettings. */ + public UnaryCallSettings.Builder + getCmekSettingsSettings() { + return getCmekSettingsSettings; + } + + /** Returns the builder for the settings used for calls to updateCmekSettings. */ + public UnaryCallSettings.Builder + updateCmekSettingsSettings() { + return updateCmekSettingsSettings; + } + + /** Returns the builder for the settings used for calls to getSettings. */ + public UnaryCallSettings.Builder getSettingsSettings() { + return getSettingsSettings; + } + + /** Returns the builder for the settings used for calls to updateSettings. */ + public UnaryCallSettings.Builder updateSettingsSettings() { + return updateSettingsSettings; + } + + /** Returns the builder for the settings used for calls to copyLogEntries. */ + public UnaryCallSettings.Builder copyLogEntriesSettings() { + return copyLogEntriesSettings; + } + + /** Returns the builder for the settings used for calls to copyLogEntries. */ + public OperationCallSettings.Builder< + CopyLogEntriesRequest, CopyLogEntriesResponse, CopyLogEntriesMetadata> + copyLogEntriesOperationSettings() { + return copyLogEntriesOperationSettings; + } + + @Override + public ConfigServiceV2StubSettings build() throws IOException { + return new ConfigServiceV2StubSettings(this); + } + } +} diff --git a/java-logging/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/GrpcConfigServiceV2CallableFactory.java b/java-logging/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/GrpcConfigServiceV2CallableFactory.java new file mode 100644 index 000000000000..ee8ab97054ff --- /dev/null +++ b/java-logging/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/GrpcConfigServiceV2CallableFactory.java @@ -0,0 +1,113 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.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 ConfigServiceV2 service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcConfigServiceV2CallableFactory 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/java-logging/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/GrpcConfigServiceV2Stub.java b/java-logging/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/GrpcConfigServiceV2Stub.java new file mode 100644 index 000000000000..f5cd1a54a1b5 --- /dev/null +++ b/java-logging/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/GrpcConfigServiceV2Stub.java @@ -0,0 +1,1229 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.stub; + +import static com.google.cloud.logging.v2.ConfigClient.ListBucketsPagedResponse; +import static com.google.cloud.logging.v2.ConfigClient.ListExclusionsPagedResponse; +import static com.google.cloud.logging.v2.ConfigClient.ListLinksPagedResponse; +import static com.google.cloud.logging.v2.ConfigClient.ListSinksPagedResponse; +import static com.google.cloud.logging.v2.ConfigClient.ListViewsPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.logging.v2.BucketMetadata; +import com.google.logging.v2.CmekSettings; +import com.google.logging.v2.CopyLogEntriesMetadata; +import com.google.logging.v2.CopyLogEntriesRequest; +import com.google.logging.v2.CopyLogEntriesResponse; +import com.google.logging.v2.CreateBucketRequest; +import com.google.logging.v2.CreateExclusionRequest; +import com.google.logging.v2.CreateLinkRequest; +import com.google.logging.v2.CreateSinkRequest; +import com.google.logging.v2.CreateViewRequest; +import com.google.logging.v2.DeleteBucketRequest; +import com.google.logging.v2.DeleteExclusionRequest; +import com.google.logging.v2.DeleteLinkRequest; +import com.google.logging.v2.DeleteSinkRequest; +import com.google.logging.v2.DeleteViewRequest; +import com.google.logging.v2.GetBucketRequest; +import com.google.logging.v2.GetCmekSettingsRequest; +import com.google.logging.v2.GetExclusionRequest; +import com.google.logging.v2.GetLinkRequest; +import com.google.logging.v2.GetSettingsRequest; +import com.google.logging.v2.GetSinkRequest; +import com.google.logging.v2.GetViewRequest; +import com.google.logging.v2.Link; +import com.google.logging.v2.LinkMetadata; +import com.google.logging.v2.ListBucketsRequest; +import com.google.logging.v2.ListBucketsResponse; +import com.google.logging.v2.ListExclusionsRequest; +import com.google.logging.v2.ListExclusionsResponse; +import com.google.logging.v2.ListLinksRequest; +import com.google.logging.v2.ListLinksResponse; +import com.google.logging.v2.ListSinksRequest; +import com.google.logging.v2.ListSinksResponse; +import com.google.logging.v2.ListViewsRequest; +import com.google.logging.v2.ListViewsResponse; +import com.google.logging.v2.LogBucket; +import com.google.logging.v2.LogExclusion; +import com.google.logging.v2.LogSink; +import com.google.logging.v2.LogView; +import com.google.logging.v2.Settings; +import com.google.logging.v2.UndeleteBucketRequest; +import com.google.logging.v2.UpdateBucketRequest; +import com.google.logging.v2.UpdateCmekSettingsRequest; +import com.google.logging.v2.UpdateExclusionRequest; +import com.google.logging.v2.UpdateSettingsRequest; +import com.google.logging.v2.UpdateSinkRequest; +import com.google.logging.v2.UpdateViewRequest; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the ConfigServiceV2 service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcConfigServiceV2Stub extends ConfigServiceV2Stub { + private static final MethodDescriptor + listBucketsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.logging.v2.ConfigServiceV2/ListBuckets") + .setRequestMarshaller(ProtoUtils.marshaller(ListBucketsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListBucketsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getBucketMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.logging.v2.ConfigServiceV2/GetBucket") + .setRequestMarshaller(ProtoUtils.marshaller(GetBucketRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(LogBucket.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + createBucketAsyncMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.logging.v2.ConfigServiceV2/CreateBucketAsync") + .setRequestMarshaller(ProtoUtils.marshaller(CreateBucketRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + updateBucketAsyncMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.logging.v2.ConfigServiceV2/UpdateBucketAsync") + .setRequestMarshaller(ProtoUtils.marshaller(UpdateBucketRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + createBucketMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.logging.v2.ConfigServiceV2/CreateBucket") + .setRequestMarshaller(ProtoUtils.marshaller(CreateBucketRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(LogBucket.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + updateBucketMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.logging.v2.ConfigServiceV2/UpdateBucket") + .setRequestMarshaller(ProtoUtils.marshaller(UpdateBucketRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(LogBucket.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor deleteBucketMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.logging.v2.ConfigServiceV2/DeleteBucket") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteBucketRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + undeleteBucketMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.logging.v2.ConfigServiceV2/UndeleteBucket") + .setRequestMarshaller( + ProtoUtils.marshaller(UndeleteBucketRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listViewsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.logging.v2.ConfigServiceV2/ListViews") + .setRequestMarshaller(ProtoUtils.marshaller(ListViewsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ListViewsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getViewMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.logging.v2.ConfigServiceV2/GetView") + .setRequestMarshaller(ProtoUtils.marshaller(GetViewRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(LogView.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor createViewMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.logging.v2.ConfigServiceV2/CreateView") + .setRequestMarshaller(ProtoUtils.marshaller(CreateViewRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(LogView.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor updateViewMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.logging.v2.ConfigServiceV2/UpdateView") + .setRequestMarshaller(ProtoUtils.marshaller(UpdateViewRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(LogView.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor deleteViewMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.logging.v2.ConfigServiceV2/DeleteView") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteViewRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listSinksMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.logging.v2.ConfigServiceV2/ListSinks") + .setRequestMarshaller(ProtoUtils.marshaller(ListSinksRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ListSinksResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getSinkMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.logging.v2.ConfigServiceV2/GetSink") + .setRequestMarshaller(ProtoUtils.marshaller(GetSinkRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(LogSink.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor createSinkMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.logging.v2.ConfigServiceV2/CreateSink") + .setRequestMarshaller(ProtoUtils.marshaller(CreateSinkRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(LogSink.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor updateSinkMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.logging.v2.ConfigServiceV2/UpdateSink") + .setRequestMarshaller(ProtoUtils.marshaller(UpdateSinkRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(LogSink.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor deleteSinkMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.logging.v2.ConfigServiceV2/DeleteSink") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteSinkRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor createLinkMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.logging.v2.ConfigServiceV2/CreateLink") + .setRequestMarshaller(ProtoUtils.marshaller(CreateLinkRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor deleteLinkMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.logging.v2.ConfigServiceV2/DeleteLink") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteLinkRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listLinksMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.logging.v2.ConfigServiceV2/ListLinks") + .setRequestMarshaller(ProtoUtils.marshaller(ListLinksRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ListLinksResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getLinkMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.logging.v2.ConfigServiceV2/GetLink") + .setRequestMarshaller(ProtoUtils.marshaller(GetLinkRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Link.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listExclusionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.logging.v2.ConfigServiceV2/ListExclusions") + .setRequestMarshaller( + ProtoUtils.marshaller(ListExclusionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListExclusionsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + getExclusionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.logging.v2.ConfigServiceV2/GetExclusion") + .setRequestMarshaller(ProtoUtils.marshaller(GetExclusionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(LogExclusion.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + createExclusionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.logging.v2.ConfigServiceV2/CreateExclusion") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateExclusionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(LogExclusion.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + updateExclusionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.logging.v2.ConfigServiceV2/UpdateExclusion") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateExclusionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(LogExclusion.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + deleteExclusionMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.logging.v2.ConfigServiceV2/DeleteExclusion") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteExclusionRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + getCmekSettingsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.logging.v2.ConfigServiceV2/GetCmekSettings") + .setRequestMarshaller( + ProtoUtils.marshaller(GetCmekSettingsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(CmekSettings.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + updateCmekSettingsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.logging.v2.ConfigServiceV2/UpdateCmekSettings") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateCmekSettingsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(CmekSettings.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getSettingsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.logging.v2.ConfigServiceV2/GetSettings") + .setRequestMarshaller(ProtoUtils.marshaller(GetSettingsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Settings.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + updateSettingsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.logging.v2.ConfigServiceV2/UpdateSettings") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateSettingsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Settings.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + copyLogEntriesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.logging.v2.ConfigServiceV2/CopyLogEntries") + .setRequestMarshaller( + ProtoUtils.marshaller(CopyLogEntriesRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private final UnaryCallable listBucketsCallable; + private final UnaryCallable + listBucketsPagedCallable; + private final UnaryCallable getBucketCallable; + private final UnaryCallable createBucketAsyncCallable; + private final OperationCallable + createBucketAsyncOperationCallable; + private final UnaryCallable updateBucketAsyncCallable; + private final OperationCallable + updateBucketAsyncOperationCallable; + private final UnaryCallable createBucketCallable; + private final UnaryCallable updateBucketCallable; + private final UnaryCallable deleteBucketCallable; + private final UnaryCallable undeleteBucketCallable; + private final UnaryCallable listViewsCallable; + private final UnaryCallable listViewsPagedCallable; + private final UnaryCallable getViewCallable; + private final UnaryCallable createViewCallable; + private final UnaryCallable updateViewCallable; + private final UnaryCallable deleteViewCallable; + private final UnaryCallable listSinksCallable; + private final UnaryCallable listSinksPagedCallable; + private final UnaryCallable getSinkCallable; + private final UnaryCallable createSinkCallable; + private final UnaryCallable updateSinkCallable; + private final UnaryCallable deleteSinkCallable; + private final UnaryCallable createLinkCallable; + private final OperationCallable + createLinkOperationCallable; + private final UnaryCallable deleteLinkCallable; + private final OperationCallable + deleteLinkOperationCallable; + private final UnaryCallable listLinksCallable; + private final UnaryCallable listLinksPagedCallable; + private final UnaryCallable getLinkCallable; + private final UnaryCallable listExclusionsCallable; + private final UnaryCallable + listExclusionsPagedCallable; + private final UnaryCallable getExclusionCallable; + private final UnaryCallable createExclusionCallable; + private final UnaryCallable updateExclusionCallable; + private final UnaryCallable deleteExclusionCallable; + private final UnaryCallable getCmekSettingsCallable; + private final UnaryCallable updateCmekSettingsCallable; + private final UnaryCallable getSettingsCallable; + private final UnaryCallable updateSettingsCallable; + private final UnaryCallable copyLogEntriesCallable; + private final OperationCallable< + CopyLogEntriesRequest, CopyLogEntriesResponse, CopyLogEntriesMetadata> + copyLogEntriesOperationCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcConfigServiceV2Stub create(ConfigServiceV2StubSettings settings) + throws IOException { + return new GrpcConfigServiceV2Stub(settings, ClientContext.create(settings)); + } + + public static final GrpcConfigServiceV2Stub create(ClientContext clientContext) + throws IOException { + return new GrpcConfigServiceV2Stub( + ConfigServiceV2StubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcConfigServiceV2Stub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcConfigServiceV2Stub( + ConfigServiceV2StubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcConfigServiceV2Stub, 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 GrpcConfigServiceV2Stub( + ConfigServiceV2StubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcConfigServiceV2CallableFactory()); + } + + /** + * Constructs an instance of GrpcConfigServiceV2Stub, 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 GrpcConfigServiceV2Stub( + ConfigServiceV2StubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings listBucketsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listBucketsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings getBucketTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getBucketMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings createBucketAsyncTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createBucketAsyncMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings updateBucketAsyncTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateBucketAsyncMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings createBucketTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createBucketMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings updateBucketTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateBucketMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteBucketTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteBucketMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings undeleteBucketTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(undeleteBucketMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings listViewsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listViewsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings getViewTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getViewMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings createViewTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createViewMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings updateViewTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateViewMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteViewTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteViewMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings listSinksTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listSinksMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings getSinkTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getSinkMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("sink_name", String.valueOf(request.getSinkName())); + return builder.build(); + }) + .build(); + GrpcCallSettings createSinkTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createSinkMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings updateSinkTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateSinkMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("sink_name", String.valueOf(request.getSinkName())); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteSinkTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteSinkMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("sink_name", String.valueOf(request.getSinkName())); + return builder.build(); + }) + .build(); + GrpcCallSettings createLinkTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createLinkMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteLinkTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteLinkMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings listLinksTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLinksMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings getLinkTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLinkMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + listExclusionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listExclusionsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings getExclusionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getExclusionMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings createExclusionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createExclusionMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings updateExclusionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateExclusionMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteExclusionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteExclusionMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings getCmekSettingsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getCmekSettingsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings updateCmekSettingsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateCmekSettingsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings getSettingsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getSettingsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings updateSettingsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateSettingsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings copyLogEntriesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(copyLogEntriesMethodDescriptor) + .build(); + + this.listBucketsCallable = + callableFactory.createUnaryCallable( + listBucketsTransportSettings, settings.listBucketsSettings(), clientContext); + this.listBucketsPagedCallable = + callableFactory.createPagedCallable( + listBucketsTransportSettings, settings.listBucketsSettings(), clientContext); + this.getBucketCallable = + callableFactory.createUnaryCallable( + getBucketTransportSettings, settings.getBucketSettings(), clientContext); + this.createBucketAsyncCallable = + callableFactory.createUnaryCallable( + createBucketAsyncTransportSettings, + settings.createBucketAsyncSettings(), + clientContext); + this.createBucketAsyncOperationCallable = + callableFactory.createOperationCallable( + createBucketAsyncTransportSettings, + settings.createBucketAsyncOperationSettings(), + clientContext, + operationsStub); + this.updateBucketAsyncCallable = + callableFactory.createUnaryCallable( + updateBucketAsyncTransportSettings, + settings.updateBucketAsyncSettings(), + clientContext); + this.updateBucketAsyncOperationCallable = + callableFactory.createOperationCallable( + updateBucketAsyncTransportSettings, + settings.updateBucketAsyncOperationSettings(), + clientContext, + operationsStub); + this.createBucketCallable = + callableFactory.createUnaryCallable( + createBucketTransportSettings, settings.createBucketSettings(), clientContext); + this.updateBucketCallable = + callableFactory.createUnaryCallable( + updateBucketTransportSettings, settings.updateBucketSettings(), clientContext); + this.deleteBucketCallable = + callableFactory.createUnaryCallable( + deleteBucketTransportSettings, settings.deleteBucketSettings(), clientContext); + this.undeleteBucketCallable = + callableFactory.createUnaryCallable( + undeleteBucketTransportSettings, settings.undeleteBucketSettings(), clientContext); + this.listViewsCallable = + callableFactory.createUnaryCallable( + listViewsTransportSettings, settings.listViewsSettings(), clientContext); + this.listViewsPagedCallable = + callableFactory.createPagedCallable( + listViewsTransportSettings, settings.listViewsSettings(), clientContext); + this.getViewCallable = + callableFactory.createUnaryCallable( + getViewTransportSettings, settings.getViewSettings(), clientContext); + this.createViewCallable = + callableFactory.createUnaryCallable( + createViewTransportSettings, settings.createViewSettings(), clientContext); + this.updateViewCallable = + callableFactory.createUnaryCallable( + updateViewTransportSettings, settings.updateViewSettings(), clientContext); + this.deleteViewCallable = + callableFactory.createUnaryCallable( + deleteViewTransportSettings, settings.deleteViewSettings(), clientContext); + this.listSinksCallable = + callableFactory.createUnaryCallable( + listSinksTransportSettings, settings.listSinksSettings(), clientContext); + this.listSinksPagedCallable = + callableFactory.createPagedCallable( + listSinksTransportSettings, settings.listSinksSettings(), clientContext); + this.getSinkCallable = + callableFactory.createUnaryCallable( + getSinkTransportSettings, settings.getSinkSettings(), clientContext); + this.createSinkCallable = + callableFactory.createUnaryCallable( + createSinkTransportSettings, settings.createSinkSettings(), clientContext); + this.updateSinkCallable = + callableFactory.createUnaryCallable( + updateSinkTransportSettings, settings.updateSinkSettings(), clientContext); + this.deleteSinkCallable = + callableFactory.createUnaryCallable( + deleteSinkTransportSettings, settings.deleteSinkSettings(), clientContext); + this.createLinkCallable = + callableFactory.createUnaryCallable( + createLinkTransportSettings, settings.createLinkSettings(), clientContext); + this.createLinkOperationCallable = + callableFactory.createOperationCallable( + createLinkTransportSettings, + settings.createLinkOperationSettings(), + clientContext, + operationsStub); + this.deleteLinkCallable = + callableFactory.createUnaryCallable( + deleteLinkTransportSettings, settings.deleteLinkSettings(), clientContext); + this.deleteLinkOperationCallable = + callableFactory.createOperationCallable( + deleteLinkTransportSettings, + settings.deleteLinkOperationSettings(), + clientContext, + operationsStub); + this.listLinksCallable = + callableFactory.createUnaryCallable( + listLinksTransportSettings, settings.listLinksSettings(), clientContext); + this.listLinksPagedCallable = + callableFactory.createPagedCallable( + listLinksTransportSettings, settings.listLinksSettings(), clientContext); + this.getLinkCallable = + callableFactory.createUnaryCallable( + getLinkTransportSettings, settings.getLinkSettings(), clientContext); + this.listExclusionsCallable = + callableFactory.createUnaryCallable( + listExclusionsTransportSettings, settings.listExclusionsSettings(), clientContext); + this.listExclusionsPagedCallable = + callableFactory.createPagedCallable( + listExclusionsTransportSettings, settings.listExclusionsSettings(), clientContext); + this.getExclusionCallable = + callableFactory.createUnaryCallable( + getExclusionTransportSettings, settings.getExclusionSettings(), clientContext); + this.createExclusionCallable = + callableFactory.createUnaryCallable( + createExclusionTransportSettings, settings.createExclusionSettings(), clientContext); + this.updateExclusionCallable = + callableFactory.createUnaryCallable( + updateExclusionTransportSettings, settings.updateExclusionSettings(), clientContext); + this.deleteExclusionCallable = + callableFactory.createUnaryCallable( + deleteExclusionTransportSettings, settings.deleteExclusionSettings(), clientContext); + this.getCmekSettingsCallable = + callableFactory.createUnaryCallable( + getCmekSettingsTransportSettings, settings.getCmekSettingsSettings(), clientContext); + this.updateCmekSettingsCallable = + callableFactory.createUnaryCallable( + updateCmekSettingsTransportSettings, + settings.updateCmekSettingsSettings(), + clientContext); + this.getSettingsCallable = + callableFactory.createUnaryCallable( + getSettingsTransportSettings, settings.getSettingsSettings(), clientContext); + this.updateSettingsCallable = + callableFactory.createUnaryCallable( + updateSettingsTransportSettings, settings.updateSettingsSettings(), clientContext); + this.copyLogEntriesCallable = + callableFactory.createUnaryCallable( + copyLogEntriesTransportSettings, settings.copyLogEntriesSettings(), clientContext); + this.copyLogEntriesOperationCallable = + callableFactory.createOperationCallable( + copyLogEntriesTransportSettings, + settings.copyLogEntriesOperationSettings(), + clientContext, + operationsStub); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable listBucketsCallable() { + return listBucketsCallable; + } + + @Override + public UnaryCallable listBucketsPagedCallable() { + return listBucketsPagedCallable; + } + + @Override + public UnaryCallable getBucketCallable() { + return getBucketCallable; + } + + @Override + public UnaryCallable createBucketAsyncCallable() { + return createBucketAsyncCallable; + } + + @Override + public OperationCallable + createBucketAsyncOperationCallable() { + return createBucketAsyncOperationCallable; + } + + @Override + public UnaryCallable updateBucketAsyncCallable() { + return updateBucketAsyncCallable; + } + + @Override + public OperationCallable + updateBucketAsyncOperationCallable() { + return updateBucketAsyncOperationCallable; + } + + @Override + public UnaryCallable createBucketCallable() { + return createBucketCallable; + } + + @Override + public UnaryCallable updateBucketCallable() { + return updateBucketCallable; + } + + @Override + public UnaryCallable deleteBucketCallable() { + return deleteBucketCallable; + } + + @Override + public UnaryCallable undeleteBucketCallable() { + return undeleteBucketCallable; + } + + @Override + public UnaryCallable listViewsCallable() { + return listViewsCallable; + } + + @Override + public UnaryCallable listViewsPagedCallable() { + return listViewsPagedCallable; + } + + @Override + public UnaryCallable getViewCallable() { + return getViewCallable; + } + + @Override + public UnaryCallable createViewCallable() { + return createViewCallable; + } + + @Override + public UnaryCallable updateViewCallable() { + return updateViewCallable; + } + + @Override + public UnaryCallable deleteViewCallable() { + return deleteViewCallable; + } + + @Override + public UnaryCallable listSinksCallable() { + return listSinksCallable; + } + + @Override + public UnaryCallable listSinksPagedCallable() { + return listSinksPagedCallable; + } + + @Override + public UnaryCallable getSinkCallable() { + return getSinkCallable; + } + + @Override + public UnaryCallable createSinkCallable() { + return createSinkCallable; + } + + @Override + public UnaryCallable updateSinkCallable() { + return updateSinkCallable; + } + + @Override + public UnaryCallable deleteSinkCallable() { + return deleteSinkCallable; + } + + @Override + public UnaryCallable createLinkCallable() { + return createLinkCallable; + } + + @Override + public OperationCallable createLinkOperationCallable() { + return createLinkOperationCallable; + } + + @Override + public UnaryCallable deleteLinkCallable() { + return deleteLinkCallable; + } + + @Override + public OperationCallable deleteLinkOperationCallable() { + return deleteLinkOperationCallable; + } + + @Override + public UnaryCallable listLinksCallable() { + return listLinksCallable; + } + + @Override + public UnaryCallable listLinksPagedCallable() { + return listLinksPagedCallable; + } + + @Override + public UnaryCallable getLinkCallable() { + return getLinkCallable; + } + + @Override + public UnaryCallable listExclusionsCallable() { + return listExclusionsCallable; + } + + @Override + public UnaryCallable + listExclusionsPagedCallable() { + return listExclusionsPagedCallable; + } + + @Override + public UnaryCallable getExclusionCallable() { + return getExclusionCallable; + } + + @Override + public UnaryCallable createExclusionCallable() { + return createExclusionCallable; + } + + @Override + public UnaryCallable updateExclusionCallable() { + return updateExclusionCallable; + } + + @Override + public UnaryCallable deleteExclusionCallable() { + return deleteExclusionCallable; + } + + @Override + public UnaryCallable getCmekSettingsCallable() { + return getCmekSettingsCallable; + } + + @Override + public UnaryCallable updateCmekSettingsCallable() { + return updateCmekSettingsCallable; + } + + @Override + public UnaryCallable getSettingsCallable() { + return getSettingsCallable; + } + + @Override + public UnaryCallable updateSettingsCallable() { + return updateSettingsCallable; + } + + @Override + public UnaryCallable copyLogEntriesCallable() { + return copyLogEntriesCallable; + } + + @Override + public OperationCallable + copyLogEntriesOperationCallable() { + return copyLogEntriesOperationCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-logging/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/GrpcLoggingServiceV2CallableFactory.java b/java-logging/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/GrpcLoggingServiceV2CallableFactory.java new file mode 100644 index 000000000000..b12cd704db5a --- /dev/null +++ b/java-logging/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/GrpcLoggingServiceV2CallableFactory.java @@ -0,0 +1,113 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.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 LoggingServiceV2 service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcLoggingServiceV2CallableFactory 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/java-logging/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/GrpcLoggingServiceV2Stub.java b/java-logging/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/GrpcLoggingServiceV2Stub.java new file mode 100644 index 000000000000..c227a7d1b866 --- /dev/null +++ b/java-logging/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/GrpcLoggingServiceV2Stub.java @@ -0,0 +1,362 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.stub; + +import static com.google.cloud.logging.v2.LoggingClient.ListLogEntriesPagedResponse; +import static com.google.cloud.logging.v2.LoggingClient.ListLogsPagedResponse; +import static com.google.cloud.logging.v2.LoggingClient.ListMonitoredResourceDescriptorsPagedResponse; + +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.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.logging.v2.DeleteLogRequest; +import com.google.logging.v2.ListLogEntriesRequest; +import com.google.logging.v2.ListLogEntriesResponse; +import com.google.logging.v2.ListLogsRequest; +import com.google.logging.v2.ListLogsResponse; +import com.google.logging.v2.ListMonitoredResourceDescriptorsRequest; +import com.google.logging.v2.ListMonitoredResourceDescriptorsResponse; +import com.google.logging.v2.TailLogEntriesRequest; +import com.google.logging.v2.TailLogEntriesResponse; +import com.google.logging.v2.WriteLogEntriesRequest; +import com.google.logging.v2.WriteLogEntriesResponse; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the LoggingServiceV2 service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcLoggingServiceV2Stub extends LoggingServiceV2Stub { + private static final MethodDescriptor deleteLogMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.logging.v2.LoggingServiceV2/DeleteLog") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteLogRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + writeLogEntriesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.logging.v2.LoggingServiceV2/WriteLogEntries") + .setRequestMarshaller( + ProtoUtils.marshaller(WriteLogEntriesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(WriteLogEntriesResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listLogEntriesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.logging.v2.LoggingServiceV2/ListLogEntries") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLogEntriesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLogEntriesResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor< + ListMonitoredResourceDescriptorsRequest, ListMonitoredResourceDescriptorsResponse> + listMonitoredResourceDescriptorsMethodDescriptor = + MethodDescriptor + . + newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.logging.v2.LoggingServiceV2/ListMonitoredResourceDescriptors") + .setRequestMarshaller( + ProtoUtils.marshaller( + ListMonitoredResourceDescriptorsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller( + ListMonitoredResourceDescriptorsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listLogsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.logging.v2.LoggingServiceV2/ListLogs") + .setRequestMarshaller(ProtoUtils.marshaller(ListLogsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ListLogsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + tailLogEntriesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName("google.logging.v2.LoggingServiceV2/TailLogEntries") + .setRequestMarshaller( + ProtoUtils.marshaller(TailLogEntriesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(TailLogEntriesResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private final UnaryCallable deleteLogCallable; + private final UnaryCallable + writeLogEntriesCallable; + private final UnaryCallable listLogEntriesCallable; + private final UnaryCallable + listLogEntriesPagedCallable; + private final UnaryCallable< + ListMonitoredResourceDescriptorsRequest, ListMonitoredResourceDescriptorsResponse> + listMonitoredResourceDescriptorsCallable; + private final UnaryCallable< + ListMonitoredResourceDescriptorsRequest, ListMonitoredResourceDescriptorsPagedResponse> + listMonitoredResourceDescriptorsPagedCallable; + private final UnaryCallable listLogsCallable; + private final UnaryCallable listLogsPagedCallable; + private final BidiStreamingCallable + tailLogEntriesCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcLoggingServiceV2Stub create(LoggingServiceV2StubSettings settings) + throws IOException { + return new GrpcLoggingServiceV2Stub(settings, ClientContext.create(settings)); + } + + public static final GrpcLoggingServiceV2Stub create(ClientContext clientContext) + throws IOException { + return new GrpcLoggingServiceV2Stub( + LoggingServiceV2StubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcLoggingServiceV2Stub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcLoggingServiceV2Stub( + LoggingServiceV2StubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcLoggingServiceV2Stub, 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 GrpcLoggingServiceV2Stub( + LoggingServiceV2StubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcLoggingServiceV2CallableFactory()); + } + + /** + * Constructs an instance of GrpcLoggingServiceV2Stub, 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 GrpcLoggingServiceV2Stub( + LoggingServiceV2StubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings deleteLogTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteLogMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("log_name", String.valueOf(request.getLogName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + writeLogEntriesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(writeLogEntriesMethodDescriptor) + .build(); + GrpcCallSettings + listLogEntriesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLogEntriesMethodDescriptor) + .build(); + GrpcCallSettings< + ListMonitoredResourceDescriptorsRequest, ListMonitoredResourceDescriptorsResponse> + listMonitoredResourceDescriptorsTransportSettings = + GrpcCallSettings + . + newBuilder() + .setMethodDescriptor(listMonitoredResourceDescriptorsMethodDescriptor) + .build(); + GrpcCallSettings listLogsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLogsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings + tailLogEntriesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(tailLogEntriesMethodDescriptor) + .build(); + + this.deleteLogCallable = + callableFactory.createUnaryCallable( + deleteLogTransportSettings, settings.deleteLogSettings(), clientContext); + this.writeLogEntriesCallable = + callableFactory.createBatchingCallable( + writeLogEntriesTransportSettings, settings.writeLogEntriesSettings(), clientContext); + this.listLogEntriesCallable = + callableFactory.createUnaryCallable( + listLogEntriesTransportSettings, settings.listLogEntriesSettings(), clientContext); + this.listLogEntriesPagedCallable = + callableFactory.createPagedCallable( + listLogEntriesTransportSettings, settings.listLogEntriesSettings(), clientContext); + this.listMonitoredResourceDescriptorsCallable = + callableFactory.createUnaryCallable( + listMonitoredResourceDescriptorsTransportSettings, + settings.listMonitoredResourceDescriptorsSettings(), + clientContext); + this.listMonitoredResourceDescriptorsPagedCallable = + callableFactory.createPagedCallable( + listMonitoredResourceDescriptorsTransportSettings, + settings.listMonitoredResourceDescriptorsSettings(), + clientContext); + this.listLogsCallable = + callableFactory.createUnaryCallable( + listLogsTransportSettings, settings.listLogsSettings(), clientContext); + this.listLogsPagedCallable = + callableFactory.createPagedCallable( + listLogsTransportSettings, settings.listLogsSettings(), clientContext); + this.tailLogEntriesCallable = + callableFactory.createBidiStreamingCallable( + tailLogEntriesTransportSettings, settings.tailLogEntriesSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable deleteLogCallable() { + return deleteLogCallable; + } + + @Override + public UnaryCallable writeLogEntriesCallable() { + return writeLogEntriesCallable; + } + + @Override + public UnaryCallable listLogEntriesCallable() { + return listLogEntriesCallable; + } + + @Override + public UnaryCallable + listLogEntriesPagedCallable() { + return listLogEntriesPagedCallable; + } + + @Override + public UnaryCallable< + ListMonitoredResourceDescriptorsRequest, ListMonitoredResourceDescriptorsResponse> + listMonitoredResourceDescriptorsCallable() { + return listMonitoredResourceDescriptorsCallable; + } + + @Override + public UnaryCallable< + ListMonitoredResourceDescriptorsRequest, ListMonitoredResourceDescriptorsPagedResponse> + listMonitoredResourceDescriptorsPagedCallable() { + return listMonitoredResourceDescriptorsPagedCallable; + } + + @Override + public UnaryCallable listLogsCallable() { + return listLogsCallable; + } + + @Override + public UnaryCallable listLogsPagedCallable() { + return listLogsPagedCallable; + } + + @Override + public BidiStreamingCallable + tailLogEntriesCallable() { + return tailLogEntriesCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-logging/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/GrpcMetricsServiceV2CallableFactory.java b/java-logging/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/GrpcMetricsServiceV2CallableFactory.java new file mode 100644 index 000000000000..593ca85d9029 --- /dev/null +++ b/java-logging/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/GrpcMetricsServiceV2CallableFactory.java @@ -0,0 +1,113 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.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 MetricsServiceV2 service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcMetricsServiceV2CallableFactory 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/java-logging/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/GrpcMetricsServiceV2Stub.java b/java-logging/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/GrpcMetricsServiceV2Stub.java new file mode 100644 index 000000000000..35d5d1830c7f --- /dev/null +++ b/java-logging/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/GrpcMetricsServiceV2Stub.java @@ -0,0 +1,303 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.stub; + +import static com.google.cloud.logging.v2.MetricsClient.ListLogMetricsPagedResponse; + +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.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.logging.v2.CreateLogMetricRequest; +import com.google.logging.v2.DeleteLogMetricRequest; +import com.google.logging.v2.GetLogMetricRequest; +import com.google.logging.v2.ListLogMetricsRequest; +import com.google.logging.v2.ListLogMetricsResponse; +import com.google.logging.v2.LogMetric; +import com.google.logging.v2.UpdateLogMetricRequest; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the MetricsServiceV2 service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcMetricsServiceV2Stub extends MetricsServiceV2Stub { + private static final MethodDescriptor + listLogMetricsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.logging.v2.MetricsServiceV2/ListLogMetrics") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLogMetricsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLogMetricsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + getLogMetricMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.logging.v2.MetricsServiceV2/GetLogMetric") + .setRequestMarshaller(ProtoUtils.marshaller(GetLogMetricRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(LogMetric.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + createLogMetricMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.logging.v2.MetricsServiceV2/CreateLogMetric") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateLogMetricRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(LogMetric.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + updateLogMetricMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.logging.v2.MetricsServiceV2/UpdateLogMetric") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateLogMetricRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(LogMetric.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + deleteLogMetricMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.logging.v2.MetricsServiceV2/DeleteLogMetric") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteLogMetricRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private final UnaryCallable listLogMetricsCallable; + private final UnaryCallable + listLogMetricsPagedCallable; + private final UnaryCallable getLogMetricCallable; + private final UnaryCallable createLogMetricCallable; + private final UnaryCallable updateLogMetricCallable; + private final UnaryCallable deleteLogMetricCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcMetricsServiceV2Stub create(MetricsServiceV2StubSettings settings) + throws IOException { + return new GrpcMetricsServiceV2Stub(settings, ClientContext.create(settings)); + } + + public static final GrpcMetricsServiceV2Stub create(ClientContext clientContext) + throws IOException { + return new GrpcMetricsServiceV2Stub( + MetricsServiceV2StubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcMetricsServiceV2Stub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcMetricsServiceV2Stub( + MetricsServiceV2StubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcMetricsServiceV2Stub, 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 GrpcMetricsServiceV2Stub( + MetricsServiceV2StubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcMetricsServiceV2CallableFactory()); + } + + /** + * Constructs an instance of GrpcMetricsServiceV2Stub, 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 GrpcMetricsServiceV2Stub( + MetricsServiceV2StubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings + listLogMetricsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLogMetricsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings getLogMetricTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLogMetricMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("metric_name", String.valueOf(request.getMetricName())); + return builder.build(); + }) + .build(); + GrpcCallSettings createLogMetricTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createLogMetricMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings updateLogMetricTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateLogMetricMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("metric_name", String.valueOf(request.getMetricName())); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteLogMetricTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteLogMetricMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("metric_name", String.valueOf(request.getMetricName())); + return builder.build(); + }) + .build(); + + this.listLogMetricsCallable = + callableFactory.createUnaryCallable( + listLogMetricsTransportSettings, settings.listLogMetricsSettings(), clientContext); + this.listLogMetricsPagedCallable = + callableFactory.createPagedCallable( + listLogMetricsTransportSettings, settings.listLogMetricsSettings(), clientContext); + this.getLogMetricCallable = + callableFactory.createUnaryCallable( + getLogMetricTransportSettings, settings.getLogMetricSettings(), clientContext); + this.createLogMetricCallable = + callableFactory.createUnaryCallable( + createLogMetricTransportSettings, settings.createLogMetricSettings(), clientContext); + this.updateLogMetricCallable = + callableFactory.createUnaryCallable( + updateLogMetricTransportSettings, settings.updateLogMetricSettings(), clientContext); + this.deleteLogMetricCallable = + callableFactory.createUnaryCallable( + deleteLogMetricTransportSettings, settings.deleteLogMetricSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable listLogMetricsCallable() { + return listLogMetricsCallable; + } + + @Override + public UnaryCallable + listLogMetricsPagedCallable() { + return listLogMetricsPagedCallable; + } + + @Override + public UnaryCallable getLogMetricCallable() { + return getLogMetricCallable; + } + + @Override + public UnaryCallable createLogMetricCallable() { + return createLogMetricCallable; + } + + @Override + public UnaryCallable updateLogMetricCallable() { + return updateLogMetricCallable; + } + + @Override + public UnaryCallable deleteLogMetricCallable() { + return deleteLogMetricCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-logging/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/LoggingServiceV2Stub.java b/java-logging/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/LoggingServiceV2Stub.java new file mode 100644 index 000000000000..63c959ef2d41 --- /dev/null +++ b/java-logging/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/LoggingServiceV2Stub.java @@ -0,0 +1,95 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.stub; + +import static com.google.cloud.logging.v2.LoggingClient.ListLogEntriesPagedResponse; +import static com.google.cloud.logging.v2.LoggingClient.ListLogsPagedResponse; +import static com.google.cloud.logging.v2.LoggingClient.ListMonitoredResourceDescriptorsPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.logging.v2.DeleteLogRequest; +import com.google.logging.v2.ListLogEntriesRequest; +import com.google.logging.v2.ListLogEntriesResponse; +import com.google.logging.v2.ListLogsRequest; +import com.google.logging.v2.ListLogsResponse; +import com.google.logging.v2.ListMonitoredResourceDescriptorsRequest; +import com.google.logging.v2.ListMonitoredResourceDescriptorsResponse; +import com.google.logging.v2.TailLogEntriesRequest; +import com.google.logging.v2.TailLogEntriesResponse; +import com.google.logging.v2.WriteLogEntriesRequest; +import com.google.logging.v2.WriteLogEntriesResponse; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the LoggingServiceV2 service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class LoggingServiceV2Stub implements BackgroundResource { + + public UnaryCallable deleteLogCallable() { + throw new UnsupportedOperationException("Not implemented: deleteLogCallable()"); + } + + public UnaryCallable writeLogEntriesCallable() { + throw new UnsupportedOperationException("Not implemented: writeLogEntriesCallable()"); + } + + public UnaryCallable + listLogEntriesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLogEntriesPagedCallable()"); + } + + public UnaryCallable listLogEntriesCallable() { + throw new UnsupportedOperationException("Not implemented: listLogEntriesCallable()"); + } + + public UnaryCallable< + ListMonitoredResourceDescriptorsRequest, ListMonitoredResourceDescriptorsPagedResponse> + listMonitoredResourceDescriptorsPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: listMonitoredResourceDescriptorsPagedCallable()"); + } + + public UnaryCallable< + ListMonitoredResourceDescriptorsRequest, ListMonitoredResourceDescriptorsResponse> + listMonitoredResourceDescriptorsCallable() { + throw new UnsupportedOperationException( + "Not implemented: listMonitoredResourceDescriptorsCallable()"); + } + + public UnaryCallable listLogsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLogsPagedCallable()"); + } + + public UnaryCallable listLogsCallable() { + throw new UnsupportedOperationException("Not implemented: listLogsCallable()"); + } + + public BidiStreamingCallable + tailLogEntriesCallable() { + throw new UnsupportedOperationException("Not implemented: tailLogEntriesCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-logging/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/LoggingServiceV2StubSettings.java b/java-logging/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/LoggingServiceV2StubSettings.java new file mode 100644 index 000000000000..2320f900eedf --- /dev/null +++ b/java-logging/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/LoggingServiceV2StubSettings.java @@ -0,0 +1,762 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.stub; + +import static com.google.cloud.logging.v2.LoggingClient.ListLogEntriesPagedResponse; +import static com.google.cloud.logging.v2.LoggingClient.ListLogsPagedResponse; +import static com.google.cloud.logging.v2.LoggingClient.ListMonitoredResourceDescriptorsPagedResponse; + +import com.google.api.MonitoredResourceDescriptor; +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ObsoleteApi; +import com.google.api.gax.batching.BatchingSettings; +import com.google.api.gax.batching.FlowControlSettings; +import com.google.api.gax.batching.FlowController; +import com.google.api.gax.batching.PartitionKey; +import com.google.api.gax.batching.RequestBuilder; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.BatchedRequestIssuer; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BatchingDescriptor; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.logging.v2.DeleteLogRequest; +import com.google.logging.v2.ListLogEntriesRequest; +import com.google.logging.v2.ListLogEntriesResponse; +import com.google.logging.v2.ListLogsRequest; +import com.google.logging.v2.ListLogsResponse; +import com.google.logging.v2.ListMonitoredResourceDescriptorsRequest; +import com.google.logging.v2.ListMonitoredResourceDescriptorsResponse; +import com.google.logging.v2.LogEntry; +import com.google.logging.v2.TailLogEntriesRequest; +import com.google.logging.v2.TailLogEntriesResponse; +import com.google.logging.v2.WriteLogEntriesRequest; +import com.google.logging.v2.WriteLogEntriesResponse; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.time.Duration; +import java.util.Collection; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link LoggingServiceV2Stub}. + * + *

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

    + *
  • The default service address (logging.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 + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of deleteLog: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * LoggingServiceV2StubSettings.Builder loggingSettingsBuilder =
+ *     LoggingServiceV2StubSettings.newBuilder();
+ * loggingSettingsBuilder
+ *     .deleteLogSettings()
+ *     .setRetrySettings(
+ *         loggingSettingsBuilder
+ *             .deleteLogSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeoutDuration(Duration.ofSeconds(300))
+ *             .build());
+ * LoggingServiceV2StubSettings loggingSettings = loggingSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. + */ +@Generated("by gapic-generator-java") +public class LoggingServiceV2StubSettings 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/cloud-platform.read-only") + .add("https://www.googleapis.com/auth/logging.admin") + .add("https://www.googleapis.com/auth/logging.read") + .add("https://www.googleapis.com/auth/logging.write") + .build(); + + private final UnaryCallSettings deleteLogSettings; + private final BatchingCallSettings + writeLogEntriesSettings; + private final PagedCallSettings< + ListLogEntriesRequest, ListLogEntriesResponse, ListLogEntriesPagedResponse> + listLogEntriesSettings; + private final PagedCallSettings< + ListMonitoredResourceDescriptorsRequest, + ListMonitoredResourceDescriptorsResponse, + ListMonitoredResourceDescriptorsPagedResponse> + listMonitoredResourceDescriptorsSettings; + private final PagedCallSettings + listLogsSettings; + private final StreamingCallSettings + tailLogEntriesSettings; + + private static final PagedListDescriptor + LIST_LOG_ENTRIES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLogEntriesRequest injectToken(ListLogEntriesRequest payload, String token) { + return ListLogEntriesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLogEntriesRequest injectPageSize( + ListLogEntriesRequest payload, int pageSize) { + return ListLogEntriesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLogEntriesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLogEntriesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLogEntriesResponse payload) { + return payload.getEntriesList(); + } + }; + + private static final PagedListDescriptor< + ListMonitoredResourceDescriptorsRequest, + ListMonitoredResourceDescriptorsResponse, + MonitoredResourceDescriptor> + LIST_MONITORED_RESOURCE_DESCRIPTORS_PAGE_STR_DESC = + new PagedListDescriptor< + ListMonitoredResourceDescriptorsRequest, + ListMonitoredResourceDescriptorsResponse, + MonitoredResourceDescriptor>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListMonitoredResourceDescriptorsRequest injectToken( + ListMonitoredResourceDescriptorsRequest payload, String token) { + return ListMonitoredResourceDescriptorsRequest.newBuilder(payload) + .setPageToken(token) + .build(); + } + + @Override + public ListMonitoredResourceDescriptorsRequest injectPageSize( + ListMonitoredResourceDescriptorsRequest payload, int pageSize) { + return ListMonitoredResourceDescriptorsRequest.newBuilder(payload) + .setPageSize(pageSize) + .build(); + } + + @Override + public Integer extractPageSize(ListMonitoredResourceDescriptorsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListMonitoredResourceDescriptorsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + ListMonitoredResourceDescriptorsResponse payload) { + return payload.getResourceDescriptorsList(); + } + }; + + private static final PagedListDescriptor + LIST_LOGS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLogsRequest injectToken(ListLogsRequest payload, String token) { + return ListLogsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLogsRequest injectPageSize(ListLogsRequest payload, int pageSize) { + return ListLogsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLogsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLogsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLogsResponse payload) { + return payload.getLogNamesList(); + } + }; + + private static final PagedListResponseFactory< + ListLogEntriesRequest, ListLogEntriesResponse, ListLogEntriesPagedResponse> + LIST_LOG_ENTRIES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListLogEntriesRequest, ListLogEntriesResponse, ListLogEntriesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLogEntriesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_LOG_ENTRIES_PAGE_STR_DESC, request, context); + return ListLogEntriesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListMonitoredResourceDescriptorsRequest, + ListMonitoredResourceDescriptorsResponse, + ListMonitoredResourceDescriptorsPagedResponse> + LIST_MONITORED_RESOURCE_DESCRIPTORS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListMonitoredResourceDescriptorsRequest, + ListMonitoredResourceDescriptorsResponse, + ListMonitoredResourceDescriptorsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable< + ListMonitoredResourceDescriptorsRequest, + ListMonitoredResourceDescriptorsResponse> + callable, + ListMonitoredResourceDescriptorsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + ListMonitoredResourceDescriptorsRequest, + ListMonitoredResourceDescriptorsResponse, + MonitoredResourceDescriptor> + pageContext = + PageContext.create( + callable, + LIST_MONITORED_RESOURCE_DESCRIPTORS_PAGE_STR_DESC, + request, + context); + return ListMonitoredResourceDescriptorsPagedResponse.createAsync( + pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListLogsRequest, ListLogsResponse, ListLogsPagedResponse> + LIST_LOGS_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLogsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_LOGS_PAGE_STR_DESC, request, context); + return ListLogsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final BatchingDescriptor + WRITE_LOG_ENTRIES_BATCHING_DESC = + new BatchingDescriptor() { + @Override + public PartitionKey getBatchPartitionKey(WriteLogEntriesRequest request) { + return new PartitionKey( + request.getLogName(), request.getResource(), request.getLabels()); + } + + @Override + public RequestBuilder getRequestBuilder() { + return new RequestBuilder() { + private WriteLogEntriesRequest.Builder builder; + + @Override + public void appendRequest(WriteLogEntriesRequest request) { + if (builder == null) { + builder = request.toBuilder(); + } else { + builder.addAllEntries(request.getEntriesList()); + } + } + + @Override + public WriteLogEntriesRequest build() { + return builder.build(); + } + }; + } + + @Override + public void splitResponse( + WriteLogEntriesResponse batchResponse, + Collection> batch) { + for (BatchedRequestIssuer responder : batch) { + WriteLogEntriesResponse response = WriteLogEntriesResponse.newBuilder().build(); + responder.setResponse(response); + } + } + + @Override + public void splitException( + Throwable throwable, + Collection> batch) { + for (BatchedRequestIssuer responder : batch) { + responder.setException(throwable); + } + } + + @Override + public long countElements(WriteLogEntriesRequest request) { + return request.getEntriesCount(); + } + + @Override + public long countBytes(WriteLogEntriesRequest request) { + return request.getSerializedSize(); + } + }; + + /** Returns the object with the settings used for calls to deleteLog. */ + public UnaryCallSettings deleteLogSettings() { + return deleteLogSettings; + } + + /** Returns the object with the settings used for calls to writeLogEntries. */ + public BatchingCallSettings + writeLogEntriesSettings() { + return writeLogEntriesSettings; + } + + /** Returns the object with the settings used for calls to listLogEntries. */ + public PagedCallSettings< + ListLogEntriesRequest, ListLogEntriesResponse, ListLogEntriesPagedResponse> + listLogEntriesSettings() { + return listLogEntriesSettings; + } + + /** Returns the object with the settings used for calls to listMonitoredResourceDescriptors. */ + public PagedCallSettings< + ListMonitoredResourceDescriptorsRequest, + ListMonitoredResourceDescriptorsResponse, + ListMonitoredResourceDescriptorsPagedResponse> + listMonitoredResourceDescriptorsSettings() { + return listMonitoredResourceDescriptorsSettings; + } + + /** Returns the object with the settings used for calls to listLogs. */ + public PagedCallSettings + listLogsSettings() { + return listLogsSettings; + } + + /** Returns the object with the settings used for calls to tailLogEntries. */ + public StreamingCallSettings + tailLogEntriesSettings() { + return tailLogEntriesSettings; + } + + public LoggingServiceV2Stub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcLoggingServiceV2Stub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "logging"; + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + @ObsoleteApi("Use getEndpoint() instead") + public static String getDefaultEndpoint() { + return "logging.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "logging.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(LoggingServiceV2StubSettings.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 LoggingServiceV2StubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + deleteLogSettings = settingsBuilder.deleteLogSettings().build(); + writeLogEntriesSettings = settingsBuilder.writeLogEntriesSettings().build(); + listLogEntriesSettings = settingsBuilder.listLogEntriesSettings().build(); + listMonitoredResourceDescriptorsSettings = + settingsBuilder.listMonitoredResourceDescriptorsSettings().build(); + listLogsSettings = settingsBuilder.listLogsSettings().build(); + tailLogEntriesSettings = settingsBuilder.tailLogEntriesSettings().build(); + } + + /** Builder for LoggingServiceV2StubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder deleteLogSettings; + private final BatchingCallSettings.Builder + writeLogEntriesSettings; + private final PagedCallSettings.Builder< + ListLogEntriesRequest, ListLogEntriesResponse, ListLogEntriesPagedResponse> + listLogEntriesSettings; + private final PagedCallSettings.Builder< + ListMonitoredResourceDescriptorsRequest, + ListMonitoredResourceDescriptorsResponse, + ListMonitoredResourceDescriptorsPagedResponse> + listMonitoredResourceDescriptorsSettings; + private final PagedCallSettings.Builder< + ListLogsRequest, ListLogsResponse, ListLogsPagedResponse> + listLogsSettings; + private final StreamingCallSettings.Builder + tailLogEntriesSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_1_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.DEADLINE_EXCEEDED, + StatusCode.Code.INTERNAL, + StatusCode.Code.UNAVAILABLE))); + definitions.put( + "retry_policy_2_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.DEADLINE_EXCEEDED, + StatusCode.Code.INTERNAL, + StatusCode.Code.UNAVAILABLE))); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelayDuration(Duration.ofMillis(60000L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setTotalTimeoutDuration(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_1_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelayDuration(Duration.ofMillis(60000L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(3600000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(3600000L)) + .setTotalTimeoutDuration(Duration.ofMillis(3600000L)) + .build(); + definitions.put("retry_policy_2_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + deleteLogSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + writeLogEntriesSettings = + BatchingCallSettings.newBuilder(WRITE_LOG_ENTRIES_BATCHING_DESC) + .setBatchingSettings(BatchingSettings.newBuilder().build()); + listLogEntriesSettings = PagedCallSettings.newBuilder(LIST_LOG_ENTRIES_PAGE_STR_FACT); + listMonitoredResourceDescriptorsSettings = + PagedCallSettings.newBuilder(LIST_MONITORED_RESOURCE_DESCRIPTORS_PAGE_STR_FACT); + listLogsSettings = PagedCallSettings.newBuilder(LIST_LOGS_PAGE_STR_FACT); + tailLogEntriesSettings = StreamingCallSettings.newBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + deleteLogSettings, + writeLogEntriesSettings, + listLogEntriesSettings, + listMonitoredResourceDescriptorsSettings, + listLogsSettings); + initDefaults(this); + } + + protected Builder(LoggingServiceV2StubSettings settings) { + super(settings); + + deleteLogSettings = settings.deleteLogSettings.toBuilder(); + writeLogEntriesSettings = settings.writeLogEntriesSettings.toBuilder(); + listLogEntriesSettings = settings.listLogEntriesSettings.toBuilder(); + listMonitoredResourceDescriptorsSettings = + settings.listMonitoredResourceDescriptorsSettings.toBuilder(); + listLogsSettings = settings.listLogsSettings.toBuilder(); + tailLogEntriesSettings = settings.tailLogEntriesSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + deleteLogSettings, + writeLogEntriesSettings, + listLogEntriesSettings, + listMonitoredResourceDescriptorsSettings, + listLogsSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .deleteLogSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .writeLogEntriesSettings() + .setBatchingSettings( + BatchingSettings.newBuilder() + .setElementCountThreshold(1000L) + .setRequestByteThreshold(1048576L) + .setDelayThresholdDuration(Duration.ofMillis(50L)) + .setFlowControlSettings( + FlowControlSettings.newBuilder() + .setMaxOutstandingElementCount(100000L) + .setMaxOutstandingRequestBytes(10485760L) + .setLimitExceededBehavior( + FlowController.LimitExceededBehavior.ThrowException) + .build()) + .build()); + + builder + .writeLogEntriesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .listLogEntriesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .listMonitoredResourceDescriptorsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + builder + .listLogsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to deleteLog. */ + public UnaryCallSettings.Builder deleteLogSettings() { + return deleteLogSettings; + } + + /** Returns the builder for the settings used for calls to writeLogEntries. */ + public BatchingCallSettings.Builder + writeLogEntriesSettings() { + return writeLogEntriesSettings; + } + + /** Returns the builder for the settings used for calls to listLogEntries. */ + public PagedCallSettings.Builder< + ListLogEntriesRequest, ListLogEntriesResponse, ListLogEntriesPagedResponse> + listLogEntriesSettings() { + return listLogEntriesSettings; + } + + /** Returns the builder for the settings used for calls to listMonitoredResourceDescriptors. */ + public PagedCallSettings.Builder< + ListMonitoredResourceDescriptorsRequest, + ListMonitoredResourceDescriptorsResponse, + ListMonitoredResourceDescriptorsPagedResponse> + listMonitoredResourceDescriptorsSettings() { + return listMonitoredResourceDescriptorsSettings; + } + + /** Returns the builder for the settings used for calls to listLogs. */ + public PagedCallSettings.Builder + listLogsSettings() { + return listLogsSettings; + } + + /** Returns the builder for the settings used for calls to tailLogEntries. */ + public StreamingCallSettings.Builder + tailLogEntriesSettings() { + return tailLogEntriesSettings; + } + + @Override + public LoggingServiceV2StubSettings build() throws IOException { + return new LoggingServiceV2StubSettings(this); + } + } +} diff --git a/java-logging/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/MetricsServiceV2Stub.java b/java-logging/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/MetricsServiceV2Stub.java new file mode 100644 index 000000000000..14e6fdd3de35 --- /dev/null +++ b/java-logging/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/MetricsServiceV2Stub.java @@ -0,0 +1,69 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.stub; + +import static com.google.cloud.logging.v2.MetricsClient.ListLogMetricsPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.logging.v2.CreateLogMetricRequest; +import com.google.logging.v2.DeleteLogMetricRequest; +import com.google.logging.v2.GetLogMetricRequest; +import com.google.logging.v2.ListLogMetricsRequest; +import com.google.logging.v2.ListLogMetricsResponse; +import com.google.logging.v2.LogMetric; +import com.google.logging.v2.UpdateLogMetricRequest; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the MetricsServiceV2 service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class MetricsServiceV2Stub implements BackgroundResource { + + public UnaryCallable + listLogMetricsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLogMetricsPagedCallable()"); + } + + public UnaryCallable listLogMetricsCallable() { + throw new UnsupportedOperationException("Not implemented: listLogMetricsCallable()"); + } + + public UnaryCallable getLogMetricCallable() { + throw new UnsupportedOperationException("Not implemented: getLogMetricCallable()"); + } + + public UnaryCallable createLogMetricCallable() { + throw new UnsupportedOperationException("Not implemented: createLogMetricCallable()"); + } + + public UnaryCallable updateLogMetricCallable() { + throw new UnsupportedOperationException("Not implemented: updateLogMetricCallable()"); + } + + public UnaryCallable deleteLogMetricCallable() { + throw new UnsupportedOperationException("Not implemented: deleteLogMetricCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-logging/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/MetricsServiceV2StubSettings.java b/java-logging/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/MetricsServiceV2StubSettings.java new file mode 100644 index 000000000000..b4786a31ad97 --- /dev/null +++ b/java-logging/google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/MetricsServiceV2StubSettings.java @@ -0,0 +1,483 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.stub; + +import static com.google.cloud.logging.v2.MetricsClient.ListLogMetricsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ObsoleteApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.logging.v2.CreateLogMetricRequest; +import com.google.logging.v2.DeleteLogMetricRequest; +import com.google.logging.v2.GetLogMetricRequest; +import com.google.logging.v2.ListLogMetricsRequest; +import com.google.logging.v2.ListLogMetricsResponse; +import com.google.logging.v2.LogMetric; +import com.google.logging.v2.UpdateLogMetricRequest; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.time.Duration; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link MetricsServiceV2Stub}. + * + *

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

    + *
  • The default service address (logging.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 + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of getLogMetric: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * MetricsServiceV2StubSettings.Builder metricsSettingsBuilder =
+ *     MetricsServiceV2StubSettings.newBuilder();
+ * metricsSettingsBuilder
+ *     .getLogMetricSettings()
+ *     .setRetrySettings(
+ *         metricsSettingsBuilder
+ *             .getLogMetricSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeoutDuration(Duration.ofSeconds(300))
+ *             .build());
+ * MetricsServiceV2StubSettings metricsSettings = metricsSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. + */ +@Generated("by gapic-generator-java") +public class MetricsServiceV2StubSettings 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/cloud-platform.read-only") + .add("https://www.googleapis.com/auth/logging.admin") + .add("https://www.googleapis.com/auth/logging.read") + .add("https://www.googleapis.com/auth/logging.write") + .build(); + + private final PagedCallSettings< + ListLogMetricsRequest, ListLogMetricsResponse, ListLogMetricsPagedResponse> + listLogMetricsSettings; + private final UnaryCallSettings getLogMetricSettings; + private final UnaryCallSettings createLogMetricSettings; + private final UnaryCallSettings updateLogMetricSettings; + private final UnaryCallSettings deleteLogMetricSettings; + + private static final PagedListDescriptor + LIST_LOG_METRICS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLogMetricsRequest injectToken(ListLogMetricsRequest payload, String token) { + return ListLogMetricsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLogMetricsRequest injectPageSize( + ListLogMetricsRequest payload, int pageSize) { + return ListLogMetricsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLogMetricsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLogMetricsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLogMetricsResponse payload) { + return payload.getMetricsList(); + } + }; + + private static final PagedListResponseFactory< + ListLogMetricsRequest, ListLogMetricsResponse, ListLogMetricsPagedResponse> + LIST_LOG_METRICS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListLogMetricsRequest, ListLogMetricsResponse, ListLogMetricsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLogMetricsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_LOG_METRICS_PAGE_STR_DESC, request, context); + return ListLogMetricsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to listLogMetrics. */ + public PagedCallSettings< + ListLogMetricsRequest, ListLogMetricsResponse, ListLogMetricsPagedResponse> + listLogMetricsSettings() { + return listLogMetricsSettings; + } + + /** Returns the object with the settings used for calls to getLogMetric. */ + public UnaryCallSettings getLogMetricSettings() { + return getLogMetricSettings; + } + + /** Returns the object with the settings used for calls to createLogMetric. */ + public UnaryCallSettings createLogMetricSettings() { + return createLogMetricSettings; + } + + /** Returns the object with the settings used for calls to updateLogMetric. */ + public UnaryCallSettings updateLogMetricSettings() { + return updateLogMetricSettings; + } + + /** Returns the object with the settings used for calls to deleteLogMetric. */ + public UnaryCallSettings deleteLogMetricSettings() { + return deleteLogMetricSettings; + } + + public MetricsServiceV2Stub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcMetricsServiceV2Stub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "logging"; + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + @ObsoleteApi("Use getEndpoint() instead") + public static String getDefaultEndpoint() { + return "logging.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "logging.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(MetricsServiceV2StubSettings.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 MetricsServiceV2StubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listLogMetricsSettings = settingsBuilder.listLogMetricsSettings().build(); + getLogMetricSettings = settingsBuilder.getLogMetricSettings().build(); + createLogMetricSettings = settingsBuilder.createLogMetricSettings().build(); + updateLogMetricSettings = settingsBuilder.updateLogMetricSettings().build(); + deleteLogMetricSettings = settingsBuilder.deleteLogMetricSettings().build(); + } + + /** Builder for MetricsServiceV2StubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final PagedCallSettings.Builder< + ListLogMetricsRequest, ListLogMetricsResponse, ListLogMetricsPagedResponse> + listLogMetricsSettings; + private final UnaryCallSettings.Builder getLogMetricSettings; + private final UnaryCallSettings.Builder + createLogMetricSettings; + private final UnaryCallSettings.Builder + updateLogMetricSettings; + private final UnaryCallSettings.Builder deleteLogMetricSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_5_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.DEADLINE_EXCEEDED, + StatusCode.Code.INTERNAL, + StatusCode.Code.UNAVAILABLE))); + definitions.put( + "no_retry_0_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() + .setInitialRetryDelayDuration(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelayDuration(Duration.ofMillis(60000L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setTotalTimeoutDuration(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_5_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setTotalTimeoutDuration(Duration.ofMillis(60000L)) + .build(); + definitions.put("no_retry_0_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + listLogMetricsSettings = PagedCallSettings.newBuilder(LIST_LOG_METRICS_PAGE_STR_FACT); + getLogMetricSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createLogMetricSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateLogMetricSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteLogMetricSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listLogMetricsSettings, + getLogMetricSettings, + createLogMetricSettings, + updateLogMetricSettings, + deleteLogMetricSettings); + initDefaults(this); + } + + protected Builder(MetricsServiceV2StubSettings settings) { + super(settings); + + listLogMetricsSettings = settings.listLogMetricsSettings.toBuilder(); + getLogMetricSettings = settings.getLogMetricSettings.toBuilder(); + createLogMetricSettings = settings.createLogMetricSettings.toBuilder(); + updateLogMetricSettings = settings.updateLogMetricSettings.toBuilder(); + deleteLogMetricSettings = settings.deleteLogMetricSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listLogMetricsSettings, + getLogMetricSettings, + createLogMetricSettings, + updateLogMetricSettings, + deleteLogMetricSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .listLogMetricsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_5_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_5_params")); + + builder + .getLogMetricSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_5_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_5_params")); + + builder + .createLogMetricSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .updateLogMetricSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_5_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_5_params")); + + builder + .deleteLogMetricSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_5_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_5_params")); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to listLogMetrics. */ + public PagedCallSettings.Builder< + ListLogMetricsRequest, ListLogMetricsResponse, ListLogMetricsPagedResponse> + listLogMetricsSettings() { + return listLogMetricsSettings; + } + + /** Returns the builder for the settings used for calls to getLogMetric. */ + public UnaryCallSettings.Builder getLogMetricSettings() { + return getLogMetricSettings; + } + + /** Returns the builder for the settings used for calls to createLogMetric. */ + public UnaryCallSettings.Builder createLogMetricSettings() { + return createLogMetricSettings; + } + + /** Returns the builder for the settings used for calls to updateLogMetric. */ + public UnaryCallSettings.Builder updateLogMetricSettings() { + return updateLogMetricSettings; + } + + /** Returns the builder for the settings used for calls to deleteLogMetric. */ + public UnaryCallSettings.Builder deleteLogMetricSettings() { + return deleteLogMetricSettings; + } + + @Override + public MetricsServiceV2StubSettings build() throws IOException { + return new MetricsServiceV2StubSettings(this); + } + } +} diff --git a/java-logging/google-cloud-logging/src/main/resources/META-INF/native-image/com.google.cloud.logging.v2/reflect-config.json b/java-logging/google-cloud-logging/src/main/resources/META-INF/native-image/com.google.cloud.logging.v2/reflect-config.json new file mode 100644 index 000000000000..0d781d4b280e --- /dev/null +++ b/java-logging/google-cloud-logging/src/main/resources/META-INF/native-image/com.google.cloud.logging.v2/reflect-config.json @@ -0,0 +1,3161 @@ +[ + { + "name": "com.google.api.ClientLibraryDestination", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibraryOrganization", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibrarySettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibrarySettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CommonLanguageSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CommonLanguageSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CppSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CppSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CustomHttpPattern", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CustomHttpPattern$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Distribution", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Distribution$BucketOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Distribution$BucketOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Distribution$BucketOptions$Explicit", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Distribution$BucketOptions$Explicit$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Distribution$BucketOptions$Exponential", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Distribution$BucketOptions$Exponential$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Distribution$BucketOptions$Linear", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Distribution$BucketOptions$Linear$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Distribution$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Distribution$Exemplar", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Distribution$Exemplar$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Distribution$Range", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Distribution$Range$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.DotnetSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.DotnetSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.FieldBehavior", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.GoSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.GoSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Http", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Http$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.HttpRule", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.HttpRule$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.JavaSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.JavaSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.LabelDescriptor", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.LabelDescriptor$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.LabelDescriptor$ValueType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.LaunchStage", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$LongRunning", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$LongRunning$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Metric", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Metric$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MetricDescriptor", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MetricDescriptor$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MetricDescriptor$MetricDescriptorMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MetricDescriptor$MetricDescriptorMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MetricDescriptor$MetricDescriptorMetadata$TimeSeriesResourceHierarchyLevel", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MetricDescriptor$MetricKind", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MetricDescriptor$ValueType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MonitoredResource", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MonitoredResource$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MonitoredResourceDescriptor", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MonitoredResourceDescriptor$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MonitoredResourceMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MonitoredResourceMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.NodeSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.NodeSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PhpSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PhpSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Publishing", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Publishing$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings$ExperimentalFeatures", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings$ExperimentalFeatures$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$History", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$Style", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceReference", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceReference$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RubySettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RubySettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.SelectiveGapicGeneration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.SelectiveGapicGeneration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.type.HttpRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.type.HttpRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.type.LogSeverity", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.BigQueryDataset", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.BigQueryDataset$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.BigQueryOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.BigQueryOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.BucketMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.BucketMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.CmekSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.CmekSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.CopyLogEntriesMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.CopyLogEntriesMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.CopyLogEntriesRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.CopyLogEntriesRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.CopyLogEntriesResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.CopyLogEntriesResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.CreateBucketRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.CreateBucketRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.CreateExclusionRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.CreateExclusionRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.CreateLinkRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.CreateLinkRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.CreateLogMetricRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.CreateLogMetricRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.CreateSinkRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.CreateSinkRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.CreateViewRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.CreateViewRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.DeleteBucketRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.DeleteBucketRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.DeleteExclusionRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.DeleteExclusionRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.DeleteLinkRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.DeleteLinkRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.DeleteLogMetricRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.DeleteLogMetricRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.DeleteLogRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.DeleteLogRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.DeleteSinkRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.DeleteSinkRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.DeleteViewRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.DeleteViewRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.GetBucketRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.GetBucketRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.GetCmekSettingsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.GetCmekSettingsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.GetExclusionRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.GetExclusionRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.GetLinkRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.GetLinkRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.GetLogMetricRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.GetLogMetricRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.GetSettingsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.GetSettingsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.GetSinkRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.GetSinkRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.GetViewRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.GetViewRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.IndexConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.IndexConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.IndexType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.LifecycleState", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.Link", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.Link$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.LinkMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.LinkMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.ListBucketsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.ListBucketsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.ListBucketsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.ListBucketsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.ListExclusionsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.ListExclusionsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.ListExclusionsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.ListExclusionsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.ListLinksRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.ListLinksRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.ListLinksResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.ListLinksResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.ListLogEntriesRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.ListLogEntriesRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.ListLogEntriesResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.ListLogEntriesResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.ListLogMetricsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.ListLogMetricsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.ListLogMetricsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.ListLogMetricsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.ListLogsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.ListLogsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.ListLogsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.ListLogsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.ListMonitoredResourceDescriptorsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.ListMonitoredResourceDescriptorsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.ListMonitoredResourceDescriptorsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.ListMonitoredResourceDescriptorsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.ListSinksRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.ListSinksRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.ListSinksResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.ListSinksResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.ListViewsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.ListViewsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.ListViewsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.ListViewsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.LocationMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.LocationMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.LogBucket", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.LogBucket$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.LogEntry", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.LogEntry$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.LogEntryOperation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.LogEntryOperation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.LogEntrySourceLocation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.LogEntrySourceLocation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.LogExclusion", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.LogExclusion$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.LogMetric", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.LogMetric$ApiVersion", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.LogMetric$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.LogSink", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.LogSink$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.LogSink$VersionFormat", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.LogSplit", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.LogSplit$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.LogView", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.LogView$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.OperationState", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.Settings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.Settings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.TailLogEntriesRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.TailLogEntriesRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.TailLogEntriesResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.TailLogEntriesResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.TailLogEntriesResponse$SuppressionInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.TailLogEntriesResponse$SuppressionInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.TailLogEntriesResponse$SuppressionInfo$Reason", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.UndeleteBucketRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.UndeleteBucketRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.UpdateBucketRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.UpdateBucketRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.UpdateCmekSettingsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.UpdateCmekSettingsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.UpdateExclusionRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.UpdateExclusionRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.UpdateLogMetricRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.UpdateLogMetricRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.UpdateSettingsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.UpdateSettingsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.UpdateSinkRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.UpdateSinkRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.UpdateViewRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.UpdateViewRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.WriteLogEntriesPartialErrors", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.WriteLogEntriesPartialErrors$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.WriteLogEntriesRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.WriteLogEntriesRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.WriteLogEntriesResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.logging.v2.WriteLogEntriesResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.CancelOperationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.CancelOperationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.DeleteOperationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.DeleteOperationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.GetOperationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.GetOperationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.ListOperationsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.ListOperationsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.ListOperationsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.ListOperationsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.Operation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.Operation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.OperationInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.OperationInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.WaitOperationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.WaitOperationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Any", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Any$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ExtensionRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ExtensionRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ReservedRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ReservedRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$Edition", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$EnumReservedRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$EnumReservedRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Declaration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Declaration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$VerificationState", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$EnumType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$FieldPresence", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$JsonFormat", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$MessageEncoding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$RepeatedFieldEncoding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$Utf8Validation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults$FeatureSetEditionDefault", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults$FeatureSetEditionDefault$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Label", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Type", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$CType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$EditionDefault", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$EditionDefault$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$JSType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$OptionRetention", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$OptionTargetType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorSet", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorSet$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions$OptimizeMode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation$Semantic", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MessageOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MessageOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions$IdempotencyLevel", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Location", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Location$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$NamePart", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$NamePart$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Duration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Duration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Empty", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Empty$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.FieldMask", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.FieldMask$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.ListValue", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.ListValue$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.NullValue", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Struct", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Struct$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Timestamp", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Timestamp$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Value", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Value$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.Status", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.Status$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + } +] \ No newline at end of file diff --git a/java-logging/google-cloud-logging/src/test/java/com/google/cloud/logging/v2/ConfigClientTest.java b/java-logging/google-cloud-logging/src/test/java/com/google/cloud/logging/v2/ConfigClientTest.java new file mode 100644 index 000000000000..e4a8e877003b --- /dev/null +++ b/java-logging/google-cloud-logging/src/test/java/com/google/cloud/logging/v2/ConfigClientTest.java @@ -0,0 +1,3269 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2; + +import static com.google.cloud.logging.v2.ConfigClient.ListBucketsPagedResponse; +import static com.google.cloud.logging.v2.ConfigClient.ListExclusionsPagedResponse; +import static com.google.cloud.logging.v2.ConfigClient.ListLinksPagedResponse; +import static com.google.cloud.logging.v2.ConfigClient.ListSinksPagedResponse; +import static com.google.cloud.logging.v2.ConfigClient.ListViewsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.common.collect.Lists; +import com.google.logging.v2.BigQueryDataset; +import com.google.logging.v2.BillingAccountLocationName; +import com.google.logging.v2.BillingAccountName; +import com.google.logging.v2.CmekSettings; +import com.google.logging.v2.CmekSettingsName; +import com.google.logging.v2.CopyLogEntriesRequest; +import com.google.logging.v2.CopyLogEntriesResponse; +import com.google.logging.v2.CreateBucketRequest; +import com.google.logging.v2.CreateExclusionRequest; +import com.google.logging.v2.CreateLinkRequest; +import com.google.logging.v2.CreateSinkRequest; +import com.google.logging.v2.CreateViewRequest; +import com.google.logging.v2.DeleteBucketRequest; +import com.google.logging.v2.DeleteExclusionRequest; +import com.google.logging.v2.DeleteLinkRequest; +import com.google.logging.v2.DeleteSinkRequest; +import com.google.logging.v2.DeleteViewRequest; +import com.google.logging.v2.FolderLocationName; +import com.google.logging.v2.FolderName; +import com.google.logging.v2.GetBucketRequest; +import com.google.logging.v2.GetCmekSettingsRequest; +import com.google.logging.v2.GetExclusionRequest; +import com.google.logging.v2.GetLinkRequest; +import com.google.logging.v2.GetSettingsRequest; +import com.google.logging.v2.GetSinkRequest; +import com.google.logging.v2.GetViewRequest; +import com.google.logging.v2.IndexConfig; +import com.google.logging.v2.LifecycleState; +import com.google.logging.v2.Link; +import com.google.logging.v2.LinkName; +import com.google.logging.v2.ListBucketsRequest; +import com.google.logging.v2.ListBucketsResponse; +import com.google.logging.v2.ListExclusionsRequest; +import com.google.logging.v2.ListExclusionsResponse; +import com.google.logging.v2.ListLinksRequest; +import com.google.logging.v2.ListLinksResponse; +import com.google.logging.v2.ListSinksRequest; +import com.google.logging.v2.ListSinksResponse; +import com.google.logging.v2.ListViewsRequest; +import com.google.logging.v2.ListViewsResponse; +import com.google.logging.v2.LocationName; +import com.google.logging.v2.LogBucket; +import com.google.logging.v2.LogBucketName; +import com.google.logging.v2.LogExclusion; +import com.google.logging.v2.LogExclusionName; +import com.google.logging.v2.LogSink; +import com.google.logging.v2.LogSinkName; +import com.google.logging.v2.LogView; +import com.google.logging.v2.LogViewName; +import com.google.logging.v2.OrganizationLocationName; +import com.google.logging.v2.OrganizationName; +import com.google.logging.v2.ProjectName; +import com.google.logging.v2.Settings; +import com.google.logging.v2.SettingsName; +import com.google.logging.v2.UndeleteBucketRequest; +import com.google.logging.v2.UpdateBucketRequest; +import com.google.logging.v2.UpdateCmekSettingsRequest; +import com.google.logging.v2.UpdateExclusionRequest; +import com.google.logging.v2.UpdateSettingsRequest; +import com.google.logging.v2.UpdateSinkRequest; +import com.google.logging.v2.UpdateViewRequest; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +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 java.util.concurrent.ExecutionException; +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 ConfigClientTest { + private static MockConfigServiceV2 mockConfigServiceV2; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private ConfigClient client; + + @BeforeClass + public static void startStaticServer() { + mockConfigServiceV2 = new MockConfigServiceV2(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockConfigServiceV2)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + ConfigSettings settings = + ConfigSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = ConfigClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void listBucketsTest() throws Exception { + LogBucket responsesElement = LogBucket.newBuilder().build(); + ListBucketsResponse expectedResponse = + ListBucketsResponse.newBuilder() + .setNextPageToken("") + .addAllBuckets(Arrays.asList(responsesElement)) + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + BillingAccountLocationName parent = + BillingAccountLocationName.of("[BILLING_ACCOUNT]", "[LOCATION]"); + + ListBucketsPagedResponse pagedListResponse = client.listBuckets(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBucketsList().get(0), resources.get(0)); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListBucketsRequest actualRequest = ((ListBucketsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listBucketsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + BillingAccountLocationName parent = + BillingAccountLocationName.of("[BILLING_ACCOUNT]", "[LOCATION]"); + client.listBuckets(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listBucketsTest2() throws Exception { + LogBucket responsesElement = LogBucket.newBuilder().build(); + ListBucketsResponse expectedResponse = + ListBucketsResponse.newBuilder() + .setNextPageToken("") + .addAllBuckets(Arrays.asList(responsesElement)) + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + FolderLocationName parent = FolderLocationName.of("[FOLDER]", "[LOCATION]"); + + ListBucketsPagedResponse pagedListResponse = client.listBuckets(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBucketsList().get(0), resources.get(0)); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListBucketsRequest actualRequest = ((ListBucketsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listBucketsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + FolderLocationName parent = FolderLocationName.of("[FOLDER]", "[LOCATION]"); + client.listBuckets(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listBucketsTest3() throws Exception { + LogBucket responsesElement = LogBucket.newBuilder().build(); + ListBucketsResponse expectedResponse = + ListBucketsResponse.newBuilder() + .setNextPageToken("") + .addAllBuckets(Arrays.asList(responsesElement)) + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListBucketsPagedResponse pagedListResponse = client.listBuckets(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBucketsList().get(0), resources.get(0)); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListBucketsRequest actualRequest = ((ListBucketsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listBucketsExceptionTest3() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listBuckets(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listBucketsTest4() throws Exception { + LogBucket responsesElement = LogBucket.newBuilder().build(); + ListBucketsResponse expectedResponse = + ListBucketsResponse.newBuilder() + .setNextPageToken("") + .addAllBuckets(Arrays.asList(responsesElement)) + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]"); + + ListBucketsPagedResponse pagedListResponse = client.listBuckets(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBucketsList().get(0), resources.get(0)); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListBucketsRequest actualRequest = ((ListBucketsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listBucketsExceptionTest4() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]"); + client.listBuckets(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listBucketsTest5() throws Exception { + LogBucket responsesElement = LogBucket.newBuilder().build(); + ListBucketsResponse expectedResponse = + ListBucketsResponse.newBuilder() + .setNextPageToken("") + .addAllBuckets(Arrays.asList(responsesElement)) + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListBucketsPagedResponse pagedListResponse = client.listBuckets(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getBucketsList().get(0), resources.get(0)); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListBucketsRequest actualRequest = ((ListBucketsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listBucketsExceptionTest5() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + String parent = "parent-995424086"; + client.listBuckets(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getBucketTest() throws Exception { + LogBucket expectedResponse = + LogBucket.newBuilder() + .setName( + LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]") + .toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setRetentionDays(1544391896) + .setLocked(true) + .setLifecycleState(LifecycleState.forNumber(0)) + .setAnalyticsEnabled(true) + .addAllRestrictedFields(new ArrayList()) + .addAllIndexConfigs(new ArrayList()) + .setCmekSettings(CmekSettings.newBuilder().build()) + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + GetBucketRequest request = + GetBucketRequest.newBuilder() + .setName( + LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]") + .toString()) + .build(); + + LogBucket actualResponse = client.getBucket(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetBucketRequest actualRequest = ((GetBucketRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getBucketExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + GetBucketRequest request = + GetBucketRequest.newBuilder() + .setName( + LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]") + .toString()) + .build(); + client.getBucket(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createBucketAsyncTest() throws Exception { + LogBucket expectedResponse = + LogBucket.newBuilder() + .setName( + LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]") + .toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setRetentionDays(1544391896) + .setLocked(true) + .setLifecycleState(LifecycleState.forNumber(0)) + .setAnalyticsEnabled(true) + .addAllRestrictedFields(new ArrayList()) + .addAllIndexConfigs(new ArrayList()) + .setCmekSettings(CmekSettings.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createBucketAsyncTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockConfigServiceV2.addResponse(resultOperation); + + CreateBucketRequest request = + CreateBucketRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setBucketId("bucketId-1603305307") + .setBucket(LogBucket.newBuilder().build()) + .build(); + + LogBucket actualResponse = client.createBucketAsyncAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBucketRequest actualRequest = ((CreateBucketRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getParent(), actualRequest.getParent()); + Assert.assertEquals(request.getBucketId(), actualRequest.getBucketId()); + Assert.assertEquals(request.getBucket(), actualRequest.getBucket()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBucketAsyncExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + CreateBucketRequest request = + CreateBucketRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setBucketId("bucketId-1603305307") + .setBucket(LogBucket.newBuilder().build()) + .build(); + client.createBucketAsyncAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void updateBucketAsyncTest() throws Exception { + LogBucket expectedResponse = + LogBucket.newBuilder() + .setName( + LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]") + .toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setRetentionDays(1544391896) + .setLocked(true) + .setLifecycleState(LifecycleState.forNumber(0)) + .setAnalyticsEnabled(true) + .addAllRestrictedFields(new ArrayList()) + .addAllIndexConfigs(new ArrayList()) + .setCmekSettings(CmekSettings.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateBucketAsyncTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockConfigServiceV2.addResponse(resultOperation); + + UpdateBucketRequest request = + UpdateBucketRequest.newBuilder() + .setName( + LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]") + .toString()) + .setBucket(LogBucket.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + LogBucket actualResponse = client.updateBucketAsyncAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateBucketRequest actualRequest = ((UpdateBucketRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getBucket(), actualRequest.getBucket()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateBucketAsyncExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + UpdateBucketRequest request = + UpdateBucketRequest.newBuilder() + .setName( + LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]") + .toString()) + .setBucket(LogBucket.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.updateBucketAsyncAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void createBucketTest() throws Exception { + LogBucket expectedResponse = + LogBucket.newBuilder() + .setName( + LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]") + .toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setRetentionDays(1544391896) + .setLocked(true) + .setLifecycleState(LifecycleState.forNumber(0)) + .setAnalyticsEnabled(true) + .addAllRestrictedFields(new ArrayList()) + .addAllIndexConfigs(new ArrayList()) + .setCmekSettings(CmekSettings.newBuilder().build()) + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + CreateBucketRequest request = + CreateBucketRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setBucketId("bucketId-1603305307") + .setBucket(LogBucket.newBuilder().build()) + .build(); + + LogBucket actualResponse = client.createBucket(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateBucketRequest actualRequest = ((CreateBucketRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getParent(), actualRequest.getParent()); + Assert.assertEquals(request.getBucketId(), actualRequest.getBucketId()); + Assert.assertEquals(request.getBucket(), actualRequest.getBucket()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createBucketExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + CreateBucketRequest request = + CreateBucketRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setBucketId("bucketId-1603305307") + .setBucket(LogBucket.newBuilder().build()) + .build(); + client.createBucket(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateBucketTest() throws Exception { + LogBucket expectedResponse = + LogBucket.newBuilder() + .setName( + LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]") + .toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setRetentionDays(1544391896) + .setLocked(true) + .setLifecycleState(LifecycleState.forNumber(0)) + .setAnalyticsEnabled(true) + .addAllRestrictedFields(new ArrayList()) + .addAllIndexConfigs(new ArrayList()) + .setCmekSettings(CmekSettings.newBuilder().build()) + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + UpdateBucketRequest request = + UpdateBucketRequest.newBuilder() + .setName( + LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]") + .toString()) + .setBucket(LogBucket.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + LogBucket actualResponse = client.updateBucket(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateBucketRequest actualRequest = ((UpdateBucketRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getBucket(), actualRequest.getBucket()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateBucketExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + UpdateBucketRequest request = + UpdateBucketRequest.newBuilder() + .setName( + LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]") + .toString()) + .setBucket(LogBucket.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.updateBucket(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteBucketTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockConfigServiceV2.addResponse(expectedResponse); + + DeleteBucketRequest request = + DeleteBucketRequest.newBuilder() + .setName( + LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]") + .toString()) + .build(); + + client.deleteBucket(request); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteBucketRequest actualRequest = ((DeleteBucketRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteBucketExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + DeleteBucketRequest request = + DeleteBucketRequest.newBuilder() + .setName( + LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]") + .toString()) + .build(); + client.deleteBucket(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void undeleteBucketTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockConfigServiceV2.addResponse(expectedResponse); + + UndeleteBucketRequest request = + UndeleteBucketRequest.newBuilder() + .setName( + LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]") + .toString()) + .build(); + + client.undeleteBucket(request); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UndeleteBucketRequest actualRequest = ((UndeleteBucketRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void undeleteBucketExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + UndeleteBucketRequest request = + UndeleteBucketRequest.newBuilder() + .setName( + LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]") + .toString()) + .build(); + client.undeleteBucket(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listViewsTest() throws Exception { + LogView responsesElement = LogView.newBuilder().build(); + ListViewsResponse expectedResponse = + ListViewsResponse.newBuilder() + .setNextPageToken("") + .addAllViews(Arrays.asList(responsesElement)) + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListViewsPagedResponse pagedListResponse = client.listViews(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getViewsList().get(0), resources.get(0)); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListViewsRequest actualRequest = ((ListViewsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listViewsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + String parent = "parent-995424086"; + client.listViews(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getViewTest() throws Exception { + LogView expectedResponse = + LogView.newBuilder() + .setName( + LogViewName.ofProjectLocationBucketViewName( + "[PROJECT]", "[LOCATION]", "[BUCKET]", "[VIEW]") + .toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setFilter("filter-1274492040") + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + GetViewRequest request = + GetViewRequest.newBuilder() + .setName( + LogViewName.ofProjectLocationBucketViewName( + "[PROJECT]", "[LOCATION]", "[BUCKET]", "[VIEW]") + .toString()) + .build(); + + LogView actualResponse = client.getView(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetViewRequest actualRequest = ((GetViewRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getViewExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + GetViewRequest request = + GetViewRequest.newBuilder() + .setName( + LogViewName.ofProjectLocationBucketViewName( + "[PROJECT]", "[LOCATION]", "[BUCKET]", "[VIEW]") + .toString()) + .build(); + client.getView(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createViewTest() throws Exception { + LogView expectedResponse = + LogView.newBuilder() + .setName( + LogViewName.ofProjectLocationBucketViewName( + "[PROJECT]", "[LOCATION]", "[BUCKET]", "[VIEW]") + .toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setFilter("filter-1274492040") + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + CreateViewRequest request = + CreateViewRequest.newBuilder() + .setParent("parent-995424086") + .setViewId("viewId-816632160") + .setView(LogView.newBuilder().build()) + .build(); + + LogView actualResponse = client.createView(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateViewRequest actualRequest = ((CreateViewRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getParent(), actualRequest.getParent()); + Assert.assertEquals(request.getViewId(), actualRequest.getViewId()); + Assert.assertEquals(request.getView(), actualRequest.getView()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createViewExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + CreateViewRequest request = + CreateViewRequest.newBuilder() + .setParent("parent-995424086") + .setViewId("viewId-816632160") + .setView(LogView.newBuilder().build()) + .build(); + client.createView(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateViewTest() throws Exception { + LogView expectedResponse = + LogView.newBuilder() + .setName( + LogViewName.ofProjectLocationBucketViewName( + "[PROJECT]", "[LOCATION]", "[BUCKET]", "[VIEW]") + .toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setFilter("filter-1274492040") + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + UpdateViewRequest request = + UpdateViewRequest.newBuilder() + .setName("name3373707") + .setView(LogView.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + LogView actualResponse = client.updateView(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateViewRequest actualRequest = ((UpdateViewRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getView(), actualRequest.getView()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateViewExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + UpdateViewRequest request = + UpdateViewRequest.newBuilder() + .setName("name3373707") + .setView(LogView.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.updateView(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteViewTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockConfigServiceV2.addResponse(expectedResponse); + + DeleteViewRequest request = + DeleteViewRequest.newBuilder() + .setName( + LogViewName.ofProjectLocationBucketViewName( + "[PROJECT]", "[LOCATION]", "[BUCKET]", "[VIEW]") + .toString()) + .build(); + + client.deleteView(request); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteViewRequest actualRequest = ((DeleteViewRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteViewExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + DeleteViewRequest request = + DeleteViewRequest.newBuilder() + .setName( + LogViewName.ofProjectLocationBucketViewName( + "[PROJECT]", "[LOCATION]", "[BUCKET]", "[VIEW]") + .toString()) + .build(); + client.deleteView(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listSinksTest() throws Exception { + LogSink responsesElement = LogSink.newBuilder().build(); + ListSinksResponse expectedResponse = + ListSinksResponse.newBuilder() + .setNextPageToken("") + .addAllSinks(Arrays.asList(responsesElement)) + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]"); + + ListSinksPagedResponse pagedListResponse = client.listSinks(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSinksList().get(0), resources.get(0)); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListSinksRequest actualRequest = ((ListSinksRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listSinksExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]"); + client.listSinks(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listSinksTest2() throws Exception { + LogSink responsesElement = LogSink.newBuilder().build(); + ListSinksResponse expectedResponse = + ListSinksResponse.newBuilder() + .setNextPageToken("") + .addAllSinks(Arrays.asList(responsesElement)) + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + FolderName parent = FolderName.of("[FOLDER]"); + + ListSinksPagedResponse pagedListResponse = client.listSinks(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSinksList().get(0), resources.get(0)); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListSinksRequest actualRequest = ((ListSinksRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listSinksExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + FolderName parent = FolderName.of("[FOLDER]"); + client.listSinks(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listSinksTest3() throws Exception { + LogSink responsesElement = LogSink.newBuilder().build(); + ListSinksResponse expectedResponse = + ListSinksResponse.newBuilder() + .setNextPageToken("") + .addAllSinks(Arrays.asList(responsesElement)) + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + + ListSinksPagedResponse pagedListResponse = client.listSinks(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSinksList().get(0), resources.get(0)); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListSinksRequest actualRequest = ((ListSinksRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listSinksExceptionTest3() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + client.listSinks(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listSinksTest4() throws Exception { + LogSink responsesElement = LogSink.newBuilder().build(); + ListSinksResponse expectedResponse = + ListSinksResponse.newBuilder() + .setNextPageToken("") + .addAllSinks(Arrays.asList(responsesElement)) + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + ProjectName parent = ProjectName.of("[PROJECT]"); + + ListSinksPagedResponse pagedListResponse = client.listSinks(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSinksList().get(0), resources.get(0)); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListSinksRequest actualRequest = ((ListSinksRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listSinksExceptionTest4() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + ProjectName parent = ProjectName.of("[PROJECT]"); + client.listSinks(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listSinksTest5() throws Exception { + LogSink responsesElement = LogSink.newBuilder().build(); + ListSinksResponse expectedResponse = + ListSinksResponse.newBuilder() + .setNextPageToken("") + .addAllSinks(Arrays.asList(responsesElement)) + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListSinksPagedResponse pagedListResponse = client.listSinks(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSinksList().get(0), resources.get(0)); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListSinksRequest actualRequest = ((ListSinksRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listSinksExceptionTest5() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + String parent = "parent-995424086"; + client.listSinks(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSinkTest() throws Exception { + LogSink expectedResponse = + LogSink.newBuilder() + .setName(LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString()) + .setDestination("destination-1429847026") + .setFilter("filter-1274492040") + .setDescription("description-1724546052") + .setDisabled(true) + .addAllExclusions(new ArrayList()) + .setWriterIdentity("writerIdentity925193809") + .setIncludeChildren(true) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]"); + + LogSink actualResponse = client.getSink(sinkName); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetSinkRequest actualRequest = ((GetSinkRequest) actualRequests.get(0)); + + Assert.assertEquals(sinkName.toString(), actualRequest.getSinkName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getSinkExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]"); + client.getSink(sinkName); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSinkTest2() throws Exception { + LogSink expectedResponse = + LogSink.newBuilder() + .setName(LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString()) + .setDestination("destination-1429847026") + .setFilter("filter-1274492040") + .setDescription("description-1724546052") + .setDisabled(true) + .addAllExclusions(new ArrayList()) + .setWriterIdentity("writerIdentity925193809") + .setIncludeChildren(true) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + String sinkName = "sinkName508775358"; + + LogSink actualResponse = client.getSink(sinkName); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetSinkRequest actualRequest = ((GetSinkRequest) actualRequests.get(0)); + + Assert.assertEquals(sinkName, actualRequest.getSinkName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getSinkExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + String sinkName = "sinkName508775358"; + client.getSink(sinkName); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createSinkTest() throws Exception { + LogSink expectedResponse = + LogSink.newBuilder() + .setName(LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString()) + .setDestination("destination-1429847026") + .setFilter("filter-1274492040") + .setDescription("description-1724546052") + .setDisabled(true) + .addAllExclusions(new ArrayList()) + .setWriterIdentity("writerIdentity925193809") + .setIncludeChildren(true) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]"); + LogSink sink = LogSink.newBuilder().build(); + + LogSink actualResponse = client.createSink(parent, sink); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateSinkRequest actualRequest = ((CreateSinkRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(sink, actualRequest.getSink()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createSinkExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]"); + LogSink sink = LogSink.newBuilder().build(); + client.createSink(parent, sink); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createSinkTest2() throws Exception { + LogSink expectedResponse = + LogSink.newBuilder() + .setName(LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString()) + .setDestination("destination-1429847026") + .setFilter("filter-1274492040") + .setDescription("description-1724546052") + .setDisabled(true) + .addAllExclusions(new ArrayList()) + .setWriterIdentity("writerIdentity925193809") + .setIncludeChildren(true) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + FolderName parent = FolderName.of("[FOLDER]"); + LogSink sink = LogSink.newBuilder().build(); + + LogSink actualResponse = client.createSink(parent, sink); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateSinkRequest actualRequest = ((CreateSinkRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(sink, actualRequest.getSink()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createSinkExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + FolderName parent = FolderName.of("[FOLDER]"); + LogSink sink = LogSink.newBuilder().build(); + client.createSink(parent, sink); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createSinkTest3() throws Exception { + LogSink expectedResponse = + LogSink.newBuilder() + .setName(LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString()) + .setDestination("destination-1429847026") + .setFilter("filter-1274492040") + .setDescription("description-1724546052") + .setDisabled(true) + .addAllExclusions(new ArrayList()) + .setWriterIdentity("writerIdentity925193809") + .setIncludeChildren(true) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + LogSink sink = LogSink.newBuilder().build(); + + LogSink actualResponse = client.createSink(parent, sink); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateSinkRequest actualRequest = ((CreateSinkRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(sink, actualRequest.getSink()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createSinkExceptionTest3() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + LogSink sink = LogSink.newBuilder().build(); + client.createSink(parent, sink); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createSinkTest4() throws Exception { + LogSink expectedResponse = + LogSink.newBuilder() + .setName(LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString()) + .setDestination("destination-1429847026") + .setFilter("filter-1274492040") + .setDescription("description-1724546052") + .setDisabled(true) + .addAllExclusions(new ArrayList()) + .setWriterIdentity("writerIdentity925193809") + .setIncludeChildren(true) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + ProjectName parent = ProjectName.of("[PROJECT]"); + LogSink sink = LogSink.newBuilder().build(); + + LogSink actualResponse = client.createSink(parent, sink); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateSinkRequest actualRequest = ((CreateSinkRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(sink, actualRequest.getSink()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createSinkExceptionTest4() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + ProjectName parent = ProjectName.of("[PROJECT]"); + LogSink sink = LogSink.newBuilder().build(); + client.createSink(parent, sink); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createSinkTest5() throws Exception { + LogSink expectedResponse = + LogSink.newBuilder() + .setName(LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString()) + .setDestination("destination-1429847026") + .setFilter("filter-1274492040") + .setDescription("description-1724546052") + .setDisabled(true) + .addAllExclusions(new ArrayList()) + .setWriterIdentity("writerIdentity925193809") + .setIncludeChildren(true) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + String parent = "parent-995424086"; + LogSink sink = LogSink.newBuilder().build(); + + LogSink actualResponse = client.createSink(parent, sink); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateSinkRequest actualRequest = ((CreateSinkRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(sink, actualRequest.getSink()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createSinkExceptionTest5() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + String parent = "parent-995424086"; + LogSink sink = LogSink.newBuilder().build(); + client.createSink(parent, sink); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateSinkTest() throws Exception { + LogSink expectedResponse = + LogSink.newBuilder() + .setName(LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString()) + .setDestination("destination-1429847026") + .setFilter("filter-1274492040") + .setDescription("description-1724546052") + .setDisabled(true) + .addAllExclusions(new ArrayList()) + .setWriterIdentity("writerIdentity925193809") + .setIncludeChildren(true) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]"); + LogSink sink = LogSink.newBuilder().build(); + + LogSink actualResponse = client.updateSink(sinkName, sink); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateSinkRequest actualRequest = ((UpdateSinkRequest) actualRequests.get(0)); + + Assert.assertEquals(sinkName.toString(), actualRequest.getSinkName()); + Assert.assertEquals(sink, actualRequest.getSink()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateSinkExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]"); + LogSink sink = LogSink.newBuilder().build(); + client.updateSink(sinkName, sink); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateSinkTest2() throws Exception { + LogSink expectedResponse = + LogSink.newBuilder() + .setName(LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString()) + .setDestination("destination-1429847026") + .setFilter("filter-1274492040") + .setDescription("description-1724546052") + .setDisabled(true) + .addAllExclusions(new ArrayList()) + .setWriterIdentity("writerIdentity925193809") + .setIncludeChildren(true) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + String sinkName = "sinkName508775358"; + LogSink sink = LogSink.newBuilder().build(); + + LogSink actualResponse = client.updateSink(sinkName, sink); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateSinkRequest actualRequest = ((UpdateSinkRequest) actualRequests.get(0)); + + Assert.assertEquals(sinkName, actualRequest.getSinkName()); + Assert.assertEquals(sink, actualRequest.getSink()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateSinkExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + String sinkName = "sinkName508775358"; + LogSink sink = LogSink.newBuilder().build(); + client.updateSink(sinkName, sink); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateSinkTest3() throws Exception { + LogSink expectedResponse = + LogSink.newBuilder() + .setName(LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString()) + .setDestination("destination-1429847026") + .setFilter("filter-1274492040") + .setDescription("description-1724546052") + .setDisabled(true) + .addAllExclusions(new ArrayList()) + .setWriterIdentity("writerIdentity925193809") + .setIncludeChildren(true) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]"); + LogSink sink = LogSink.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + LogSink actualResponse = client.updateSink(sinkName, sink, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateSinkRequest actualRequest = ((UpdateSinkRequest) actualRequests.get(0)); + + Assert.assertEquals(sinkName.toString(), actualRequest.getSinkName()); + Assert.assertEquals(sink, actualRequest.getSink()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateSinkExceptionTest3() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]"); + LogSink sink = LogSink.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateSink(sinkName, sink, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateSinkTest4() throws Exception { + LogSink expectedResponse = + LogSink.newBuilder() + .setName(LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString()) + .setDestination("destination-1429847026") + .setFilter("filter-1274492040") + .setDescription("description-1724546052") + .setDisabled(true) + .addAllExclusions(new ArrayList()) + .setWriterIdentity("writerIdentity925193809") + .setIncludeChildren(true) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + String sinkName = "sinkName508775358"; + LogSink sink = LogSink.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + LogSink actualResponse = client.updateSink(sinkName, sink, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateSinkRequest actualRequest = ((UpdateSinkRequest) actualRequests.get(0)); + + Assert.assertEquals(sinkName, actualRequest.getSinkName()); + Assert.assertEquals(sink, actualRequest.getSink()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateSinkExceptionTest4() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + String sinkName = "sinkName508775358"; + LogSink sink = LogSink.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateSink(sinkName, sink, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteSinkTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockConfigServiceV2.addResponse(expectedResponse); + + LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]"); + + client.deleteSink(sinkName); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteSinkRequest actualRequest = ((DeleteSinkRequest) actualRequests.get(0)); + + Assert.assertEquals(sinkName.toString(), actualRequest.getSinkName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteSinkExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]"); + client.deleteSink(sinkName); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteSinkTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockConfigServiceV2.addResponse(expectedResponse); + + String sinkName = "sinkName508775358"; + + client.deleteSink(sinkName); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteSinkRequest actualRequest = ((DeleteSinkRequest) actualRequests.get(0)); + + Assert.assertEquals(sinkName, actualRequest.getSinkName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteSinkExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + String sinkName = "sinkName508775358"; + client.deleteSink(sinkName); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createLinkTest() throws Exception { + Link expectedResponse = + Link.newBuilder() + .setName( + LinkName.ofProjectLocationBucketLinkName( + "[PROJECT]", "[LOCATION]", "[BUCKET]", "[LINK]") + .toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setLifecycleState(LifecycleState.forNumber(0)) + .setBigqueryDataset(BigQueryDataset.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createLinkTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockConfigServiceV2.addResponse(resultOperation); + + LogBucketName parent = + LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]"); + Link link = Link.newBuilder().build(); + String linkId = "linkId-1102667083"; + + Link actualResponse = client.createLinkAsync(parent, link, linkId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateLinkRequest actualRequest = ((CreateLinkRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(link, actualRequest.getLink()); + Assert.assertEquals(linkId, actualRequest.getLinkId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createLinkExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + LogBucketName parent = + LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]"); + Link link = Link.newBuilder().build(); + String linkId = "linkId-1102667083"; + client.createLinkAsync(parent, link, linkId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void createLinkTest2() throws Exception { + Link expectedResponse = + Link.newBuilder() + .setName( + LinkName.ofProjectLocationBucketLinkName( + "[PROJECT]", "[LOCATION]", "[BUCKET]", "[LINK]") + .toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setLifecycleState(LifecycleState.forNumber(0)) + .setBigqueryDataset(BigQueryDataset.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createLinkTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockConfigServiceV2.addResponse(resultOperation); + + String parent = "parent-995424086"; + Link link = Link.newBuilder().build(); + String linkId = "linkId-1102667083"; + + Link actualResponse = client.createLinkAsync(parent, link, linkId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateLinkRequest actualRequest = ((CreateLinkRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(link, actualRequest.getLink()); + Assert.assertEquals(linkId, actualRequest.getLinkId()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createLinkExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + String parent = "parent-995424086"; + Link link = Link.newBuilder().build(); + String linkId = "linkId-1102667083"; + client.createLinkAsync(parent, link, linkId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteLinkTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteLinkTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockConfigServiceV2.addResponse(resultOperation); + + LinkName name = + LinkName.ofProjectLocationBucketLinkName("[PROJECT]", "[LOCATION]", "[BUCKET]", "[LINK]"); + + client.deleteLinkAsync(name).get(); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteLinkRequest actualRequest = ((DeleteLinkRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteLinkExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + LinkName name = + LinkName.ofProjectLocationBucketLinkName("[PROJECT]", "[LOCATION]", "[BUCKET]", "[LINK]"); + client.deleteLinkAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void deleteLinkTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteLinkTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockConfigServiceV2.addResponse(resultOperation); + + String name = "name3373707"; + + client.deleteLinkAsync(name).get(); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteLinkRequest actualRequest = ((DeleteLinkRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteLinkExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + String name = "name3373707"; + client.deleteLinkAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void listLinksTest() throws Exception { + Link responsesElement = Link.newBuilder().build(); + ListLinksResponse expectedResponse = + ListLinksResponse.newBuilder() + .setNextPageToken("") + .addAllLinks(Arrays.asList(responsesElement)) + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + LogBucketName parent = + LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]"); + + ListLinksPagedResponse pagedListResponse = client.listLinks(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLinksList().get(0), resources.get(0)); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLinksRequest actualRequest = ((ListLinksRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLinksExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + LogBucketName parent = + LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]"); + client.listLinks(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLinksTest2() throws Exception { + Link responsesElement = Link.newBuilder().build(); + ListLinksResponse expectedResponse = + ListLinksResponse.newBuilder() + .setNextPageToken("") + .addAllLinks(Arrays.asList(responsesElement)) + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListLinksPagedResponse pagedListResponse = client.listLinks(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLinksList().get(0), resources.get(0)); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLinksRequest actualRequest = ((ListLinksRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLinksExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + String parent = "parent-995424086"; + client.listLinks(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLinkTest() throws Exception { + Link expectedResponse = + Link.newBuilder() + .setName( + LinkName.ofProjectLocationBucketLinkName( + "[PROJECT]", "[LOCATION]", "[BUCKET]", "[LINK]") + .toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setLifecycleState(LifecycleState.forNumber(0)) + .setBigqueryDataset(BigQueryDataset.newBuilder().build()) + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + LinkName name = + LinkName.ofProjectLocationBucketLinkName("[PROJECT]", "[LOCATION]", "[BUCKET]", "[LINK]"); + + Link actualResponse = client.getLink(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLinkRequest actualRequest = ((GetLinkRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLinkExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + LinkName name = + LinkName.ofProjectLocationBucketLinkName("[PROJECT]", "[LOCATION]", "[BUCKET]", "[LINK]"); + client.getLink(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLinkTest2() throws Exception { + Link expectedResponse = + Link.newBuilder() + .setName( + LinkName.ofProjectLocationBucketLinkName( + "[PROJECT]", "[LOCATION]", "[BUCKET]", "[LINK]") + .toString()) + .setDescription("description-1724546052") + .setCreateTime(Timestamp.newBuilder().build()) + .setLifecycleState(LifecycleState.forNumber(0)) + .setBigqueryDataset(BigQueryDataset.newBuilder().build()) + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + String name = "name3373707"; + + Link actualResponse = client.getLink(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLinkRequest actualRequest = ((GetLinkRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLinkExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + String name = "name3373707"; + client.getLink(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listExclusionsTest() throws Exception { + LogExclusion responsesElement = LogExclusion.newBuilder().build(); + ListExclusionsResponse expectedResponse = + ListExclusionsResponse.newBuilder() + .setNextPageToken("") + .addAllExclusions(Arrays.asList(responsesElement)) + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]"); + + ListExclusionsPagedResponse pagedListResponse = client.listExclusions(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getExclusionsList().get(0), resources.get(0)); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListExclusionsRequest actualRequest = ((ListExclusionsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listExclusionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]"); + client.listExclusions(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listExclusionsTest2() throws Exception { + LogExclusion responsesElement = LogExclusion.newBuilder().build(); + ListExclusionsResponse expectedResponse = + ListExclusionsResponse.newBuilder() + .setNextPageToken("") + .addAllExclusions(Arrays.asList(responsesElement)) + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + FolderName parent = FolderName.of("[FOLDER]"); + + ListExclusionsPagedResponse pagedListResponse = client.listExclusions(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getExclusionsList().get(0), resources.get(0)); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListExclusionsRequest actualRequest = ((ListExclusionsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listExclusionsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + FolderName parent = FolderName.of("[FOLDER]"); + client.listExclusions(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listExclusionsTest3() throws Exception { + LogExclusion responsesElement = LogExclusion.newBuilder().build(); + ListExclusionsResponse expectedResponse = + ListExclusionsResponse.newBuilder() + .setNextPageToken("") + .addAllExclusions(Arrays.asList(responsesElement)) + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + + ListExclusionsPagedResponse pagedListResponse = client.listExclusions(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getExclusionsList().get(0), resources.get(0)); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListExclusionsRequest actualRequest = ((ListExclusionsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listExclusionsExceptionTest3() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + client.listExclusions(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listExclusionsTest4() throws Exception { + LogExclusion responsesElement = LogExclusion.newBuilder().build(); + ListExclusionsResponse expectedResponse = + ListExclusionsResponse.newBuilder() + .setNextPageToken("") + .addAllExclusions(Arrays.asList(responsesElement)) + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + ProjectName parent = ProjectName.of("[PROJECT]"); + + ListExclusionsPagedResponse pagedListResponse = client.listExclusions(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getExclusionsList().get(0), resources.get(0)); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListExclusionsRequest actualRequest = ((ListExclusionsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listExclusionsExceptionTest4() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + ProjectName parent = ProjectName.of("[PROJECT]"); + client.listExclusions(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listExclusionsTest5() throws Exception { + LogExclusion responsesElement = LogExclusion.newBuilder().build(); + ListExclusionsResponse expectedResponse = + ListExclusionsResponse.newBuilder() + .setNextPageToken("") + .addAllExclusions(Arrays.asList(responsesElement)) + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListExclusionsPagedResponse pagedListResponse = client.listExclusions(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getExclusionsList().get(0), resources.get(0)); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListExclusionsRequest actualRequest = ((ListExclusionsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listExclusionsExceptionTest5() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + String parent = "parent-995424086"; + client.listExclusions(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getExclusionTest() throws Exception { + LogExclusion expectedResponse = + LogExclusion.newBuilder() + .setName(LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString()) + .setDescription("description-1724546052") + .setFilter("filter-1274492040") + .setDisabled(true) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + LogExclusionName name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]"); + + LogExclusion actualResponse = client.getExclusion(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetExclusionRequest actualRequest = ((GetExclusionRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getExclusionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + LogExclusionName name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]"); + client.getExclusion(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getExclusionTest2() throws Exception { + LogExclusion expectedResponse = + LogExclusion.newBuilder() + .setName(LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString()) + .setDescription("description-1724546052") + .setFilter("filter-1274492040") + .setDisabled(true) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + String name = "name3373707"; + + LogExclusion actualResponse = client.getExclusion(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetExclusionRequest actualRequest = ((GetExclusionRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getExclusionExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + String name = "name3373707"; + client.getExclusion(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createExclusionTest() throws Exception { + LogExclusion expectedResponse = + LogExclusion.newBuilder() + .setName(LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString()) + .setDescription("description-1724546052") + .setFilter("filter-1274492040") + .setDisabled(true) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]"); + LogExclusion exclusion = LogExclusion.newBuilder().build(); + + LogExclusion actualResponse = client.createExclusion(parent, exclusion); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateExclusionRequest actualRequest = ((CreateExclusionRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(exclusion, actualRequest.getExclusion()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createExclusionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]"); + LogExclusion exclusion = LogExclusion.newBuilder().build(); + client.createExclusion(parent, exclusion); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createExclusionTest2() throws Exception { + LogExclusion expectedResponse = + LogExclusion.newBuilder() + .setName(LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString()) + .setDescription("description-1724546052") + .setFilter("filter-1274492040") + .setDisabled(true) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + FolderName parent = FolderName.of("[FOLDER]"); + LogExclusion exclusion = LogExclusion.newBuilder().build(); + + LogExclusion actualResponse = client.createExclusion(parent, exclusion); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateExclusionRequest actualRequest = ((CreateExclusionRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(exclusion, actualRequest.getExclusion()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createExclusionExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + FolderName parent = FolderName.of("[FOLDER]"); + LogExclusion exclusion = LogExclusion.newBuilder().build(); + client.createExclusion(parent, exclusion); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createExclusionTest3() throws Exception { + LogExclusion expectedResponse = + LogExclusion.newBuilder() + .setName(LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString()) + .setDescription("description-1724546052") + .setFilter("filter-1274492040") + .setDisabled(true) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + LogExclusion exclusion = LogExclusion.newBuilder().build(); + + LogExclusion actualResponse = client.createExclusion(parent, exclusion); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateExclusionRequest actualRequest = ((CreateExclusionRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(exclusion, actualRequest.getExclusion()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createExclusionExceptionTest3() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + LogExclusion exclusion = LogExclusion.newBuilder().build(); + client.createExclusion(parent, exclusion); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createExclusionTest4() throws Exception { + LogExclusion expectedResponse = + LogExclusion.newBuilder() + .setName(LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString()) + .setDescription("description-1724546052") + .setFilter("filter-1274492040") + .setDisabled(true) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + ProjectName parent = ProjectName.of("[PROJECT]"); + LogExclusion exclusion = LogExclusion.newBuilder().build(); + + LogExclusion actualResponse = client.createExclusion(parent, exclusion); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateExclusionRequest actualRequest = ((CreateExclusionRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(exclusion, actualRequest.getExclusion()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createExclusionExceptionTest4() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + ProjectName parent = ProjectName.of("[PROJECT]"); + LogExclusion exclusion = LogExclusion.newBuilder().build(); + client.createExclusion(parent, exclusion); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createExclusionTest5() throws Exception { + LogExclusion expectedResponse = + LogExclusion.newBuilder() + .setName(LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString()) + .setDescription("description-1724546052") + .setFilter("filter-1274492040") + .setDisabled(true) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + String parent = "parent-995424086"; + LogExclusion exclusion = LogExclusion.newBuilder().build(); + + LogExclusion actualResponse = client.createExclusion(parent, exclusion); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateExclusionRequest actualRequest = ((CreateExclusionRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(exclusion, actualRequest.getExclusion()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createExclusionExceptionTest5() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + String parent = "parent-995424086"; + LogExclusion exclusion = LogExclusion.newBuilder().build(); + client.createExclusion(parent, exclusion); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateExclusionTest() throws Exception { + LogExclusion expectedResponse = + LogExclusion.newBuilder() + .setName(LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString()) + .setDescription("description-1724546052") + .setFilter("filter-1274492040") + .setDisabled(true) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + LogExclusionName name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]"); + LogExclusion exclusion = LogExclusion.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + LogExclusion actualResponse = client.updateExclusion(name, exclusion, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateExclusionRequest actualRequest = ((UpdateExclusionRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertEquals(exclusion, actualRequest.getExclusion()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateExclusionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + LogExclusionName name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]"); + LogExclusion exclusion = LogExclusion.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateExclusion(name, exclusion, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateExclusionTest2() throws Exception { + LogExclusion expectedResponse = + LogExclusion.newBuilder() + .setName(LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString()) + .setDescription("description-1724546052") + .setFilter("filter-1274492040") + .setDisabled(true) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + String name = "name3373707"; + LogExclusion exclusion = LogExclusion.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + LogExclusion actualResponse = client.updateExclusion(name, exclusion, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateExclusionRequest actualRequest = ((UpdateExclusionRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertEquals(exclusion, actualRequest.getExclusion()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateExclusionExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + String name = "name3373707"; + LogExclusion exclusion = LogExclusion.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateExclusion(name, exclusion, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteExclusionTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockConfigServiceV2.addResponse(expectedResponse); + + LogExclusionName name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]"); + + client.deleteExclusion(name); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteExclusionRequest actualRequest = ((DeleteExclusionRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteExclusionExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + LogExclusionName name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]"); + client.deleteExclusion(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteExclusionTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockConfigServiceV2.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteExclusion(name); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteExclusionRequest actualRequest = ((DeleteExclusionRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteExclusionExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + String name = "name3373707"; + client.deleteExclusion(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getCmekSettingsTest() throws Exception { + CmekSettings expectedResponse = + CmekSettings.newBuilder() + .setName(CmekSettingsName.ofProjectCmekSettingsName("[PROJECT]").toString()) + .setKmsKeyName("kmsKeyName412586233") + .setKmsKeyVersionName("kmsKeyVersionName-1798811307") + .setServiceAccountId("serviceAccountId1964232947") + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + GetCmekSettingsRequest request = + GetCmekSettingsRequest.newBuilder() + .setName(CmekSettingsName.ofProjectCmekSettingsName("[PROJECT]").toString()) + .build(); + + CmekSettings actualResponse = client.getCmekSettings(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetCmekSettingsRequest actualRequest = ((GetCmekSettingsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getCmekSettingsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + GetCmekSettingsRequest request = + GetCmekSettingsRequest.newBuilder() + .setName(CmekSettingsName.ofProjectCmekSettingsName("[PROJECT]").toString()) + .build(); + client.getCmekSettings(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateCmekSettingsTest() throws Exception { + CmekSettings expectedResponse = + CmekSettings.newBuilder() + .setName(CmekSettingsName.ofProjectCmekSettingsName("[PROJECT]").toString()) + .setKmsKeyName("kmsKeyName412586233") + .setKmsKeyVersionName("kmsKeyVersionName-1798811307") + .setServiceAccountId("serviceAccountId1964232947") + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + UpdateCmekSettingsRequest request = + UpdateCmekSettingsRequest.newBuilder() + .setName("name3373707") + .setCmekSettings(CmekSettings.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + CmekSettings actualResponse = client.updateCmekSettings(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateCmekSettingsRequest actualRequest = ((UpdateCmekSettingsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getCmekSettings(), actualRequest.getCmekSettings()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateCmekSettingsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + UpdateCmekSettingsRequest request = + UpdateCmekSettingsRequest.newBuilder() + .setName("name3373707") + .setCmekSettings(CmekSettings.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.updateCmekSettings(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSettingsTest() throws Exception { + Settings expectedResponse = + Settings.newBuilder() + .setName(SettingsName.ofProjectName("[PROJECT]").toString()) + .setKmsKeyName("kmsKeyName412586233") + .setKmsServiceAccountId("kmsServiceAccountId662368868") + .setStorageLocation("storageLocation911842128") + .setDisableDefaultSink(true) + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + SettingsName name = SettingsName.ofProjectName("[PROJECT]"); + + Settings actualResponse = client.getSettings(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetSettingsRequest actualRequest = ((GetSettingsRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getSettingsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + SettingsName name = SettingsName.ofProjectName("[PROJECT]"); + client.getSettings(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSettingsTest2() throws Exception { + Settings expectedResponse = + Settings.newBuilder() + .setName(SettingsName.ofProjectName("[PROJECT]").toString()) + .setKmsKeyName("kmsKeyName412586233") + .setKmsServiceAccountId("kmsServiceAccountId662368868") + .setStorageLocation("storageLocation911842128") + .setDisableDefaultSink(true) + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + String name = "name3373707"; + + Settings actualResponse = client.getSettings(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetSettingsRequest actualRequest = ((GetSettingsRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getSettingsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + String name = "name3373707"; + client.getSettings(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateSettingsTest() throws Exception { + Settings expectedResponse = + Settings.newBuilder() + .setName(SettingsName.ofProjectName("[PROJECT]").toString()) + .setKmsKeyName("kmsKeyName412586233") + .setKmsServiceAccountId("kmsServiceAccountId662368868") + .setStorageLocation("storageLocation911842128") + .setDisableDefaultSink(true) + .build(); + mockConfigServiceV2.addResponse(expectedResponse); + + Settings settings = Settings.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Settings actualResponse = client.updateSettings(settings, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateSettingsRequest actualRequest = ((UpdateSettingsRequest) actualRequests.get(0)); + + Assert.assertEquals(settings, actualRequest.getSettings()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateSettingsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + Settings settings = Settings.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateSettings(settings, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void copyLogEntriesTest() throws Exception { + CopyLogEntriesResponse expectedResponse = + CopyLogEntriesResponse.newBuilder().setLogEntriesCopiedCount(-2134326978).build(); + Operation resultOperation = + Operation.newBuilder() + .setName("copyLogEntriesTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockConfigServiceV2.addResponse(resultOperation); + + CopyLogEntriesRequest request = + CopyLogEntriesRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setDestination("destination-1429847026") + .build(); + + CopyLogEntriesResponse actualResponse = client.copyLogEntriesAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockConfigServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CopyLogEntriesRequest actualRequest = ((CopyLogEntriesRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getDestination(), actualRequest.getDestination()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void copyLogEntriesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockConfigServiceV2.addException(exception); + + try { + CopyLogEntriesRequest request = + CopyLogEntriesRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setDestination("destination-1429847026") + .build(); + client.copyLogEntriesAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } +} diff --git a/java-logging/google-cloud-logging/src/test/java/com/google/cloud/logging/v2/LoggingClientTest.java b/java-logging/google-cloud-logging/src/test/java/com/google/cloud/logging/v2/LoggingClientTest.java new file mode 100644 index 000000000000..5299f967357c --- /dev/null +++ b/java-logging/google-cloud-logging/src/test/java/com/google/cloud/logging/v2/LoggingClientTest.java @@ -0,0 +1,656 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2; + +import static com.google.cloud.logging.v2.LoggingClient.ListLogEntriesPagedResponse; +import static com.google.cloud.logging.v2.LoggingClient.ListLogsPagedResponse; +import static com.google.cloud.logging.v2.LoggingClient.ListMonitoredResourceDescriptorsPagedResponse; + +import com.google.api.MonitoredResource; +import com.google.api.MonitoredResourceDescriptor; +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.grpc.testing.MockStreamObserver; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiStreamObserver; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.common.collect.Lists; +import com.google.logging.v2.BillingAccountName; +import com.google.logging.v2.DeleteLogRequest; +import com.google.logging.v2.FolderName; +import com.google.logging.v2.ListLogEntriesRequest; +import com.google.logging.v2.ListLogEntriesResponse; +import com.google.logging.v2.ListLogsRequest; +import com.google.logging.v2.ListLogsResponse; +import com.google.logging.v2.ListMonitoredResourceDescriptorsRequest; +import com.google.logging.v2.ListMonitoredResourceDescriptorsResponse; +import com.google.logging.v2.LogEntry; +import com.google.logging.v2.LogName; +import com.google.logging.v2.OrganizationName; +import com.google.logging.v2.ProjectName; +import com.google.logging.v2.TailLogEntriesRequest; +import com.google.logging.v2.TailLogEntriesResponse; +import com.google.logging.v2.WriteLogEntriesRequest; +import com.google.logging.v2.WriteLogEntriesResponse; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Duration; +import com.google.protobuf.Empty; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +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 LoggingClientTest { + private static MockLoggingServiceV2 mockLoggingServiceV2; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private LoggingClient client; + + @BeforeClass + public static void startStaticServer() { + mockLoggingServiceV2 = new MockLoggingServiceV2(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockLoggingServiceV2)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + LoggingSettings settings = + LoggingSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = LoggingClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void deleteLogTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockLoggingServiceV2.addResponse(expectedResponse); + + LogName logName = LogName.ofProjectLogName("[PROJECT]", "[LOG]"); + + client.deleteLog(logName); + + List actualRequests = mockLoggingServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteLogRequest actualRequest = ((DeleteLogRequest) actualRequests.get(0)); + + Assert.assertEquals(logName.toString(), actualRequest.getLogName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteLogExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLoggingServiceV2.addException(exception); + + try { + LogName logName = LogName.ofProjectLogName("[PROJECT]", "[LOG]"); + client.deleteLog(logName); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteLogTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockLoggingServiceV2.addResponse(expectedResponse); + + String logName = "logName341528559"; + + client.deleteLog(logName); + + List actualRequests = mockLoggingServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteLogRequest actualRequest = ((DeleteLogRequest) actualRequests.get(0)); + + Assert.assertEquals(logName, actualRequest.getLogName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteLogExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLoggingServiceV2.addException(exception); + + try { + String logName = "logName341528559"; + client.deleteLog(logName); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void writeLogEntriesTest() throws Exception { + WriteLogEntriesResponse expectedResponse = WriteLogEntriesResponse.newBuilder().build(); + mockLoggingServiceV2.addResponse(expectedResponse); + + LogName logName = LogName.ofProjectLogName("[PROJECT]", "[LOG]"); + MonitoredResource resource = MonitoredResource.newBuilder().build(); + Map labels = new HashMap<>(); + List entries = new ArrayList<>(); + + WriteLogEntriesResponse actualResponse = + client.writeLogEntries(logName, resource, labels, entries); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLoggingServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + WriteLogEntriesRequest actualRequest = ((WriteLogEntriesRequest) actualRequests.get(0)); + + Assert.assertEquals(logName.toString(), actualRequest.getLogName()); + Assert.assertEquals(resource, actualRequest.getResource()); + Assert.assertEquals(labels, actualRequest.getLabelsMap()); + Assert.assertEquals(entries, actualRequest.getEntriesList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void writeLogEntriesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLoggingServiceV2.addException(exception); + + try { + LogName logName = LogName.ofProjectLogName("[PROJECT]", "[LOG]"); + MonitoredResource resource = MonitoredResource.newBuilder().build(); + Map labels = new HashMap<>(); + List entries = new ArrayList<>(); + client.writeLogEntries(logName, resource, labels, entries); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void writeLogEntriesTest2() throws Exception { + WriteLogEntriesResponse expectedResponse = WriteLogEntriesResponse.newBuilder().build(); + mockLoggingServiceV2.addResponse(expectedResponse); + + String logName = "logName341528559"; + MonitoredResource resource = MonitoredResource.newBuilder().build(); + Map labels = new HashMap<>(); + List entries = new ArrayList<>(); + + WriteLogEntriesResponse actualResponse = + client.writeLogEntries(logName, resource, labels, entries); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLoggingServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + WriteLogEntriesRequest actualRequest = ((WriteLogEntriesRequest) actualRequests.get(0)); + + Assert.assertEquals(logName, actualRequest.getLogName()); + Assert.assertEquals(resource, actualRequest.getResource()); + Assert.assertEquals(labels, actualRequest.getLabelsMap()); + Assert.assertEquals(entries, actualRequest.getEntriesList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void writeLogEntriesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLoggingServiceV2.addException(exception); + + try { + String logName = "logName341528559"; + MonitoredResource resource = MonitoredResource.newBuilder().build(); + Map labels = new HashMap<>(); + List entries = new ArrayList<>(); + client.writeLogEntries(logName, resource, labels, entries); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLogEntriesTest() throws Exception { + LogEntry responsesElement = LogEntry.newBuilder().build(); + ListLogEntriesResponse expectedResponse = + ListLogEntriesResponse.newBuilder() + .setNextPageToken("") + .addAllEntries(Arrays.asList(responsesElement)) + .build(); + mockLoggingServiceV2.addResponse(expectedResponse); + + List resourceNames = new ArrayList<>(); + String filter = "filter-1274492040"; + String orderBy = "orderBy-1207110587"; + + ListLogEntriesPagedResponse pagedListResponse = + client.listLogEntries(resourceNames, filter, orderBy); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getEntriesList().get(0), resources.get(0)); + + List actualRequests = mockLoggingServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLogEntriesRequest actualRequest = ((ListLogEntriesRequest) actualRequests.get(0)); + + Assert.assertEquals(resourceNames, actualRequest.getResourceNamesList()); + Assert.assertEquals(filter, actualRequest.getFilter()); + Assert.assertEquals(orderBy, actualRequest.getOrderBy()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLogEntriesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLoggingServiceV2.addException(exception); + + try { + List resourceNames = new ArrayList<>(); + String filter = "filter-1274492040"; + String orderBy = "orderBy-1207110587"; + client.listLogEntries(resourceNames, filter, orderBy); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listMonitoredResourceDescriptorsTest() throws Exception { + MonitoredResourceDescriptor responsesElement = MonitoredResourceDescriptor.newBuilder().build(); + ListMonitoredResourceDescriptorsResponse expectedResponse = + ListMonitoredResourceDescriptorsResponse.newBuilder() + .setNextPageToken("") + .addAllResourceDescriptors(Arrays.asList(responsesElement)) + .build(); + mockLoggingServiceV2.addResponse(expectedResponse); + + ListMonitoredResourceDescriptorsRequest request = + ListMonitoredResourceDescriptorsRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListMonitoredResourceDescriptorsPagedResponse pagedListResponse = + client.listMonitoredResourceDescriptors(request); + + List resources = + Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getResourceDescriptorsList().get(0), resources.get(0)); + + List actualRequests = mockLoggingServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListMonitoredResourceDescriptorsRequest actualRequest = + ((ListMonitoredResourceDescriptorsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listMonitoredResourceDescriptorsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLoggingServiceV2.addException(exception); + + try { + ListMonitoredResourceDescriptorsRequest request = + ListMonitoredResourceDescriptorsRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listMonitoredResourceDescriptors(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLogsTest() throws Exception { + String responsesElement = "responsesElement-318365110"; + ListLogsResponse expectedResponse = + ListLogsResponse.newBuilder() + .setNextPageToken("") + .addAllLogNames(Arrays.asList(responsesElement)) + .build(); + mockLoggingServiceV2.addResponse(expectedResponse); + + BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]"); + + ListLogsPagedResponse pagedListResponse = client.listLogs(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLogNamesList().get(0), resources.get(0)); + + List actualRequests = mockLoggingServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLogsRequest actualRequest = ((ListLogsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLogsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLoggingServiceV2.addException(exception); + + try { + BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]"); + client.listLogs(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLogsTest2() throws Exception { + String responsesElement = "responsesElement-318365110"; + ListLogsResponse expectedResponse = + ListLogsResponse.newBuilder() + .setNextPageToken("") + .addAllLogNames(Arrays.asList(responsesElement)) + .build(); + mockLoggingServiceV2.addResponse(expectedResponse); + + FolderName parent = FolderName.of("[FOLDER]"); + + ListLogsPagedResponse pagedListResponse = client.listLogs(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLogNamesList().get(0), resources.get(0)); + + List actualRequests = mockLoggingServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLogsRequest actualRequest = ((ListLogsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLogsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLoggingServiceV2.addException(exception); + + try { + FolderName parent = FolderName.of("[FOLDER]"); + client.listLogs(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLogsTest3() throws Exception { + String responsesElement = "responsesElement-318365110"; + ListLogsResponse expectedResponse = + ListLogsResponse.newBuilder() + .setNextPageToken("") + .addAllLogNames(Arrays.asList(responsesElement)) + .build(); + mockLoggingServiceV2.addResponse(expectedResponse); + + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + + ListLogsPagedResponse pagedListResponse = client.listLogs(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLogNamesList().get(0), resources.get(0)); + + List actualRequests = mockLoggingServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLogsRequest actualRequest = ((ListLogsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLogsExceptionTest3() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLoggingServiceV2.addException(exception); + + try { + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + client.listLogs(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLogsTest4() throws Exception { + String responsesElement = "responsesElement-318365110"; + ListLogsResponse expectedResponse = + ListLogsResponse.newBuilder() + .setNextPageToken("") + .addAllLogNames(Arrays.asList(responsesElement)) + .build(); + mockLoggingServiceV2.addResponse(expectedResponse); + + ProjectName parent = ProjectName.of("[PROJECT]"); + + ListLogsPagedResponse pagedListResponse = client.listLogs(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLogNamesList().get(0), resources.get(0)); + + List actualRequests = mockLoggingServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLogsRequest actualRequest = ((ListLogsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLogsExceptionTest4() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLoggingServiceV2.addException(exception); + + try { + ProjectName parent = ProjectName.of("[PROJECT]"); + client.listLogs(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLogsTest5() throws Exception { + String responsesElement = "responsesElement-318365110"; + ListLogsResponse expectedResponse = + ListLogsResponse.newBuilder() + .setNextPageToken("") + .addAllLogNames(Arrays.asList(responsesElement)) + .build(); + mockLoggingServiceV2.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListLogsPagedResponse pagedListResponse = client.listLogs(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLogNamesList().get(0), resources.get(0)); + + List actualRequests = mockLoggingServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLogsRequest actualRequest = ((ListLogsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLogsExceptionTest5() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLoggingServiceV2.addException(exception); + + try { + String parent = "parent-995424086"; + client.listLogs(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void tailLogEntriesTest() throws Exception { + TailLogEntriesResponse expectedResponse = + TailLogEntriesResponse.newBuilder() + .addAllEntries(new ArrayList()) + .addAllSuppressionInfo(new ArrayList()) + .build(); + mockLoggingServiceV2.addResponse(expectedResponse); + TailLogEntriesRequest request = + TailLogEntriesRequest.newBuilder() + .addAllResourceNames(new ArrayList()) + .setFilter("filter-1274492040") + .setBufferWindow(Duration.newBuilder().build()) + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + BidiStreamingCallable callable = + client.tailLogEntriesCallable(); + ApiStreamObserver requestObserver = + callable.bidiStreamingCall(responseObserver); + + requestObserver.onNext(request); + requestObserver.onCompleted(); + + List actualResponses = responseObserver.future().get(); + Assert.assertEquals(1, actualResponses.size()); + Assert.assertEquals(expectedResponse, actualResponses.get(0)); + } + + @Test + public void tailLogEntriesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLoggingServiceV2.addException(exception); + TailLogEntriesRequest request = + TailLogEntriesRequest.newBuilder() + .addAllResourceNames(new ArrayList()) + .setFilter("filter-1274492040") + .setBufferWindow(Duration.newBuilder().build()) + .build(); + + MockStreamObserver responseObserver = new MockStreamObserver<>(); + + BidiStreamingCallable callable = + client.tailLogEntriesCallable(); + ApiStreamObserver requestObserver = + callable.bidiStreamingCall(responseObserver); + + requestObserver.onNext(request); + + try { + List actualResponses = responseObserver.future().get(); + Assert.fail("No exception thrown"); + } catch (ExecutionException e) { + Assert.assertTrue(e.getCause() instanceof InvalidArgumentException); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } +} diff --git a/java-logging/google-cloud-logging/src/test/java/com/google/cloud/logging/v2/MetricsClientTest.java b/java-logging/google-cloud-logging/src/test/java/com/google/cloud/logging/v2/MetricsClientTest.java new file mode 100644 index 000000000000..a73df69379b0 --- /dev/null +++ b/java-logging/google-cloud-logging/src/test/java/com/google/cloud/logging/v2/MetricsClientTest.java @@ -0,0 +1,550 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2; + +import static com.google.cloud.logging.v2.MetricsClient.ListLogMetricsPagedResponse; + +import com.google.api.Distribution; +import com.google.api.MetricDescriptor; +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.common.collect.Lists; +import com.google.logging.v2.CreateLogMetricRequest; +import com.google.logging.v2.DeleteLogMetricRequest; +import com.google.logging.v2.GetLogMetricRequest; +import com.google.logging.v2.ListLogMetricsRequest; +import com.google.logging.v2.ListLogMetricsResponse; +import com.google.logging.v2.LogMetric; +import com.google.logging.v2.LogMetricName; +import com.google.logging.v2.ProjectName; +import com.google.logging.v2.UpdateLogMetricRequest; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import com.google.protobuf.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.UUID; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class MetricsClientTest { + private static MockMetricsServiceV2 mockMetricsServiceV2; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private MetricsClient client; + + @BeforeClass + public static void startStaticServer() { + mockMetricsServiceV2 = new MockMetricsServiceV2(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockMetricsServiceV2)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + MetricsSettings settings = + MetricsSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = MetricsClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void listLogMetricsTest() throws Exception { + LogMetric responsesElement = LogMetric.newBuilder().build(); + ListLogMetricsResponse expectedResponse = + ListLogMetricsResponse.newBuilder() + .setNextPageToken("") + .addAllMetrics(Arrays.asList(responsesElement)) + .build(); + mockMetricsServiceV2.addResponse(expectedResponse); + + ProjectName parent = ProjectName.of("[PROJECT]"); + + ListLogMetricsPagedResponse pagedListResponse = client.listLogMetrics(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getMetricsList().get(0), resources.get(0)); + + List actualRequests = mockMetricsServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLogMetricsRequest actualRequest = ((ListLogMetricsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLogMetricsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMetricsServiceV2.addException(exception); + + try { + ProjectName parent = ProjectName.of("[PROJECT]"); + client.listLogMetrics(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLogMetricsTest2() throws Exception { + LogMetric responsesElement = LogMetric.newBuilder().build(); + ListLogMetricsResponse expectedResponse = + ListLogMetricsResponse.newBuilder() + .setNextPageToken("") + .addAllMetrics(Arrays.asList(responsesElement)) + .build(); + mockMetricsServiceV2.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListLogMetricsPagedResponse pagedListResponse = client.listLogMetrics(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getMetricsList().get(0), resources.get(0)); + + List actualRequests = mockMetricsServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLogMetricsRequest actualRequest = ((ListLogMetricsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLogMetricsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMetricsServiceV2.addException(exception); + + try { + String parent = "parent-995424086"; + client.listLogMetrics(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLogMetricTest() throws Exception { + LogMetric expectedResponse = + LogMetric.newBuilder() + .setName(LogMetricName.of("[PROJECT]", "[METRIC]").toString()) + .setDescription("description-1724546052") + .setFilter("filter-1274492040") + .setBucketName("bucketName1117008789") + .setDisabled(true) + .setMetricDescriptor(MetricDescriptor.newBuilder().build()) + .setValueExtractor("valueExtractor-1867420749") + .putAllLabelExtractors(new HashMap()) + .setBucketOptions(Distribution.BucketOptions.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMetricsServiceV2.addResponse(expectedResponse); + + LogMetricName metricName = LogMetricName.of("[PROJECT]", "[METRIC]"); + + LogMetric actualResponse = client.getLogMetric(metricName); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMetricsServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLogMetricRequest actualRequest = ((GetLogMetricRequest) actualRequests.get(0)); + + Assert.assertEquals(metricName.toString(), actualRequest.getMetricName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLogMetricExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMetricsServiceV2.addException(exception); + + try { + LogMetricName metricName = LogMetricName.of("[PROJECT]", "[METRIC]"); + client.getLogMetric(metricName); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLogMetricTest2() throws Exception { + LogMetric expectedResponse = + LogMetric.newBuilder() + .setName(LogMetricName.of("[PROJECT]", "[METRIC]").toString()) + .setDescription("description-1724546052") + .setFilter("filter-1274492040") + .setBucketName("bucketName1117008789") + .setDisabled(true) + .setMetricDescriptor(MetricDescriptor.newBuilder().build()) + .setValueExtractor("valueExtractor-1867420749") + .putAllLabelExtractors(new HashMap()) + .setBucketOptions(Distribution.BucketOptions.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMetricsServiceV2.addResponse(expectedResponse); + + String metricName = "metricName-610759589"; + + LogMetric actualResponse = client.getLogMetric(metricName); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMetricsServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLogMetricRequest actualRequest = ((GetLogMetricRequest) actualRequests.get(0)); + + Assert.assertEquals(metricName, actualRequest.getMetricName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLogMetricExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMetricsServiceV2.addException(exception); + + try { + String metricName = "metricName-610759589"; + client.getLogMetric(metricName); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createLogMetricTest() throws Exception { + LogMetric expectedResponse = + LogMetric.newBuilder() + .setName(LogMetricName.of("[PROJECT]", "[METRIC]").toString()) + .setDescription("description-1724546052") + .setFilter("filter-1274492040") + .setBucketName("bucketName1117008789") + .setDisabled(true) + .setMetricDescriptor(MetricDescriptor.newBuilder().build()) + .setValueExtractor("valueExtractor-1867420749") + .putAllLabelExtractors(new HashMap()) + .setBucketOptions(Distribution.BucketOptions.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMetricsServiceV2.addResponse(expectedResponse); + + ProjectName parent = ProjectName.of("[PROJECT]"); + LogMetric metric = LogMetric.newBuilder().build(); + + LogMetric actualResponse = client.createLogMetric(parent, metric); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMetricsServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateLogMetricRequest actualRequest = ((CreateLogMetricRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(metric, actualRequest.getMetric()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createLogMetricExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMetricsServiceV2.addException(exception); + + try { + ProjectName parent = ProjectName.of("[PROJECT]"); + LogMetric metric = LogMetric.newBuilder().build(); + client.createLogMetric(parent, metric); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createLogMetricTest2() throws Exception { + LogMetric expectedResponse = + LogMetric.newBuilder() + .setName(LogMetricName.of("[PROJECT]", "[METRIC]").toString()) + .setDescription("description-1724546052") + .setFilter("filter-1274492040") + .setBucketName("bucketName1117008789") + .setDisabled(true) + .setMetricDescriptor(MetricDescriptor.newBuilder().build()) + .setValueExtractor("valueExtractor-1867420749") + .putAllLabelExtractors(new HashMap()) + .setBucketOptions(Distribution.BucketOptions.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMetricsServiceV2.addResponse(expectedResponse); + + String parent = "parent-995424086"; + LogMetric metric = LogMetric.newBuilder().build(); + + LogMetric actualResponse = client.createLogMetric(parent, metric); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMetricsServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateLogMetricRequest actualRequest = ((CreateLogMetricRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(metric, actualRequest.getMetric()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createLogMetricExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMetricsServiceV2.addException(exception); + + try { + String parent = "parent-995424086"; + LogMetric metric = LogMetric.newBuilder().build(); + client.createLogMetric(parent, metric); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateLogMetricTest() throws Exception { + LogMetric expectedResponse = + LogMetric.newBuilder() + .setName(LogMetricName.of("[PROJECT]", "[METRIC]").toString()) + .setDescription("description-1724546052") + .setFilter("filter-1274492040") + .setBucketName("bucketName1117008789") + .setDisabled(true) + .setMetricDescriptor(MetricDescriptor.newBuilder().build()) + .setValueExtractor("valueExtractor-1867420749") + .putAllLabelExtractors(new HashMap()) + .setBucketOptions(Distribution.BucketOptions.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMetricsServiceV2.addResponse(expectedResponse); + + LogMetricName metricName = LogMetricName.of("[PROJECT]", "[METRIC]"); + LogMetric metric = LogMetric.newBuilder().build(); + + LogMetric actualResponse = client.updateLogMetric(metricName, metric); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMetricsServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateLogMetricRequest actualRequest = ((UpdateLogMetricRequest) actualRequests.get(0)); + + Assert.assertEquals(metricName.toString(), actualRequest.getMetricName()); + Assert.assertEquals(metric, actualRequest.getMetric()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateLogMetricExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMetricsServiceV2.addException(exception); + + try { + LogMetricName metricName = LogMetricName.of("[PROJECT]", "[METRIC]"); + LogMetric metric = LogMetric.newBuilder().build(); + client.updateLogMetric(metricName, metric); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateLogMetricTest2() throws Exception { + LogMetric expectedResponse = + LogMetric.newBuilder() + .setName(LogMetricName.of("[PROJECT]", "[METRIC]").toString()) + .setDescription("description-1724546052") + .setFilter("filter-1274492040") + .setBucketName("bucketName1117008789") + .setDisabled(true) + .setMetricDescriptor(MetricDescriptor.newBuilder().build()) + .setValueExtractor("valueExtractor-1867420749") + .putAllLabelExtractors(new HashMap()) + .setBucketOptions(Distribution.BucketOptions.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockMetricsServiceV2.addResponse(expectedResponse); + + String metricName = "metricName-610759589"; + LogMetric metric = LogMetric.newBuilder().build(); + + LogMetric actualResponse = client.updateLogMetric(metricName, metric); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockMetricsServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateLogMetricRequest actualRequest = ((UpdateLogMetricRequest) actualRequests.get(0)); + + Assert.assertEquals(metricName, actualRequest.getMetricName()); + Assert.assertEquals(metric, actualRequest.getMetric()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateLogMetricExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMetricsServiceV2.addException(exception); + + try { + String metricName = "metricName-610759589"; + LogMetric metric = LogMetric.newBuilder().build(); + client.updateLogMetric(metricName, metric); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteLogMetricTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockMetricsServiceV2.addResponse(expectedResponse); + + LogMetricName metricName = LogMetricName.of("[PROJECT]", "[METRIC]"); + + client.deleteLogMetric(metricName); + + List actualRequests = mockMetricsServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteLogMetricRequest actualRequest = ((DeleteLogMetricRequest) actualRequests.get(0)); + + Assert.assertEquals(metricName.toString(), actualRequest.getMetricName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteLogMetricExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMetricsServiceV2.addException(exception); + + try { + LogMetricName metricName = LogMetricName.of("[PROJECT]", "[METRIC]"); + client.deleteLogMetric(metricName); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteLogMetricTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockMetricsServiceV2.addResponse(expectedResponse); + + String metricName = "metricName-610759589"; + + client.deleteLogMetric(metricName); + + List actualRequests = mockMetricsServiceV2.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteLogMetricRequest actualRequest = ((DeleteLogMetricRequest) actualRequests.get(0)); + + Assert.assertEquals(metricName, actualRequest.getMetricName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteLogMetricExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockMetricsServiceV2.addException(exception); + + try { + String metricName = "metricName-610759589"; + client.deleteLogMetric(metricName); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-logging/google-cloud-logging/src/test/java/com/google/cloud/logging/v2/MockConfigServiceV2.java b/java-logging/google-cloud-logging/src/test/java/com/google/cloud/logging/v2/MockConfigServiceV2.java new file mode 100644 index 000000000000..4307b381850c --- /dev/null +++ b/java-logging/google-cloud-logging/src/test/java/com/google/cloud/logging/v2/MockConfigServiceV2.java @@ -0,0 +1,59 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2; + +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 MockConfigServiceV2 implements MockGrpcService { + private final MockConfigServiceV2Impl serviceImpl; + + public MockConfigServiceV2() { + serviceImpl = new MockConfigServiceV2Impl(); + } + + @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/java-logging/google-cloud-logging/src/test/java/com/google/cloud/logging/v2/MockConfigServiceV2Impl.java b/java-logging/google-cloud-logging/src/test/java/com/google/cloud/logging/v2/MockConfigServiceV2Impl.java new file mode 100644 index 000000000000..2b795e6c4327 --- /dev/null +++ b/java-logging/google-cloud-logging/src/test/java/com/google/cloud/logging/v2/MockConfigServiceV2Impl.java @@ -0,0 +1,762 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2; + +import com.google.api.core.BetaApi; +import com.google.logging.v2.CmekSettings; +import com.google.logging.v2.ConfigServiceV2Grpc.ConfigServiceV2ImplBase; +import com.google.logging.v2.CopyLogEntriesRequest; +import com.google.logging.v2.CreateBucketRequest; +import com.google.logging.v2.CreateExclusionRequest; +import com.google.logging.v2.CreateLinkRequest; +import com.google.logging.v2.CreateSinkRequest; +import com.google.logging.v2.CreateViewRequest; +import com.google.logging.v2.DeleteBucketRequest; +import com.google.logging.v2.DeleteExclusionRequest; +import com.google.logging.v2.DeleteLinkRequest; +import com.google.logging.v2.DeleteSinkRequest; +import com.google.logging.v2.DeleteViewRequest; +import com.google.logging.v2.GetBucketRequest; +import com.google.logging.v2.GetCmekSettingsRequest; +import com.google.logging.v2.GetExclusionRequest; +import com.google.logging.v2.GetLinkRequest; +import com.google.logging.v2.GetSettingsRequest; +import com.google.logging.v2.GetSinkRequest; +import com.google.logging.v2.GetViewRequest; +import com.google.logging.v2.Link; +import com.google.logging.v2.ListBucketsRequest; +import com.google.logging.v2.ListBucketsResponse; +import com.google.logging.v2.ListExclusionsRequest; +import com.google.logging.v2.ListExclusionsResponse; +import com.google.logging.v2.ListLinksRequest; +import com.google.logging.v2.ListLinksResponse; +import com.google.logging.v2.ListSinksRequest; +import com.google.logging.v2.ListSinksResponse; +import com.google.logging.v2.ListViewsRequest; +import com.google.logging.v2.ListViewsResponse; +import com.google.logging.v2.LogBucket; +import com.google.logging.v2.LogExclusion; +import com.google.logging.v2.LogSink; +import com.google.logging.v2.LogView; +import com.google.logging.v2.Settings; +import com.google.logging.v2.UndeleteBucketRequest; +import com.google.logging.v2.UpdateBucketRequest; +import com.google.logging.v2.UpdateCmekSettingsRequest; +import com.google.logging.v2.UpdateExclusionRequest; +import com.google.logging.v2.UpdateSettingsRequest; +import com.google.logging.v2.UpdateSinkRequest; +import com.google.logging.v2.UpdateViewRequest; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockConfigServiceV2Impl extends ConfigServiceV2ImplBase { + private List requests; + private Queue responses; + + public MockConfigServiceV2Impl() { + 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 listBuckets( + ListBucketsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListBucketsResponse) { + requests.add(request); + responseObserver.onNext(((ListBucketsResponse) 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 ListBuckets, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListBucketsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getBucket(GetBucketRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof LogBucket) { + requests.add(request); + responseObserver.onNext(((LogBucket) 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 GetBucket, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + LogBucket.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createBucketAsync( + CreateBucketRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateBucketAsync, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateBucketAsync( + UpdateBucketRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateBucketAsync, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createBucket( + CreateBucketRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof LogBucket) { + requests.add(request); + responseObserver.onNext(((LogBucket) 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 CreateBucket, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + LogBucket.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateBucket( + UpdateBucketRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof LogBucket) { + requests.add(request); + responseObserver.onNext(((LogBucket) 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 UpdateBucket, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + LogBucket.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteBucket(DeleteBucketRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteBucket, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void undeleteBucket( + UndeleteBucketRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UndeleteBucket, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listViews( + ListViewsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListViewsResponse) { + requests.add(request); + responseObserver.onNext(((ListViewsResponse) 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 ListViews, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListViewsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getView(GetViewRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof LogView) { + requests.add(request); + responseObserver.onNext(((LogView) 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 GetView, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + LogView.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createView(CreateViewRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof LogView) { + requests.add(request); + responseObserver.onNext(((LogView) 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 CreateView, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + LogView.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateView(UpdateViewRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof LogView) { + requests.add(request); + responseObserver.onNext(((LogView) 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 UpdateView, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + LogView.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteView(DeleteViewRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteView, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listSinks( + ListSinksRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListSinksResponse) { + requests.add(request); + responseObserver.onNext(((ListSinksResponse) 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 ListSinks, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListSinksResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getSink(GetSinkRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof LogSink) { + requests.add(request); + responseObserver.onNext(((LogSink) 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 GetSink, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + LogSink.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createSink(CreateSinkRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof LogSink) { + requests.add(request); + responseObserver.onNext(((LogSink) 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 CreateSink, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + LogSink.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateSink(UpdateSinkRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof LogSink) { + requests.add(request); + responseObserver.onNext(((LogSink) 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 UpdateSink, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + LogSink.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteSink(DeleteSinkRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteSink, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createLink(CreateLinkRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateLink, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteLink(DeleteLinkRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteLink, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listLinks( + ListLinksRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListLinksResponse) { + requests.add(request); + responseObserver.onNext(((ListLinksResponse) 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 ListLinks, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListLinksResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getLink(GetLinkRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Link) { + requests.add(request); + responseObserver.onNext(((Link) 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 GetLink, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Link.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listExclusions( + ListExclusionsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListExclusionsResponse) { + requests.add(request); + responseObserver.onNext(((ListExclusionsResponse) 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 ListExclusions, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListExclusionsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getExclusion( + GetExclusionRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof LogExclusion) { + requests.add(request); + responseObserver.onNext(((LogExclusion) 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 GetExclusion, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + LogExclusion.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createExclusion( + CreateExclusionRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof LogExclusion) { + requests.add(request); + responseObserver.onNext(((LogExclusion) 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 CreateExclusion, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + LogExclusion.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateExclusion( + UpdateExclusionRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof LogExclusion) { + requests.add(request); + responseObserver.onNext(((LogExclusion) 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 UpdateExclusion, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + LogExclusion.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteExclusion( + DeleteExclusionRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteExclusion, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getCmekSettings( + GetCmekSettingsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof CmekSettings) { + requests.add(request); + responseObserver.onNext(((CmekSettings) 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 GetCmekSettings, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + CmekSettings.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateCmekSettings( + UpdateCmekSettingsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof CmekSettings) { + requests.add(request); + responseObserver.onNext(((CmekSettings) 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 UpdateCmekSettings, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + CmekSettings.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getSettings(GetSettingsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Settings) { + requests.add(request); + responseObserver.onNext(((Settings) 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 GetSettings, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Settings.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateSettings( + UpdateSettingsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Settings) { + requests.add(request); + responseObserver.onNext(((Settings) 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 UpdateSettings, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Settings.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void copyLogEntries( + CopyLogEntriesRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CopyLogEntries, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-logging/google-cloud-logging/src/test/java/com/google/cloud/logging/v2/MockLoggingServiceV2.java b/java-logging/google-cloud-logging/src/test/java/com/google/cloud/logging/v2/MockLoggingServiceV2.java new file mode 100644 index 000000000000..3a0d1f388bc4 --- /dev/null +++ b/java-logging/google-cloud-logging/src/test/java/com/google/cloud/logging/v2/MockLoggingServiceV2.java @@ -0,0 +1,59 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2; + +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 MockLoggingServiceV2 implements MockGrpcService { + private final MockLoggingServiceV2Impl serviceImpl; + + public MockLoggingServiceV2() { + serviceImpl = new MockLoggingServiceV2Impl(); + } + + @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/java-logging/google-cloud-logging/src/test/java/com/google/cloud/logging/v2/MockLoggingServiceV2Impl.java b/java-logging/google-cloud-logging/src/test/java/com/google/cloud/logging/v2/MockLoggingServiceV2Impl.java new file mode 100644 index 000000000000..8e2ff8754983 --- /dev/null +++ b/java-logging/google-cloud-logging/src/test/java/com/google/cloud/logging/v2/MockLoggingServiceV2Impl.java @@ -0,0 +1,215 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2; + +import com.google.api.core.BetaApi; +import com.google.logging.v2.DeleteLogRequest; +import com.google.logging.v2.ListLogEntriesRequest; +import com.google.logging.v2.ListLogEntriesResponse; +import com.google.logging.v2.ListLogsRequest; +import com.google.logging.v2.ListLogsResponse; +import com.google.logging.v2.ListMonitoredResourceDescriptorsRequest; +import com.google.logging.v2.ListMonitoredResourceDescriptorsResponse; +import com.google.logging.v2.LoggingServiceV2Grpc.LoggingServiceV2ImplBase; +import com.google.logging.v2.TailLogEntriesRequest; +import com.google.logging.v2.TailLogEntriesResponse; +import com.google.logging.v2.WriteLogEntriesRequest; +import com.google.logging.v2.WriteLogEntriesResponse; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockLoggingServiceV2Impl extends LoggingServiceV2ImplBase { + private List requests; + private Queue responses; + + public MockLoggingServiceV2Impl() { + 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 deleteLog(DeleteLogRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteLog, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void writeLogEntries( + WriteLogEntriesRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof WriteLogEntriesResponse) { + requests.add(request); + responseObserver.onNext(((WriteLogEntriesResponse) 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 WriteLogEntries, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + WriteLogEntriesResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listLogEntries( + ListLogEntriesRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListLogEntriesResponse) { + requests.add(request); + responseObserver.onNext(((ListLogEntriesResponse) 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 ListLogEntries, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListLogEntriesResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listMonitoredResourceDescriptors( + ListMonitoredResourceDescriptorsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListMonitoredResourceDescriptorsResponse) { + requests.add(request); + responseObserver.onNext(((ListMonitoredResourceDescriptorsResponse) 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 ListMonitoredResourceDescriptors," + + " expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListMonitoredResourceDescriptorsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listLogs(ListLogsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListLogsResponse) { + requests.add(request); + responseObserver.onNext(((ListLogsResponse) 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 ListLogs, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListLogsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public StreamObserver tailLogEntries( + final StreamObserver responseObserver) { + StreamObserver requestObserver = + new StreamObserver() { + @Override + public void onNext(TailLogEntriesRequest value) { + requests.add(value); + final Object response = responses.remove(); + if (response instanceof TailLogEntriesResponse) { + responseObserver.onNext(((TailLogEntriesResponse) response)); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method TailLogEntries, expected %s or" + + " %s", + response == null ? "null" : response.getClass().getName(), + TailLogEntriesResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void onError(Throwable t) { + responseObserver.onError(t); + } + + @Override + public void onCompleted() { + responseObserver.onCompleted(); + } + }; + return requestObserver; + } +} diff --git a/java-logging/google-cloud-logging/src/test/java/com/google/cloud/logging/v2/MockMetricsServiceV2.java b/java-logging/google-cloud-logging/src/test/java/com/google/cloud/logging/v2/MockMetricsServiceV2.java new file mode 100644 index 000000000000..d4bb1d5af7ad --- /dev/null +++ b/java-logging/google-cloud-logging/src/test/java/com/google/cloud/logging/v2/MockMetricsServiceV2.java @@ -0,0 +1,59 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2; + +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 MockMetricsServiceV2 implements MockGrpcService { + private final MockMetricsServiceV2Impl serviceImpl; + + public MockMetricsServiceV2() { + serviceImpl = new MockMetricsServiceV2Impl(); + } + + @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/java-logging/google-cloud-logging/src/test/java/com/google/cloud/logging/v2/MockMetricsServiceV2Impl.java b/java-logging/google-cloud-logging/src/test/java/com/google/cloud/logging/v2/MockMetricsServiceV2Impl.java new file mode 100644 index 000000000000..597b93be7c49 --- /dev/null +++ b/java-logging/google-cloud-logging/src/test/java/com/google/cloud/logging/v2/MockMetricsServiceV2Impl.java @@ -0,0 +1,173 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2; + +import com.google.api.core.BetaApi; +import com.google.logging.v2.CreateLogMetricRequest; +import com.google.logging.v2.DeleteLogMetricRequest; +import com.google.logging.v2.GetLogMetricRequest; +import com.google.logging.v2.ListLogMetricsRequest; +import com.google.logging.v2.ListLogMetricsResponse; +import com.google.logging.v2.LogMetric; +import com.google.logging.v2.MetricsServiceV2Grpc.MetricsServiceV2ImplBase; +import com.google.logging.v2.UpdateLogMetricRequest; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockMetricsServiceV2Impl extends MetricsServiceV2ImplBase { + private List requests; + private Queue responses; + + public MockMetricsServiceV2Impl() { + 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 listLogMetrics( + ListLogMetricsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListLogMetricsResponse) { + requests.add(request); + responseObserver.onNext(((ListLogMetricsResponse) 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 ListLogMetrics, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListLogMetricsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getLogMetric( + GetLogMetricRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof LogMetric) { + requests.add(request); + responseObserver.onNext(((LogMetric) 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 GetLogMetric, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + LogMetric.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void createLogMetric( + CreateLogMetricRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof LogMetric) { + requests.add(request); + responseObserver.onNext(((LogMetric) 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 CreateLogMetric, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + LogMetric.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateLogMetric( + UpdateLogMetricRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof LogMetric) { + requests.add(request); + responseObserver.onNext(((LogMetric) 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 UpdateLogMetric, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + LogMetric.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteLogMetric( + DeleteLogMetricRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteLogMetric, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-logging/grpc-google-cloud-logging-v2/clirr-ignored-differences.xml b/java-logging/grpc-google-cloud-logging-v2/clirr-ignored-differences.xml new file mode 100644 index 000000000000..539f32ba95a8 --- /dev/null +++ b/java-logging/grpc-google-cloud-logging-v2/clirr-ignored-differences.xml @@ -0,0 +1,33 @@ + + + + 7012 + com/google/logging/v2/ConfigServiceV2Grpc$AsyncService + void createBucketAsync(com.google.logging.v2.CreateBucketRequest, io.grpc.stub.StreamObserver) + + + 7012 + com/google/logging/v2/ConfigServiceV2Grpc$AsyncService + void updateBucketAsync(com.google.logging.v2.UpdateBucketRequest, io.grpc.stub.StreamObserver) + + + 7012 + com/google/logging/v2/ConfigServiceV2Grpc$AsyncService + void createLink(com.google.logging.v2.CreateLinkRequest, io.grpc.stub.StreamObserver) + + + 7012 + com/google/logging/v2/ConfigServiceV2Grpc$AsyncService + void deleteLink(com.google.logging.v2.DeleteLinkRequest, io.grpc.stub.StreamObserver) + + + 7012 + com/google/logging/v2/ConfigServiceV2Grpc$AsyncService + void getLink(com.google.logging.v2.GetLinkRequest, io.grpc.stub.StreamObserver) + + + 7012 + com/google/logging/v2/ConfigServiceV2Grpc$AsyncService + void listLinks(com.google.logging.v2.ListLinksRequest, io.grpc.stub.StreamObserver) + + diff --git a/java-logging/grpc-google-cloud-logging-v2/pom.xml b/java-logging/grpc-google-cloud-logging-v2/pom.xml new file mode 100644 index 000000000000..2a18ac7eab2c --- /dev/null +++ b/java-logging/grpc-google-cloud-logging-v2/pom.xml @@ -0,0 +1,54 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-logging-v2 + 0.112.10-SNAPSHOT + grpc-google-cloud-logging-v2 + GRPC library for grpc-google-cloud-logging-v2 + + com.google.cloud + google-cloud-logging-parent + 3.23.10-SNAPSHOT + + + + com.google.guava + guava + + + com.google.protobuf + protobuf-java + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-cloud-logging-v2 + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + \ No newline at end of file diff --git a/java-logging/grpc-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ConfigServiceV2Grpc.java b/java-logging/grpc-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ConfigServiceV2Grpc.java new file mode 100644 index 000000000000..e306944edbf1 --- /dev/null +++ b/java-logging/grpc-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ConfigServiceV2Grpc.java @@ -0,0 +1,4532 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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.logging.v2; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Service for configuring sinks used to route log entries.
+ * 
+ */ +@io.grpc.stub.annotations.GrpcGenerated +public final class ConfigServiceV2Grpc { + + private ConfigServiceV2Grpc() {} + + public static final java.lang.String SERVICE_NAME = "google.logging.v2.ConfigServiceV2"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.logging.v2.ListBucketsRequest, com.google.logging.v2.ListBucketsResponse> + getListBucketsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListBuckets", + requestType = com.google.logging.v2.ListBucketsRequest.class, + responseType = com.google.logging.v2.ListBucketsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.logging.v2.ListBucketsRequest, com.google.logging.v2.ListBucketsResponse> + getListBucketsMethod() { + io.grpc.MethodDescriptor< + com.google.logging.v2.ListBucketsRequest, com.google.logging.v2.ListBucketsResponse> + getListBucketsMethod; + if ((getListBucketsMethod = ConfigServiceV2Grpc.getListBucketsMethod) == null) { + synchronized (ConfigServiceV2Grpc.class) { + if ((getListBucketsMethod = ConfigServiceV2Grpc.getListBucketsMethod) == null) { + ConfigServiceV2Grpc.getListBucketsMethod = + getListBucketsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListBuckets")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.ListBucketsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.ListBucketsResponse.getDefaultInstance())) + .setSchemaDescriptor( + new ConfigServiceV2MethodDescriptorSupplier("ListBuckets")) + .build(); + } + } + } + return getListBucketsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.logging.v2.GetBucketRequest, com.google.logging.v2.LogBucket> + getGetBucketMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetBucket", + requestType = com.google.logging.v2.GetBucketRequest.class, + responseType = com.google.logging.v2.LogBucket.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.logging.v2.GetBucketRequest, com.google.logging.v2.LogBucket> + getGetBucketMethod() { + io.grpc.MethodDescriptor< + com.google.logging.v2.GetBucketRequest, com.google.logging.v2.LogBucket> + getGetBucketMethod; + if ((getGetBucketMethod = ConfigServiceV2Grpc.getGetBucketMethod) == null) { + synchronized (ConfigServiceV2Grpc.class) { + if ((getGetBucketMethod = ConfigServiceV2Grpc.getGetBucketMethod) == null) { + ConfigServiceV2Grpc.getGetBucketMethod = + getGetBucketMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetBucket")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.GetBucketRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.LogBucket.getDefaultInstance())) + .setSchemaDescriptor(new ConfigServiceV2MethodDescriptorSupplier("GetBucket")) + .build(); + } + } + } + return getGetBucketMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.logging.v2.CreateBucketRequest, com.google.longrunning.Operation> + getCreateBucketAsyncMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateBucketAsync", + requestType = com.google.logging.v2.CreateBucketRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.logging.v2.CreateBucketRequest, com.google.longrunning.Operation> + getCreateBucketAsyncMethod() { + io.grpc.MethodDescriptor< + com.google.logging.v2.CreateBucketRequest, com.google.longrunning.Operation> + getCreateBucketAsyncMethod; + if ((getCreateBucketAsyncMethod = ConfigServiceV2Grpc.getCreateBucketAsyncMethod) == null) { + synchronized (ConfigServiceV2Grpc.class) { + if ((getCreateBucketAsyncMethod = ConfigServiceV2Grpc.getCreateBucketAsyncMethod) == null) { + ConfigServiceV2Grpc.getCreateBucketAsyncMethod = + getCreateBucketAsyncMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateBucketAsync")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.CreateBucketRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new ConfigServiceV2MethodDescriptorSupplier("CreateBucketAsync")) + .build(); + } + } + } + return getCreateBucketAsyncMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.logging.v2.UpdateBucketRequest, com.google.longrunning.Operation> + getUpdateBucketAsyncMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateBucketAsync", + requestType = com.google.logging.v2.UpdateBucketRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.logging.v2.UpdateBucketRequest, com.google.longrunning.Operation> + getUpdateBucketAsyncMethod() { + io.grpc.MethodDescriptor< + com.google.logging.v2.UpdateBucketRequest, com.google.longrunning.Operation> + getUpdateBucketAsyncMethod; + if ((getUpdateBucketAsyncMethod = ConfigServiceV2Grpc.getUpdateBucketAsyncMethod) == null) { + synchronized (ConfigServiceV2Grpc.class) { + if ((getUpdateBucketAsyncMethod = ConfigServiceV2Grpc.getUpdateBucketAsyncMethod) == null) { + ConfigServiceV2Grpc.getUpdateBucketAsyncMethod = + getUpdateBucketAsyncMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateBucketAsync")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.UpdateBucketRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new ConfigServiceV2MethodDescriptorSupplier("UpdateBucketAsync")) + .build(); + } + } + } + return getUpdateBucketAsyncMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.logging.v2.CreateBucketRequest, com.google.logging.v2.LogBucket> + getCreateBucketMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateBucket", + requestType = com.google.logging.v2.CreateBucketRequest.class, + responseType = com.google.logging.v2.LogBucket.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.logging.v2.CreateBucketRequest, com.google.logging.v2.LogBucket> + getCreateBucketMethod() { + io.grpc.MethodDescriptor< + com.google.logging.v2.CreateBucketRequest, com.google.logging.v2.LogBucket> + getCreateBucketMethod; + if ((getCreateBucketMethod = ConfigServiceV2Grpc.getCreateBucketMethod) == null) { + synchronized (ConfigServiceV2Grpc.class) { + if ((getCreateBucketMethod = ConfigServiceV2Grpc.getCreateBucketMethod) == null) { + ConfigServiceV2Grpc.getCreateBucketMethod = + getCreateBucketMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateBucket")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.CreateBucketRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.LogBucket.getDefaultInstance())) + .setSchemaDescriptor( + new ConfigServiceV2MethodDescriptorSupplier("CreateBucket")) + .build(); + } + } + } + return getCreateBucketMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.logging.v2.UpdateBucketRequest, com.google.logging.v2.LogBucket> + getUpdateBucketMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateBucket", + requestType = com.google.logging.v2.UpdateBucketRequest.class, + responseType = com.google.logging.v2.LogBucket.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.logging.v2.UpdateBucketRequest, com.google.logging.v2.LogBucket> + getUpdateBucketMethod() { + io.grpc.MethodDescriptor< + com.google.logging.v2.UpdateBucketRequest, com.google.logging.v2.LogBucket> + getUpdateBucketMethod; + if ((getUpdateBucketMethod = ConfigServiceV2Grpc.getUpdateBucketMethod) == null) { + synchronized (ConfigServiceV2Grpc.class) { + if ((getUpdateBucketMethod = ConfigServiceV2Grpc.getUpdateBucketMethod) == null) { + ConfigServiceV2Grpc.getUpdateBucketMethod = + getUpdateBucketMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateBucket")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.UpdateBucketRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.LogBucket.getDefaultInstance())) + .setSchemaDescriptor( + new ConfigServiceV2MethodDescriptorSupplier("UpdateBucket")) + .build(); + } + } + } + return getUpdateBucketMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.logging.v2.DeleteBucketRequest, com.google.protobuf.Empty> + getDeleteBucketMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteBucket", + requestType = com.google.logging.v2.DeleteBucketRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.logging.v2.DeleteBucketRequest, com.google.protobuf.Empty> + getDeleteBucketMethod() { + io.grpc.MethodDescriptor + getDeleteBucketMethod; + if ((getDeleteBucketMethod = ConfigServiceV2Grpc.getDeleteBucketMethod) == null) { + synchronized (ConfigServiceV2Grpc.class) { + if ((getDeleteBucketMethod = ConfigServiceV2Grpc.getDeleteBucketMethod) == null) { + ConfigServiceV2Grpc.getDeleteBucketMethod = + getDeleteBucketMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteBucket")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.DeleteBucketRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new ConfigServiceV2MethodDescriptorSupplier("DeleteBucket")) + .build(); + } + } + } + return getDeleteBucketMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.logging.v2.UndeleteBucketRequest, com.google.protobuf.Empty> + getUndeleteBucketMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UndeleteBucket", + requestType = com.google.logging.v2.UndeleteBucketRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.logging.v2.UndeleteBucketRequest, com.google.protobuf.Empty> + getUndeleteBucketMethod() { + io.grpc.MethodDescriptor + getUndeleteBucketMethod; + if ((getUndeleteBucketMethod = ConfigServiceV2Grpc.getUndeleteBucketMethod) == null) { + synchronized (ConfigServiceV2Grpc.class) { + if ((getUndeleteBucketMethod = ConfigServiceV2Grpc.getUndeleteBucketMethod) == null) { + ConfigServiceV2Grpc.getUndeleteBucketMethod = + getUndeleteBucketMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UndeleteBucket")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.UndeleteBucketRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new ConfigServiceV2MethodDescriptorSupplier("UndeleteBucket")) + .build(); + } + } + } + return getUndeleteBucketMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.logging.v2.ListViewsRequest, com.google.logging.v2.ListViewsResponse> + getListViewsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListViews", + requestType = com.google.logging.v2.ListViewsRequest.class, + responseType = com.google.logging.v2.ListViewsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.logging.v2.ListViewsRequest, com.google.logging.v2.ListViewsResponse> + getListViewsMethod() { + io.grpc.MethodDescriptor< + com.google.logging.v2.ListViewsRequest, com.google.logging.v2.ListViewsResponse> + getListViewsMethod; + if ((getListViewsMethod = ConfigServiceV2Grpc.getListViewsMethod) == null) { + synchronized (ConfigServiceV2Grpc.class) { + if ((getListViewsMethod = ConfigServiceV2Grpc.getListViewsMethod) == null) { + ConfigServiceV2Grpc.getListViewsMethod = + getListViewsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListViews")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.ListViewsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.ListViewsResponse.getDefaultInstance())) + .setSchemaDescriptor(new ConfigServiceV2MethodDescriptorSupplier("ListViews")) + .build(); + } + } + } + return getListViewsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.logging.v2.GetViewRequest, com.google.logging.v2.LogView> + getGetViewMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetView", + requestType = com.google.logging.v2.GetViewRequest.class, + responseType = com.google.logging.v2.LogView.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.logging.v2.GetViewRequest, com.google.logging.v2.LogView> + getGetViewMethod() { + io.grpc.MethodDescriptor + getGetViewMethod; + if ((getGetViewMethod = ConfigServiceV2Grpc.getGetViewMethod) == null) { + synchronized (ConfigServiceV2Grpc.class) { + if ((getGetViewMethod = ConfigServiceV2Grpc.getGetViewMethod) == null) { + ConfigServiceV2Grpc.getGetViewMethod = + getGetViewMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetView")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.GetViewRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.LogView.getDefaultInstance())) + .setSchemaDescriptor(new ConfigServiceV2MethodDescriptorSupplier("GetView")) + .build(); + } + } + } + return getGetViewMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.logging.v2.CreateViewRequest, com.google.logging.v2.LogView> + getCreateViewMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateView", + requestType = com.google.logging.v2.CreateViewRequest.class, + responseType = com.google.logging.v2.LogView.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.logging.v2.CreateViewRequest, com.google.logging.v2.LogView> + getCreateViewMethod() { + io.grpc.MethodDescriptor + getCreateViewMethod; + if ((getCreateViewMethod = ConfigServiceV2Grpc.getCreateViewMethod) == null) { + synchronized (ConfigServiceV2Grpc.class) { + if ((getCreateViewMethod = ConfigServiceV2Grpc.getCreateViewMethod) == null) { + ConfigServiceV2Grpc.getCreateViewMethod = + getCreateViewMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateView")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.CreateViewRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.LogView.getDefaultInstance())) + .setSchemaDescriptor( + new ConfigServiceV2MethodDescriptorSupplier("CreateView")) + .build(); + } + } + } + return getCreateViewMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.logging.v2.UpdateViewRequest, com.google.logging.v2.LogView> + getUpdateViewMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateView", + requestType = com.google.logging.v2.UpdateViewRequest.class, + responseType = com.google.logging.v2.LogView.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.logging.v2.UpdateViewRequest, com.google.logging.v2.LogView> + getUpdateViewMethod() { + io.grpc.MethodDescriptor + getUpdateViewMethod; + if ((getUpdateViewMethod = ConfigServiceV2Grpc.getUpdateViewMethod) == null) { + synchronized (ConfigServiceV2Grpc.class) { + if ((getUpdateViewMethod = ConfigServiceV2Grpc.getUpdateViewMethod) == null) { + ConfigServiceV2Grpc.getUpdateViewMethod = + getUpdateViewMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateView")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.UpdateViewRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.LogView.getDefaultInstance())) + .setSchemaDescriptor( + new ConfigServiceV2MethodDescriptorSupplier("UpdateView")) + .build(); + } + } + } + return getUpdateViewMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.logging.v2.DeleteViewRequest, com.google.protobuf.Empty> + getDeleteViewMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteView", + requestType = com.google.logging.v2.DeleteViewRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.logging.v2.DeleteViewRequest, com.google.protobuf.Empty> + getDeleteViewMethod() { + io.grpc.MethodDescriptor + getDeleteViewMethod; + if ((getDeleteViewMethod = ConfigServiceV2Grpc.getDeleteViewMethod) == null) { + synchronized (ConfigServiceV2Grpc.class) { + if ((getDeleteViewMethod = ConfigServiceV2Grpc.getDeleteViewMethod) == null) { + ConfigServiceV2Grpc.getDeleteViewMethod = + getDeleteViewMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteView")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.DeleteViewRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new ConfigServiceV2MethodDescriptorSupplier("DeleteView")) + .build(); + } + } + } + return getDeleteViewMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.logging.v2.ListSinksRequest, com.google.logging.v2.ListSinksResponse> + getListSinksMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListSinks", + requestType = com.google.logging.v2.ListSinksRequest.class, + responseType = com.google.logging.v2.ListSinksResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.logging.v2.ListSinksRequest, com.google.logging.v2.ListSinksResponse> + getListSinksMethod() { + io.grpc.MethodDescriptor< + com.google.logging.v2.ListSinksRequest, com.google.logging.v2.ListSinksResponse> + getListSinksMethod; + if ((getListSinksMethod = ConfigServiceV2Grpc.getListSinksMethod) == null) { + synchronized (ConfigServiceV2Grpc.class) { + if ((getListSinksMethod = ConfigServiceV2Grpc.getListSinksMethod) == null) { + ConfigServiceV2Grpc.getListSinksMethod = + getListSinksMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListSinks")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.ListSinksRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.ListSinksResponse.getDefaultInstance())) + .setSchemaDescriptor(new ConfigServiceV2MethodDescriptorSupplier("ListSinks")) + .build(); + } + } + } + return getListSinksMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.logging.v2.GetSinkRequest, com.google.logging.v2.LogSink> + getGetSinkMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetSink", + requestType = com.google.logging.v2.GetSinkRequest.class, + responseType = com.google.logging.v2.LogSink.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.logging.v2.GetSinkRequest, com.google.logging.v2.LogSink> + getGetSinkMethod() { + io.grpc.MethodDescriptor + getGetSinkMethod; + if ((getGetSinkMethod = ConfigServiceV2Grpc.getGetSinkMethod) == null) { + synchronized (ConfigServiceV2Grpc.class) { + if ((getGetSinkMethod = ConfigServiceV2Grpc.getGetSinkMethod) == null) { + ConfigServiceV2Grpc.getGetSinkMethod = + getGetSinkMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetSink")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.GetSinkRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.LogSink.getDefaultInstance())) + .setSchemaDescriptor(new ConfigServiceV2MethodDescriptorSupplier("GetSink")) + .build(); + } + } + } + return getGetSinkMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.logging.v2.CreateSinkRequest, com.google.logging.v2.LogSink> + getCreateSinkMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateSink", + requestType = com.google.logging.v2.CreateSinkRequest.class, + responseType = com.google.logging.v2.LogSink.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.logging.v2.CreateSinkRequest, com.google.logging.v2.LogSink> + getCreateSinkMethod() { + io.grpc.MethodDescriptor + getCreateSinkMethod; + if ((getCreateSinkMethod = ConfigServiceV2Grpc.getCreateSinkMethod) == null) { + synchronized (ConfigServiceV2Grpc.class) { + if ((getCreateSinkMethod = ConfigServiceV2Grpc.getCreateSinkMethod) == null) { + ConfigServiceV2Grpc.getCreateSinkMethod = + getCreateSinkMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateSink")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.CreateSinkRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.LogSink.getDefaultInstance())) + .setSchemaDescriptor( + new ConfigServiceV2MethodDescriptorSupplier("CreateSink")) + .build(); + } + } + } + return getCreateSinkMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.logging.v2.UpdateSinkRequest, com.google.logging.v2.LogSink> + getUpdateSinkMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateSink", + requestType = com.google.logging.v2.UpdateSinkRequest.class, + responseType = com.google.logging.v2.LogSink.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.logging.v2.UpdateSinkRequest, com.google.logging.v2.LogSink> + getUpdateSinkMethod() { + io.grpc.MethodDescriptor + getUpdateSinkMethod; + if ((getUpdateSinkMethod = ConfigServiceV2Grpc.getUpdateSinkMethod) == null) { + synchronized (ConfigServiceV2Grpc.class) { + if ((getUpdateSinkMethod = ConfigServiceV2Grpc.getUpdateSinkMethod) == null) { + ConfigServiceV2Grpc.getUpdateSinkMethod = + getUpdateSinkMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateSink")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.UpdateSinkRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.LogSink.getDefaultInstance())) + .setSchemaDescriptor( + new ConfigServiceV2MethodDescriptorSupplier("UpdateSink")) + .build(); + } + } + } + return getUpdateSinkMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.logging.v2.DeleteSinkRequest, com.google.protobuf.Empty> + getDeleteSinkMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteSink", + requestType = com.google.logging.v2.DeleteSinkRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.logging.v2.DeleteSinkRequest, com.google.protobuf.Empty> + getDeleteSinkMethod() { + io.grpc.MethodDescriptor + getDeleteSinkMethod; + if ((getDeleteSinkMethod = ConfigServiceV2Grpc.getDeleteSinkMethod) == null) { + synchronized (ConfigServiceV2Grpc.class) { + if ((getDeleteSinkMethod = ConfigServiceV2Grpc.getDeleteSinkMethod) == null) { + ConfigServiceV2Grpc.getDeleteSinkMethod = + getDeleteSinkMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteSink")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.DeleteSinkRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new ConfigServiceV2MethodDescriptorSupplier("DeleteSink")) + .build(); + } + } + } + return getDeleteSinkMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.logging.v2.CreateLinkRequest, com.google.longrunning.Operation> + getCreateLinkMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateLink", + requestType = com.google.logging.v2.CreateLinkRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.logging.v2.CreateLinkRequest, com.google.longrunning.Operation> + getCreateLinkMethod() { + io.grpc.MethodDescriptor< + com.google.logging.v2.CreateLinkRequest, com.google.longrunning.Operation> + getCreateLinkMethod; + if ((getCreateLinkMethod = ConfigServiceV2Grpc.getCreateLinkMethod) == null) { + synchronized (ConfigServiceV2Grpc.class) { + if ((getCreateLinkMethod = ConfigServiceV2Grpc.getCreateLinkMethod) == null) { + ConfigServiceV2Grpc.getCreateLinkMethod = + getCreateLinkMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateLink")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.CreateLinkRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new ConfigServiceV2MethodDescriptorSupplier("CreateLink")) + .build(); + } + } + } + return getCreateLinkMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.logging.v2.DeleteLinkRequest, com.google.longrunning.Operation> + getDeleteLinkMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteLink", + requestType = com.google.logging.v2.DeleteLinkRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.logging.v2.DeleteLinkRequest, com.google.longrunning.Operation> + getDeleteLinkMethod() { + io.grpc.MethodDescriptor< + com.google.logging.v2.DeleteLinkRequest, com.google.longrunning.Operation> + getDeleteLinkMethod; + if ((getDeleteLinkMethod = ConfigServiceV2Grpc.getDeleteLinkMethod) == null) { + synchronized (ConfigServiceV2Grpc.class) { + if ((getDeleteLinkMethod = ConfigServiceV2Grpc.getDeleteLinkMethod) == null) { + ConfigServiceV2Grpc.getDeleteLinkMethod = + getDeleteLinkMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteLink")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.DeleteLinkRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new ConfigServiceV2MethodDescriptorSupplier("DeleteLink")) + .build(); + } + } + } + return getDeleteLinkMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.logging.v2.ListLinksRequest, com.google.logging.v2.ListLinksResponse> + getListLinksMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListLinks", + requestType = com.google.logging.v2.ListLinksRequest.class, + responseType = com.google.logging.v2.ListLinksResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.logging.v2.ListLinksRequest, com.google.logging.v2.ListLinksResponse> + getListLinksMethod() { + io.grpc.MethodDescriptor< + com.google.logging.v2.ListLinksRequest, com.google.logging.v2.ListLinksResponse> + getListLinksMethod; + if ((getListLinksMethod = ConfigServiceV2Grpc.getListLinksMethod) == null) { + synchronized (ConfigServiceV2Grpc.class) { + if ((getListLinksMethod = ConfigServiceV2Grpc.getListLinksMethod) == null) { + ConfigServiceV2Grpc.getListLinksMethod = + getListLinksMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListLinks")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.ListLinksRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.ListLinksResponse.getDefaultInstance())) + .setSchemaDescriptor(new ConfigServiceV2MethodDescriptorSupplier("ListLinks")) + .build(); + } + } + } + return getListLinksMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.logging.v2.GetLinkRequest, com.google.logging.v2.Link> + getGetLinkMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetLink", + requestType = com.google.logging.v2.GetLinkRequest.class, + responseType = com.google.logging.v2.Link.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.logging.v2.GetLinkRequest, com.google.logging.v2.Link> + getGetLinkMethod() { + io.grpc.MethodDescriptor + getGetLinkMethod; + if ((getGetLinkMethod = ConfigServiceV2Grpc.getGetLinkMethod) == null) { + synchronized (ConfigServiceV2Grpc.class) { + if ((getGetLinkMethod = ConfigServiceV2Grpc.getGetLinkMethod) == null) { + ConfigServiceV2Grpc.getGetLinkMethod = + getGetLinkMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetLink")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.GetLinkRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.Link.getDefaultInstance())) + .setSchemaDescriptor(new ConfigServiceV2MethodDescriptorSupplier("GetLink")) + .build(); + } + } + } + return getGetLinkMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.logging.v2.ListExclusionsRequest, com.google.logging.v2.ListExclusionsResponse> + getListExclusionsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListExclusions", + requestType = com.google.logging.v2.ListExclusionsRequest.class, + responseType = com.google.logging.v2.ListExclusionsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.logging.v2.ListExclusionsRequest, com.google.logging.v2.ListExclusionsResponse> + getListExclusionsMethod() { + io.grpc.MethodDescriptor< + com.google.logging.v2.ListExclusionsRequest, + com.google.logging.v2.ListExclusionsResponse> + getListExclusionsMethod; + if ((getListExclusionsMethod = ConfigServiceV2Grpc.getListExclusionsMethod) == null) { + synchronized (ConfigServiceV2Grpc.class) { + if ((getListExclusionsMethod = ConfigServiceV2Grpc.getListExclusionsMethod) == null) { + ConfigServiceV2Grpc.getListExclusionsMethod = + getListExclusionsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListExclusions")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.ListExclusionsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.ListExclusionsResponse.getDefaultInstance())) + .setSchemaDescriptor( + new ConfigServiceV2MethodDescriptorSupplier("ListExclusions")) + .build(); + } + } + } + return getListExclusionsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.logging.v2.GetExclusionRequest, com.google.logging.v2.LogExclusion> + getGetExclusionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetExclusion", + requestType = com.google.logging.v2.GetExclusionRequest.class, + responseType = com.google.logging.v2.LogExclusion.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.logging.v2.GetExclusionRequest, com.google.logging.v2.LogExclusion> + getGetExclusionMethod() { + io.grpc.MethodDescriptor< + com.google.logging.v2.GetExclusionRequest, com.google.logging.v2.LogExclusion> + getGetExclusionMethod; + if ((getGetExclusionMethod = ConfigServiceV2Grpc.getGetExclusionMethod) == null) { + synchronized (ConfigServiceV2Grpc.class) { + if ((getGetExclusionMethod = ConfigServiceV2Grpc.getGetExclusionMethod) == null) { + ConfigServiceV2Grpc.getGetExclusionMethod = + getGetExclusionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetExclusion")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.GetExclusionRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.LogExclusion.getDefaultInstance())) + .setSchemaDescriptor( + new ConfigServiceV2MethodDescriptorSupplier("GetExclusion")) + .build(); + } + } + } + return getGetExclusionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.logging.v2.CreateExclusionRequest, com.google.logging.v2.LogExclusion> + getCreateExclusionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateExclusion", + requestType = com.google.logging.v2.CreateExclusionRequest.class, + responseType = com.google.logging.v2.LogExclusion.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.logging.v2.CreateExclusionRequest, com.google.logging.v2.LogExclusion> + getCreateExclusionMethod() { + io.grpc.MethodDescriptor< + com.google.logging.v2.CreateExclusionRequest, com.google.logging.v2.LogExclusion> + getCreateExclusionMethod; + if ((getCreateExclusionMethod = ConfigServiceV2Grpc.getCreateExclusionMethod) == null) { + synchronized (ConfigServiceV2Grpc.class) { + if ((getCreateExclusionMethod = ConfigServiceV2Grpc.getCreateExclusionMethod) == null) { + ConfigServiceV2Grpc.getCreateExclusionMethod = + getCreateExclusionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateExclusion")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.CreateExclusionRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.LogExclusion.getDefaultInstance())) + .setSchemaDescriptor( + new ConfigServiceV2MethodDescriptorSupplier("CreateExclusion")) + .build(); + } + } + } + return getCreateExclusionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.logging.v2.UpdateExclusionRequest, com.google.logging.v2.LogExclusion> + getUpdateExclusionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateExclusion", + requestType = com.google.logging.v2.UpdateExclusionRequest.class, + responseType = com.google.logging.v2.LogExclusion.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.logging.v2.UpdateExclusionRequest, com.google.logging.v2.LogExclusion> + getUpdateExclusionMethod() { + io.grpc.MethodDescriptor< + com.google.logging.v2.UpdateExclusionRequest, com.google.logging.v2.LogExclusion> + getUpdateExclusionMethod; + if ((getUpdateExclusionMethod = ConfigServiceV2Grpc.getUpdateExclusionMethod) == null) { + synchronized (ConfigServiceV2Grpc.class) { + if ((getUpdateExclusionMethod = ConfigServiceV2Grpc.getUpdateExclusionMethod) == null) { + ConfigServiceV2Grpc.getUpdateExclusionMethod = + getUpdateExclusionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateExclusion")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.UpdateExclusionRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.LogExclusion.getDefaultInstance())) + .setSchemaDescriptor( + new ConfigServiceV2MethodDescriptorSupplier("UpdateExclusion")) + .build(); + } + } + } + return getUpdateExclusionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.logging.v2.DeleteExclusionRequest, com.google.protobuf.Empty> + getDeleteExclusionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteExclusion", + requestType = com.google.logging.v2.DeleteExclusionRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.logging.v2.DeleteExclusionRequest, com.google.protobuf.Empty> + getDeleteExclusionMethod() { + io.grpc.MethodDescriptor< + com.google.logging.v2.DeleteExclusionRequest, com.google.protobuf.Empty> + getDeleteExclusionMethod; + if ((getDeleteExclusionMethod = ConfigServiceV2Grpc.getDeleteExclusionMethod) == null) { + synchronized (ConfigServiceV2Grpc.class) { + if ((getDeleteExclusionMethod = ConfigServiceV2Grpc.getDeleteExclusionMethod) == null) { + ConfigServiceV2Grpc.getDeleteExclusionMethod = + getDeleteExclusionMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteExclusion")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.DeleteExclusionRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new ConfigServiceV2MethodDescriptorSupplier("DeleteExclusion")) + .build(); + } + } + } + return getDeleteExclusionMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.logging.v2.GetCmekSettingsRequest, com.google.logging.v2.CmekSettings> + getGetCmekSettingsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetCmekSettings", + requestType = com.google.logging.v2.GetCmekSettingsRequest.class, + responseType = com.google.logging.v2.CmekSettings.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.logging.v2.GetCmekSettingsRequest, com.google.logging.v2.CmekSettings> + getGetCmekSettingsMethod() { + io.grpc.MethodDescriptor< + com.google.logging.v2.GetCmekSettingsRequest, com.google.logging.v2.CmekSettings> + getGetCmekSettingsMethod; + if ((getGetCmekSettingsMethod = ConfigServiceV2Grpc.getGetCmekSettingsMethod) == null) { + synchronized (ConfigServiceV2Grpc.class) { + if ((getGetCmekSettingsMethod = ConfigServiceV2Grpc.getGetCmekSettingsMethod) == null) { + ConfigServiceV2Grpc.getGetCmekSettingsMethod = + getGetCmekSettingsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetCmekSettings")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.GetCmekSettingsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.CmekSettings.getDefaultInstance())) + .setSchemaDescriptor( + new ConfigServiceV2MethodDescriptorSupplier("GetCmekSettings")) + .build(); + } + } + } + return getGetCmekSettingsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.logging.v2.UpdateCmekSettingsRequest, com.google.logging.v2.CmekSettings> + getUpdateCmekSettingsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateCmekSettings", + requestType = com.google.logging.v2.UpdateCmekSettingsRequest.class, + responseType = com.google.logging.v2.CmekSettings.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.logging.v2.UpdateCmekSettingsRequest, com.google.logging.v2.CmekSettings> + getUpdateCmekSettingsMethod() { + io.grpc.MethodDescriptor< + com.google.logging.v2.UpdateCmekSettingsRequest, com.google.logging.v2.CmekSettings> + getUpdateCmekSettingsMethod; + if ((getUpdateCmekSettingsMethod = ConfigServiceV2Grpc.getUpdateCmekSettingsMethod) == null) { + synchronized (ConfigServiceV2Grpc.class) { + if ((getUpdateCmekSettingsMethod = ConfigServiceV2Grpc.getUpdateCmekSettingsMethod) + == null) { + ConfigServiceV2Grpc.getUpdateCmekSettingsMethod = + getUpdateCmekSettingsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateCmekSettings")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.UpdateCmekSettingsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.CmekSettings.getDefaultInstance())) + .setSchemaDescriptor( + new ConfigServiceV2MethodDescriptorSupplier("UpdateCmekSettings")) + .build(); + } + } + } + return getUpdateCmekSettingsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.logging.v2.GetSettingsRequest, com.google.logging.v2.Settings> + getGetSettingsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetSettings", + requestType = com.google.logging.v2.GetSettingsRequest.class, + responseType = com.google.logging.v2.Settings.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.logging.v2.GetSettingsRequest, com.google.logging.v2.Settings> + getGetSettingsMethod() { + io.grpc.MethodDescriptor< + com.google.logging.v2.GetSettingsRequest, com.google.logging.v2.Settings> + getGetSettingsMethod; + if ((getGetSettingsMethod = ConfigServiceV2Grpc.getGetSettingsMethod) == null) { + synchronized (ConfigServiceV2Grpc.class) { + if ((getGetSettingsMethod = ConfigServiceV2Grpc.getGetSettingsMethod) == null) { + ConfigServiceV2Grpc.getGetSettingsMethod = + getGetSettingsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetSettings")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.GetSettingsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.Settings.getDefaultInstance())) + .setSchemaDescriptor( + new ConfigServiceV2MethodDescriptorSupplier("GetSettings")) + .build(); + } + } + } + return getGetSettingsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.logging.v2.UpdateSettingsRequest, com.google.logging.v2.Settings> + getUpdateSettingsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateSettings", + requestType = com.google.logging.v2.UpdateSettingsRequest.class, + responseType = com.google.logging.v2.Settings.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.logging.v2.UpdateSettingsRequest, com.google.logging.v2.Settings> + getUpdateSettingsMethod() { + io.grpc.MethodDescriptor< + com.google.logging.v2.UpdateSettingsRequest, com.google.logging.v2.Settings> + getUpdateSettingsMethod; + if ((getUpdateSettingsMethod = ConfigServiceV2Grpc.getUpdateSettingsMethod) == null) { + synchronized (ConfigServiceV2Grpc.class) { + if ((getUpdateSettingsMethod = ConfigServiceV2Grpc.getUpdateSettingsMethod) == null) { + ConfigServiceV2Grpc.getUpdateSettingsMethod = + getUpdateSettingsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateSettings")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.UpdateSettingsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.Settings.getDefaultInstance())) + .setSchemaDescriptor( + new ConfigServiceV2MethodDescriptorSupplier("UpdateSettings")) + .build(); + } + } + } + return getUpdateSettingsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.logging.v2.CopyLogEntriesRequest, com.google.longrunning.Operation> + getCopyLogEntriesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CopyLogEntries", + requestType = com.google.logging.v2.CopyLogEntriesRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.logging.v2.CopyLogEntriesRequest, com.google.longrunning.Operation> + getCopyLogEntriesMethod() { + io.grpc.MethodDescriptor< + com.google.logging.v2.CopyLogEntriesRequest, com.google.longrunning.Operation> + getCopyLogEntriesMethod; + if ((getCopyLogEntriesMethod = ConfigServiceV2Grpc.getCopyLogEntriesMethod) == null) { + synchronized (ConfigServiceV2Grpc.class) { + if ((getCopyLogEntriesMethod = ConfigServiceV2Grpc.getCopyLogEntriesMethod) == null) { + ConfigServiceV2Grpc.getCopyLogEntriesMethod = + getCopyLogEntriesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CopyLogEntries")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.CopyLogEntriesRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new ConfigServiceV2MethodDescriptorSupplier("CopyLogEntries")) + .build(); + } + } + } + return getCopyLogEntriesMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static ConfigServiceV2Stub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ConfigServiceV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ConfigServiceV2Stub(channel, callOptions); + } + }; + return ConfigServiceV2Stub.newStub(factory, channel); + } + + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static ConfigServiceV2BlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ConfigServiceV2BlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ConfigServiceV2BlockingV2Stub(channel, callOptions); + } + }; + return ConfigServiceV2BlockingV2Stub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static ConfigServiceV2BlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ConfigServiceV2BlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ConfigServiceV2BlockingStub(channel, callOptions); + } + }; + return ConfigServiceV2BlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static ConfigServiceV2FutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ConfigServiceV2FutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ConfigServiceV2FutureStub(channel, callOptions); + } + }; + return ConfigServiceV2FutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service for configuring sinks used to route log entries.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Lists log buckets.
+     * 
+ */ + default void listBuckets( + com.google.logging.v2.ListBucketsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListBucketsMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets a log bucket.
+     * 
+ */ + default void getBucket( + com.google.logging.v2.GetBucketRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetBucketMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a log bucket asynchronously that can be used to store log entries.
+     * After a bucket has been created, the bucket's location cannot be changed.
+     * 
+ */ + default void createBucketAsync( + com.google.logging.v2.CreateBucketRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateBucketAsyncMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates a log bucket asynchronously.
+     * If the bucket has a `lifecycle_state` of `DELETE_REQUESTED`, then
+     * `FAILED_PRECONDITION` will be returned.
+     * After a bucket has been created, the bucket's location cannot be changed.
+     * 
+ */ + default void updateBucketAsync( + com.google.logging.v2.UpdateBucketRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateBucketAsyncMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a log bucket that can be used to store log entries. After a bucket
+     * has been created, the bucket's location cannot be changed.
+     * 
+ */ + default void createBucket( + com.google.logging.v2.CreateBucketRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateBucketMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates a log bucket.
+     * If the bucket has a `lifecycle_state` of `DELETE_REQUESTED`, then
+     * `FAILED_PRECONDITION` will be returned.
+     * After a bucket has been created, the bucket's location cannot be changed.
+     * 
+ */ + default void updateBucket( + com.google.logging.v2.UpdateBucketRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateBucketMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a log bucket.
+     * Changes the bucket's `lifecycle_state` to the `DELETE_REQUESTED` state.
+     * After 7 days, the bucket will be purged and all log entries in the bucket
+     * will be permanently deleted.
+     * 
+ */ + default void deleteBucket( + com.google.logging.v2.DeleteBucketRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteBucketMethod(), responseObserver); + } + + /** + * + * + *
+     * Undeletes a log bucket. A bucket that has been deleted can be undeleted
+     * within the grace period of 7 days.
+     * 
+ */ + default void undeleteBucket( + com.google.logging.v2.UndeleteBucketRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUndeleteBucketMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists views on a log bucket.
+     * 
+ */ + default void listViews( + com.google.logging.v2.ListViewsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListViewsMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets a view on a log bucket..
+     * 
+ */ + default void getView( + com.google.logging.v2.GetViewRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetViewMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a view over log entries in a log bucket. A bucket may contain a
+     * maximum of 30 views.
+     * 
+ */ + default void createView( + com.google.logging.v2.CreateViewRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreateViewMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates a view on a log bucket. This method replaces the following fields
+     * in the existing view with values from the new view: `filter`.
+     * If an `UNAVAILABLE` error is returned, this indicates that system is not in
+     * a state where it can update the view. If this occurs, please try again in a
+     * few minutes.
+     * 
+ */ + default void updateView( + com.google.logging.v2.UpdateViewRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUpdateViewMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a view on a log bucket.
+     * If an `UNAVAILABLE` error is returned, this indicates that system is not in
+     * a state where it can delete the view. If this occurs, please try again in a
+     * few minutes.
+     * 
+ */ + default void deleteView( + com.google.logging.v2.DeleteViewRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteViewMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists sinks.
+     * 
+ */ + default void listSinks( + com.google.logging.v2.ListSinksRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListSinksMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets a sink.
+     * 
+ */ + default void getSink( + com.google.logging.v2.GetSinkRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetSinkMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a sink that exports specified log entries to a destination. The
+     * export of newly-ingested log entries begins immediately, unless the sink's
+     * `writer_identity` is not permitted to write to the destination. A sink can
+     * export log entries only from the resource owning the sink.
+     * 
+ */ + default void createSink( + com.google.logging.v2.CreateSinkRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreateSinkMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates a sink. This method replaces the following fields in the existing
+     * sink with values from the new sink: `destination`, and `filter`.
+     * The updated sink might also have a new `writer_identity`; see the
+     * `unique_writer_identity` field.
+     * 
+ */ + default void updateSink( + com.google.logging.v2.UpdateSinkRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUpdateSinkMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a sink. If the sink has a unique `writer_identity`, then that
+     * service account is also deleted.
+     * 
+ */ + default void deleteSink( + com.google.logging.v2.DeleteSinkRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteSinkMethod(), responseObserver); + } + + /** + * + * + *
+     * Asynchronously creates a linked dataset in BigQuery which makes it possible
+     * to use BigQuery to read the logs stored in the log bucket. A log bucket may
+     * currently only contain one link.
+     * 
+ */ + default void createLink( + com.google.logging.v2.CreateLinkRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreateLinkMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a link. This will also delete the corresponding BigQuery linked
+     * dataset.
+     * 
+ */ + default void deleteLink( + com.google.logging.v2.DeleteLinkRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteLinkMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists links.
+     * 
+ */ + default void listLinks( + com.google.logging.v2.ListLinksRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListLinksMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets a link.
+     * 
+ */ + default void getLink( + com.google.logging.v2.GetLinkRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetLinkMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists all the exclusions on the _Default sink in a parent resource.
+     * 
+ */ + default void listExclusions( + com.google.logging.v2.ListExclusionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListExclusionsMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets the description of an exclusion in the _Default sink.
+     * 
+ */ + default void getExclusion( + com.google.logging.v2.GetExclusionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetExclusionMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a new exclusion in the _Default sink in a specified parent
+     * resource. Only log entries belonging to that resource can be excluded. You
+     * can have up to 10 exclusions in a resource.
+     * 
+ */ + default void createExclusion( + com.google.logging.v2.CreateExclusionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateExclusionMethod(), responseObserver); + } + + /** + * + * + *
+     * Changes one or more properties of an existing exclusion in the _Default
+     * sink.
+     * 
+ */ + default void updateExclusion( + com.google.logging.v2.UpdateExclusionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateExclusionMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes an exclusion in the _Default sink.
+     * 
+ */ + default void deleteExclusion( + com.google.logging.v2.DeleteExclusionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteExclusionMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets the Logging CMEK settings for the given resource.
+     * Note: CMEK for the Log Router can be configured for Google Cloud projects,
+     * folders, organizations and billing accounts. Once configured for an
+     * organization, it applies to all projects and folders in the Google Cloud
+     * organization.
+     * See [Enabling CMEK for Log
+     * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+     * for more information.
+     * 
+ */ + default void getCmekSettings( + com.google.logging.v2.GetCmekSettingsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetCmekSettingsMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates the Log Router CMEK settings for the given resource.
+     * Note: CMEK for the Log Router can currently only be configured for Google
+     * Cloud organizations. Once configured, it applies to all projects and
+     * folders in the Google Cloud organization.
+     * [UpdateCmekSettings][google.logging.v2.ConfigServiceV2.UpdateCmekSettings]
+     * will fail if 1) `kms_key_name` is invalid, or 2) the associated service
+     * account does not have the required
+     * `roles/cloudkms.cryptoKeyEncrypterDecrypter` role assigned for the key, or
+     * 3) access to the key is disabled.
+     * See [Enabling CMEK for Log
+     * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+     * for more information.
+     * 
+ */ + default void updateCmekSettings( + com.google.logging.v2.UpdateCmekSettingsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateCmekSettingsMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets the Log Router settings for the given resource.
+     * Note: Settings for the Log Router can be get for Google Cloud projects,
+     * folders, organizations and billing accounts. Currently it can only be
+     * configured for organizations. Once configured for an organization, it
+     * applies to all projects and folders in the Google Cloud organization.
+     * See [Enabling CMEK for Log
+     * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+     * for more information.
+     * 
+ */ + default void getSettings( + com.google.logging.v2.GetSettingsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetSettingsMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates the Log Router settings for the given resource.
+     * Note: Settings for the Log Router can currently only be configured for
+     * Google Cloud organizations. Once configured, it applies to all projects and
+     * folders in the Google Cloud organization.
+     * [UpdateSettings][google.logging.v2.ConfigServiceV2.UpdateSettings]
+     * will fail if 1) `kms_key_name` is invalid, or 2) the associated service
+     * account does not have the required
+     * `roles/cloudkms.cryptoKeyEncrypterDecrypter` role assigned for the key, or
+     * 3) access to the key is disabled. 4) `location_id` is not supported by
+     * Logging. 5) `location_id` violate OrgPolicy.
+     * See [Enabling CMEK for Log
+     * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+     * for more information.
+     * 
+ */ + default void updateSettings( + com.google.logging.v2.UpdateSettingsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateSettingsMethod(), responseObserver); + } + + /** + * + * + *
+     * Copies a set of log entries from a log bucket to a Cloud Storage bucket.
+     * 
+ */ + default void copyLogEntries( + com.google.logging.v2.CopyLogEntriesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCopyLogEntriesMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service ConfigServiceV2. + * + *
+   * Service for configuring sinks used to route log entries.
+   * 
+ */ + public abstract static class ConfigServiceV2ImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return ConfigServiceV2Grpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service ConfigServiceV2. + * + *
+   * Service for configuring sinks used to route log entries.
+   * 
+ */ + public static final class ConfigServiceV2Stub + extends io.grpc.stub.AbstractAsyncStub { + private ConfigServiceV2Stub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ConfigServiceV2Stub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ConfigServiceV2Stub(channel, callOptions); + } + + /** + * + * + *
+     * Lists log buckets.
+     * 
+ */ + public void listBuckets( + com.google.logging.v2.ListBucketsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListBucketsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets a log bucket.
+     * 
+ */ + public void getBucket( + com.google.logging.v2.GetBucketRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetBucketMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Creates a log bucket asynchronously that can be used to store log entries.
+     * After a bucket has been created, the bucket's location cannot be changed.
+     * 
+ */ + public void createBucketAsync( + com.google.logging.v2.CreateBucketRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateBucketAsyncMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates a log bucket asynchronously.
+     * If the bucket has a `lifecycle_state` of `DELETE_REQUESTED`, then
+     * `FAILED_PRECONDITION` will be returned.
+     * After a bucket has been created, the bucket's location cannot be changed.
+     * 
+ */ + public void updateBucketAsync( + com.google.logging.v2.UpdateBucketRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateBucketAsyncMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a log bucket that can be used to store log entries. After a bucket
+     * has been created, the bucket's location cannot be changed.
+     * 
+ */ + public void createBucket( + com.google.logging.v2.CreateBucketRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateBucketMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates a log bucket.
+     * If the bucket has a `lifecycle_state` of `DELETE_REQUESTED`, then
+     * `FAILED_PRECONDITION` will be returned.
+     * After a bucket has been created, the bucket's location cannot be changed.
+     * 
+ */ + public void updateBucket( + com.google.logging.v2.UpdateBucketRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateBucketMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a log bucket.
+     * Changes the bucket's `lifecycle_state` to the `DELETE_REQUESTED` state.
+     * After 7 days, the bucket will be purged and all log entries in the bucket
+     * will be permanently deleted.
+     * 
+ */ + public void deleteBucket( + com.google.logging.v2.DeleteBucketRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteBucketMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Undeletes a log bucket. A bucket that has been deleted can be undeleted
+     * within the grace period of 7 days.
+     * 
+ */ + public void undeleteBucket( + com.google.logging.v2.UndeleteBucketRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUndeleteBucketMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists views on a log bucket.
+     * 
+ */ + public void listViews( + com.google.logging.v2.ListViewsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListViewsMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Gets a view on a log bucket..
+     * 
+ */ + public void getView( + com.google.logging.v2.GetViewRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetViewMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Creates a view over log entries in a log bucket. A bucket may contain a
+     * maximum of 30 views.
+     * 
+ */ + public void createView( + com.google.logging.v2.CreateViewRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateViewMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Updates a view on a log bucket. This method replaces the following fields
+     * in the existing view with values from the new view: `filter`.
+     * If an `UNAVAILABLE` error is returned, this indicates that system is not in
+     * a state where it can update the view. If this occurs, please try again in a
+     * few minutes.
+     * 
+ */ + public void updateView( + com.google.logging.v2.UpdateViewRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateViewMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Deletes a view on a log bucket.
+     * If an `UNAVAILABLE` error is returned, this indicates that system is not in
+     * a state where it can delete the view. If this occurs, please try again in a
+     * few minutes.
+     * 
+ */ + public void deleteView( + com.google.logging.v2.DeleteViewRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteViewMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Lists sinks.
+     * 
+ */ + public void listSinks( + com.google.logging.v2.ListSinksRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListSinksMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Gets a sink.
+     * 
+ */ + public void getSink( + com.google.logging.v2.GetSinkRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetSinkMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Creates a sink that exports specified log entries to a destination. The
+     * export of newly-ingested log entries begins immediately, unless the sink's
+     * `writer_identity` is not permitted to write to the destination. A sink can
+     * export log entries only from the resource owning the sink.
+     * 
+ */ + public void createSink( + com.google.logging.v2.CreateSinkRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateSinkMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Updates a sink. This method replaces the following fields in the existing
+     * sink with values from the new sink: `destination`, and `filter`.
+     * The updated sink might also have a new `writer_identity`; see the
+     * `unique_writer_identity` field.
+     * 
+ */ + public void updateSink( + com.google.logging.v2.UpdateSinkRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateSinkMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Deletes a sink. If the sink has a unique `writer_identity`, then that
+     * service account is also deleted.
+     * 
+ */ + public void deleteSink( + com.google.logging.v2.DeleteSinkRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteSinkMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Asynchronously creates a linked dataset in BigQuery which makes it possible
+     * to use BigQuery to read the logs stored in the log bucket. A log bucket may
+     * currently only contain one link.
+     * 
+ */ + public void createLink( + com.google.logging.v2.CreateLinkRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateLinkMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Deletes a link. This will also delete the corresponding BigQuery linked
+     * dataset.
+     * 
+ */ + public void deleteLink( + com.google.logging.v2.DeleteLinkRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteLinkMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Lists links.
+     * 
+ */ + public void listLinks( + com.google.logging.v2.ListLinksRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListLinksMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Gets a link.
+     * 
+ */ + public void getLink( + com.google.logging.v2.GetLinkRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetLinkMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Lists all the exclusions on the _Default sink in a parent resource.
+     * 
+ */ + public void listExclusions( + com.google.logging.v2.ListExclusionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListExclusionsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets the description of an exclusion in the _Default sink.
+     * 
+ */ + public void getExclusion( + com.google.logging.v2.GetExclusionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetExclusionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a new exclusion in the _Default sink in a specified parent
+     * resource. Only log entries belonging to that resource can be excluded. You
+     * can have up to 10 exclusions in a resource.
+     * 
+ */ + public void createExclusion( + com.google.logging.v2.CreateExclusionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateExclusionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Changes one or more properties of an existing exclusion in the _Default
+     * sink.
+     * 
+ */ + public void updateExclusion( + com.google.logging.v2.UpdateExclusionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateExclusionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes an exclusion in the _Default sink.
+     * 
+ */ + public void deleteExclusion( + com.google.logging.v2.DeleteExclusionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteExclusionMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets the Logging CMEK settings for the given resource.
+     * Note: CMEK for the Log Router can be configured for Google Cloud projects,
+     * folders, organizations and billing accounts. Once configured for an
+     * organization, it applies to all projects and folders in the Google Cloud
+     * organization.
+     * See [Enabling CMEK for Log
+     * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+     * for more information.
+     * 
+ */ + public void getCmekSettings( + com.google.logging.v2.GetCmekSettingsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetCmekSettingsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates the Log Router CMEK settings for the given resource.
+     * Note: CMEK for the Log Router can currently only be configured for Google
+     * Cloud organizations. Once configured, it applies to all projects and
+     * folders in the Google Cloud organization.
+     * [UpdateCmekSettings][google.logging.v2.ConfigServiceV2.UpdateCmekSettings]
+     * will fail if 1) `kms_key_name` is invalid, or 2) the associated service
+     * account does not have the required
+     * `roles/cloudkms.cryptoKeyEncrypterDecrypter` role assigned for the key, or
+     * 3) access to the key is disabled.
+     * See [Enabling CMEK for Log
+     * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+     * for more information.
+     * 
+ */ + public void updateCmekSettings( + com.google.logging.v2.UpdateCmekSettingsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateCmekSettingsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets the Log Router settings for the given resource.
+     * Note: Settings for the Log Router can be get for Google Cloud projects,
+     * folders, organizations and billing accounts. Currently it can only be
+     * configured for organizations. Once configured for an organization, it
+     * applies to all projects and folders in the Google Cloud organization.
+     * See [Enabling CMEK for Log
+     * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+     * for more information.
+     * 
+ */ + public void getSettings( + com.google.logging.v2.GetSettingsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetSettingsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates the Log Router settings for the given resource.
+     * Note: Settings for the Log Router can currently only be configured for
+     * Google Cloud organizations. Once configured, it applies to all projects and
+     * folders in the Google Cloud organization.
+     * [UpdateSettings][google.logging.v2.ConfigServiceV2.UpdateSettings]
+     * will fail if 1) `kms_key_name` is invalid, or 2) the associated service
+     * account does not have the required
+     * `roles/cloudkms.cryptoKeyEncrypterDecrypter` role assigned for the key, or
+     * 3) access to the key is disabled. 4) `location_id` is not supported by
+     * Logging. 5) `location_id` violate OrgPolicy.
+     * See [Enabling CMEK for Log
+     * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+     * for more information.
+     * 
+ */ + public void updateSettings( + com.google.logging.v2.UpdateSettingsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateSettingsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Copies a set of log entries from a log bucket to a Cloud Storage bucket.
+     * 
+ */ + public void copyLogEntries( + com.google.logging.v2.CopyLogEntriesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCopyLogEntriesMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service ConfigServiceV2. + * + *
+   * Service for configuring sinks used to route log entries.
+   * 
+ */ + public static final class ConfigServiceV2BlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private ConfigServiceV2BlockingV2Stub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ConfigServiceV2BlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ConfigServiceV2BlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
+     * Lists log buckets.
+     * 
+ */ + public com.google.logging.v2.ListBucketsResponse listBuckets( + com.google.logging.v2.ListBucketsRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListBucketsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a log bucket.
+     * 
+ */ + public com.google.logging.v2.LogBucket getBucket(com.google.logging.v2.GetBucketRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetBucketMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a log bucket asynchronously that can be used to store log entries.
+     * After a bucket has been created, the bucket's location cannot be changed.
+     * 
+ */ + public com.google.longrunning.Operation createBucketAsync( + com.google.logging.v2.CreateBucketRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getCreateBucketAsyncMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates a log bucket asynchronously.
+     * If the bucket has a `lifecycle_state` of `DELETE_REQUESTED`, then
+     * `FAILED_PRECONDITION` will be returned.
+     * After a bucket has been created, the bucket's location cannot be changed.
+     * 
+ */ + public com.google.longrunning.Operation updateBucketAsync( + com.google.logging.v2.UpdateBucketRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getUpdateBucketAsyncMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a log bucket that can be used to store log entries. After a bucket
+     * has been created, the bucket's location cannot be changed.
+     * 
+ */ + public com.google.logging.v2.LogBucket createBucket( + com.google.logging.v2.CreateBucketRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getCreateBucketMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates a log bucket.
+     * If the bucket has a `lifecycle_state` of `DELETE_REQUESTED`, then
+     * `FAILED_PRECONDITION` will be returned.
+     * After a bucket has been created, the bucket's location cannot be changed.
+     * 
+ */ + public com.google.logging.v2.LogBucket updateBucket( + com.google.logging.v2.UpdateBucketRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getUpdateBucketMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a log bucket.
+     * Changes the bucket's `lifecycle_state` to the `DELETE_REQUESTED` state.
+     * After 7 days, the bucket will be purged and all log entries in the bucket
+     * will be permanently deleted.
+     * 
+ */ + public com.google.protobuf.Empty deleteBucket(com.google.logging.v2.DeleteBucketRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getDeleteBucketMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Undeletes a log bucket. A bucket that has been deleted can be undeleted
+     * within the grace period of 7 days.
+     * 
+ */ + public com.google.protobuf.Empty undeleteBucket( + com.google.logging.v2.UndeleteBucketRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getUndeleteBucketMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists views on a log bucket.
+     * 
+ */ + public com.google.logging.v2.ListViewsResponse listViews( + com.google.logging.v2.ListViewsRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListViewsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a view on a log bucket..
+     * 
+ */ + public com.google.logging.v2.LogView getView(com.google.logging.v2.GetViewRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetViewMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a view over log entries in a log bucket. A bucket may contain a
+     * maximum of 30 views.
+     * 
+ */ + public com.google.logging.v2.LogView createView(com.google.logging.v2.CreateViewRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getCreateViewMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates a view on a log bucket. This method replaces the following fields
+     * in the existing view with values from the new view: `filter`.
+     * If an `UNAVAILABLE` error is returned, this indicates that system is not in
+     * a state where it can update the view. If this occurs, please try again in a
+     * few minutes.
+     * 
+ */ + public com.google.logging.v2.LogView updateView(com.google.logging.v2.UpdateViewRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getUpdateViewMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a view on a log bucket.
+     * If an `UNAVAILABLE` error is returned, this indicates that system is not in
+     * a state where it can delete the view. If this occurs, please try again in a
+     * few minutes.
+     * 
+ */ + public com.google.protobuf.Empty deleteView(com.google.logging.v2.DeleteViewRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getDeleteViewMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists sinks.
+     * 
+ */ + public com.google.logging.v2.ListSinksResponse listSinks( + com.google.logging.v2.ListSinksRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListSinksMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a sink.
+     * 
+ */ + public com.google.logging.v2.LogSink getSink(com.google.logging.v2.GetSinkRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetSinkMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a sink that exports specified log entries to a destination. The
+     * export of newly-ingested log entries begins immediately, unless the sink's
+     * `writer_identity` is not permitted to write to the destination. A sink can
+     * export log entries only from the resource owning the sink.
+     * 
+ */ + public com.google.logging.v2.LogSink createSink(com.google.logging.v2.CreateSinkRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getCreateSinkMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates a sink. This method replaces the following fields in the existing
+     * sink with values from the new sink: `destination`, and `filter`.
+     * The updated sink might also have a new `writer_identity`; see the
+     * `unique_writer_identity` field.
+     * 
+ */ + public com.google.logging.v2.LogSink updateSink(com.google.logging.v2.UpdateSinkRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getUpdateSinkMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a sink. If the sink has a unique `writer_identity`, then that
+     * service account is also deleted.
+     * 
+ */ + public com.google.protobuf.Empty deleteSink(com.google.logging.v2.DeleteSinkRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getDeleteSinkMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Asynchronously creates a linked dataset in BigQuery which makes it possible
+     * to use BigQuery to read the logs stored in the log bucket. A log bucket may
+     * currently only contain one link.
+     * 
+ */ + public com.google.longrunning.Operation createLink( + com.google.logging.v2.CreateLinkRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getCreateLinkMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a link. This will also delete the corresponding BigQuery linked
+     * dataset.
+     * 
+ */ + public com.google.longrunning.Operation deleteLink( + com.google.logging.v2.DeleteLinkRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getDeleteLinkMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists links.
+     * 
+ */ + public com.google.logging.v2.ListLinksResponse listLinks( + com.google.logging.v2.ListLinksRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListLinksMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a link.
+     * 
+ */ + public com.google.logging.v2.Link getLink(com.google.logging.v2.GetLinkRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetLinkMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all the exclusions on the _Default sink in a parent resource.
+     * 
+ */ + public com.google.logging.v2.ListExclusionsResponse listExclusions( + com.google.logging.v2.ListExclusionsRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListExclusionsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets the description of an exclusion in the _Default sink.
+     * 
+ */ + public com.google.logging.v2.LogExclusion getExclusion( + com.google.logging.v2.GetExclusionRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetExclusionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new exclusion in the _Default sink in a specified parent
+     * resource. Only log entries belonging to that resource can be excluded. You
+     * can have up to 10 exclusions in a resource.
+     * 
+ */ + public com.google.logging.v2.LogExclusion createExclusion( + com.google.logging.v2.CreateExclusionRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getCreateExclusionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Changes one or more properties of an existing exclusion in the _Default
+     * sink.
+     * 
+ */ + public com.google.logging.v2.LogExclusion updateExclusion( + com.google.logging.v2.UpdateExclusionRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getUpdateExclusionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes an exclusion in the _Default sink.
+     * 
+ */ + public com.google.protobuf.Empty deleteExclusion( + com.google.logging.v2.DeleteExclusionRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getDeleteExclusionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets the Logging CMEK settings for the given resource.
+     * Note: CMEK for the Log Router can be configured for Google Cloud projects,
+     * folders, organizations and billing accounts. Once configured for an
+     * organization, it applies to all projects and folders in the Google Cloud
+     * organization.
+     * See [Enabling CMEK for Log
+     * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+     * for more information.
+     * 
+ */ + public com.google.logging.v2.CmekSettings getCmekSettings( + com.google.logging.v2.GetCmekSettingsRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetCmekSettingsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the Log Router CMEK settings for the given resource.
+     * Note: CMEK for the Log Router can currently only be configured for Google
+     * Cloud organizations. Once configured, it applies to all projects and
+     * folders in the Google Cloud organization.
+     * [UpdateCmekSettings][google.logging.v2.ConfigServiceV2.UpdateCmekSettings]
+     * will fail if 1) `kms_key_name` is invalid, or 2) the associated service
+     * account does not have the required
+     * `roles/cloudkms.cryptoKeyEncrypterDecrypter` role assigned for the key, or
+     * 3) access to the key is disabled.
+     * See [Enabling CMEK for Log
+     * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+     * for more information.
+     * 
+ */ + public com.google.logging.v2.CmekSettings updateCmekSettings( + com.google.logging.v2.UpdateCmekSettingsRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getUpdateCmekSettingsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets the Log Router settings for the given resource.
+     * Note: Settings for the Log Router can be get for Google Cloud projects,
+     * folders, organizations and billing accounts. Currently it can only be
+     * configured for organizations. Once configured for an organization, it
+     * applies to all projects and folders in the Google Cloud organization.
+     * See [Enabling CMEK for Log
+     * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+     * for more information.
+     * 
+ */ + public com.google.logging.v2.Settings getSettings( + com.google.logging.v2.GetSettingsRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetSettingsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the Log Router settings for the given resource.
+     * Note: Settings for the Log Router can currently only be configured for
+     * Google Cloud organizations. Once configured, it applies to all projects and
+     * folders in the Google Cloud organization.
+     * [UpdateSettings][google.logging.v2.ConfigServiceV2.UpdateSettings]
+     * will fail if 1) `kms_key_name` is invalid, or 2) the associated service
+     * account does not have the required
+     * `roles/cloudkms.cryptoKeyEncrypterDecrypter` role assigned for the key, or
+     * 3) access to the key is disabled. 4) `location_id` is not supported by
+     * Logging. 5) `location_id` violate OrgPolicy.
+     * See [Enabling CMEK for Log
+     * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+     * for more information.
+     * 
+ */ + public com.google.logging.v2.Settings updateSettings( + com.google.logging.v2.UpdateSettingsRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getUpdateSettingsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Copies a set of log entries from a log bucket to a Cloud Storage bucket.
+     * 
+ */ + public com.google.longrunning.Operation copyLogEntries( + com.google.logging.v2.CopyLogEntriesRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getCopyLogEntriesMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service ConfigServiceV2. + * + *
+   * Service for configuring sinks used to route log entries.
+   * 
+ */ + public static final class ConfigServiceV2BlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private ConfigServiceV2BlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ConfigServiceV2BlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ConfigServiceV2BlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists log buckets.
+     * 
+ */ + public com.google.logging.v2.ListBucketsResponse listBuckets( + com.google.logging.v2.ListBucketsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListBucketsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a log bucket.
+     * 
+ */ + public com.google.logging.v2.LogBucket getBucket( + com.google.logging.v2.GetBucketRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetBucketMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a log bucket asynchronously that can be used to store log entries.
+     * After a bucket has been created, the bucket's location cannot be changed.
+     * 
+ */ + public com.google.longrunning.Operation createBucketAsync( + com.google.logging.v2.CreateBucketRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateBucketAsyncMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates a log bucket asynchronously.
+     * If the bucket has a `lifecycle_state` of `DELETE_REQUESTED`, then
+     * `FAILED_PRECONDITION` will be returned.
+     * After a bucket has been created, the bucket's location cannot be changed.
+     * 
+ */ + public com.google.longrunning.Operation updateBucketAsync( + com.google.logging.v2.UpdateBucketRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateBucketAsyncMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a log bucket that can be used to store log entries. After a bucket
+     * has been created, the bucket's location cannot be changed.
+     * 
+ */ + public com.google.logging.v2.LogBucket createBucket( + com.google.logging.v2.CreateBucketRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateBucketMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates a log bucket.
+     * If the bucket has a `lifecycle_state` of `DELETE_REQUESTED`, then
+     * `FAILED_PRECONDITION` will be returned.
+     * After a bucket has been created, the bucket's location cannot be changed.
+     * 
+ */ + public com.google.logging.v2.LogBucket updateBucket( + com.google.logging.v2.UpdateBucketRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateBucketMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a log bucket.
+     * Changes the bucket's `lifecycle_state` to the `DELETE_REQUESTED` state.
+     * After 7 days, the bucket will be purged and all log entries in the bucket
+     * will be permanently deleted.
+     * 
+ */ + public com.google.protobuf.Empty deleteBucket( + com.google.logging.v2.DeleteBucketRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteBucketMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Undeletes a log bucket. A bucket that has been deleted can be undeleted
+     * within the grace period of 7 days.
+     * 
+ */ + public com.google.protobuf.Empty undeleteBucket( + com.google.logging.v2.UndeleteBucketRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUndeleteBucketMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists views on a log bucket.
+     * 
+ */ + public com.google.logging.v2.ListViewsResponse listViews( + com.google.logging.v2.ListViewsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListViewsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a view on a log bucket..
+     * 
+ */ + public com.google.logging.v2.LogView getView(com.google.logging.v2.GetViewRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetViewMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a view over log entries in a log bucket. A bucket may contain a
+     * maximum of 30 views.
+     * 
+ */ + public com.google.logging.v2.LogView createView( + com.google.logging.v2.CreateViewRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateViewMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates a view on a log bucket. This method replaces the following fields
+     * in the existing view with values from the new view: `filter`.
+     * If an `UNAVAILABLE` error is returned, this indicates that system is not in
+     * a state where it can update the view. If this occurs, please try again in a
+     * few minutes.
+     * 
+ */ + public com.google.logging.v2.LogView updateView( + com.google.logging.v2.UpdateViewRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateViewMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a view on a log bucket.
+     * If an `UNAVAILABLE` error is returned, this indicates that system is not in
+     * a state where it can delete the view. If this occurs, please try again in a
+     * few minutes.
+     * 
+ */ + public com.google.protobuf.Empty deleteView(com.google.logging.v2.DeleteViewRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteViewMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists sinks.
+     * 
+ */ + public com.google.logging.v2.ListSinksResponse listSinks( + com.google.logging.v2.ListSinksRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListSinksMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a sink.
+     * 
+ */ + public com.google.logging.v2.LogSink getSink(com.google.logging.v2.GetSinkRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetSinkMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a sink that exports specified log entries to a destination. The
+     * export of newly-ingested log entries begins immediately, unless the sink's
+     * `writer_identity` is not permitted to write to the destination. A sink can
+     * export log entries only from the resource owning the sink.
+     * 
+ */ + public com.google.logging.v2.LogSink createSink( + com.google.logging.v2.CreateSinkRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateSinkMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates a sink. This method replaces the following fields in the existing
+     * sink with values from the new sink: `destination`, and `filter`.
+     * The updated sink might also have a new `writer_identity`; see the
+     * `unique_writer_identity` field.
+     * 
+ */ + public com.google.logging.v2.LogSink updateSink( + com.google.logging.v2.UpdateSinkRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateSinkMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a sink. If the sink has a unique `writer_identity`, then that
+     * service account is also deleted.
+     * 
+ */ + public com.google.protobuf.Empty deleteSink(com.google.logging.v2.DeleteSinkRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteSinkMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Asynchronously creates a linked dataset in BigQuery which makes it possible
+     * to use BigQuery to read the logs stored in the log bucket. A log bucket may
+     * currently only contain one link.
+     * 
+ */ + public com.google.longrunning.Operation createLink( + com.google.logging.v2.CreateLinkRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateLinkMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a link. This will also delete the corresponding BigQuery linked
+     * dataset.
+     * 
+ */ + public com.google.longrunning.Operation deleteLink( + com.google.logging.v2.DeleteLinkRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteLinkMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists links.
+     * 
+ */ + public com.google.logging.v2.ListLinksResponse listLinks( + com.google.logging.v2.ListLinksRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListLinksMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a link.
+     * 
+ */ + public com.google.logging.v2.Link getLink(com.google.logging.v2.GetLinkRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetLinkMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all the exclusions on the _Default sink in a parent resource.
+     * 
+ */ + public com.google.logging.v2.ListExclusionsResponse listExclusions( + com.google.logging.v2.ListExclusionsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListExclusionsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets the description of an exclusion in the _Default sink.
+     * 
+ */ + public com.google.logging.v2.LogExclusion getExclusion( + com.google.logging.v2.GetExclusionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetExclusionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a new exclusion in the _Default sink in a specified parent
+     * resource. Only log entries belonging to that resource can be excluded. You
+     * can have up to 10 exclusions in a resource.
+     * 
+ */ + public com.google.logging.v2.LogExclusion createExclusion( + com.google.logging.v2.CreateExclusionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateExclusionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Changes one or more properties of an existing exclusion in the _Default
+     * sink.
+     * 
+ */ + public com.google.logging.v2.LogExclusion updateExclusion( + com.google.logging.v2.UpdateExclusionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateExclusionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes an exclusion in the _Default sink.
+     * 
+ */ + public com.google.protobuf.Empty deleteExclusion( + com.google.logging.v2.DeleteExclusionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteExclusionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets the Logging CMEK settings for the given resource.
+     * Note: CMEK for the Log Router can be configured for Google Cloud projects,
+     * folders, organizations and billing accounts. Once configured for an
+     * organization, it applies to all projects and folders in the Google Cloud
+     * organization.
+     * See [Enabling CMEK for Log
+     * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+     * for more information.
+     * 
+ */ + public com.google.logging.v2.CmekSettings getCmekSettings( + com.google.logging.v2.GetCmekSettingsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetCmekSettingsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the Log Router CMEK settings for the given resource.
+     * Note: CMEK for the Log Router can currently only be configured for Google
+     * Cloud organizations. Once configured, it applies to all projects and
+     * folders in the Google Cloud organization.
+     * [UpdateCmekSettings][google.logging.v2.ConfigServiceV2.UpdateCmekSettings]
+     * will fail if 1) `kms_key_name` is invalid, or 2) the associated service
+     * account does not have the required
+     * `roles/cloudkms.cryptoKeyEncrypterDecrypter` role assigned for the key, or
+     * 3) access to the key is disabled.
+     * See [Enabling CMEK for Log
+     * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+     * for more information.
+     * 
+ */ + public com.google.logging.v2.CmekSettings updateCmekSettings( + com.google.logging.v2.UpdateCmekSettingsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateCmekSettingsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets the Log Router settings for the given resource.
+     * Note: Settings for the Log Router can be get for Google Cloud projects,
+     * folders, organizations and billing accounts. Currently it can only be
+     * configured for organizations. Once configured for an organization, it
+     * applies to all projects and folders in the Google Cloud organization.
+     * See [Enabling CMEK for Log
+     * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+     * for more information.
+     * 
+ */ + public com.google.logging.v2.Settings getSettings( + com.google.logging.v2.GetSettingsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetSettingsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the Log Router settings for the given resource.
+     * Note: Settings for the Log Router can currently only be configured for
+     * Google Cloud organizations. Once configured, it applies to all projects and
+     * folders in the Google Cloud organization.
+     * [UpdateSettings][google.logging.v2.ConfigServiceV2.UpdateSettings]
+     * will fail if 1) `kms_key_name` is invalid, or 2) the associated service
+     * account does not have the required
+     * `roles/cloudkms.cryptoKeyEncrypterDecrypter` role assigned for the key, or
+     * 3) access to the key is disabled. 4) `location_id` is not supported by
+     * Logging. 5) `location_id` violate OrgPolicy.
+     * See [Enabling CMEK for Log
+     * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+     * for more information.
+     * 
+ */ + public com.google.logging.v2.Settings updateSettings( + com.google.logging.v2.UpdateSettingsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateSettingsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Copies a set of log entries from a log bucket to a Cloud Storage bucket.
+     * 
+ */ + public com.google.longrunning.Operation copyLogEntries( + com.google.logging.v2.CopyLogEntriesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCopyLogEntriesMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service ConfigServiceV2. + * + *
+   * Service for configuring sinks used to route log entries.
+   * 
+ */ + public static final class ConfigServiceV2FutureStub + extends io.grpc.stub.AbstractFutureStub { + private ConfigServiceV2FutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ConfigServiceV2FutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ConfigServiceV2FutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists log buckets.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.logging.v2.ListBucketsResponse> + listBuckets(com.google.logging.v2.ListBucketsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListBucketsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets a log bucket.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getBucket(com.google.logging.v2.GetBucketRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetBucketMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a log bucket asynchronously that can be used to store log entries.
+     * After a bucket has been created, the bucket's location cannot be changed.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createBucketAsync(com.google.logging.v2.CreateBucketRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateBucketAsyncMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates a log bucket asynchronously.
+     * If the bucket has a `lifecycle_state` of `DELETE_REQUESTED`, then
+     * `FAILED_PRECONDITION` will be returned.
+     * After a bucket has been created, the bucket's location cannot be changed.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateBucketAsync(com.google.logging.v2.UpdateBucketRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateBucketAsyncMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a log bucket that can be used to store log entries. After a bucket
+     * has been created, the bucket's location cannot be changed.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createBucket(com.google.logging.v2.CreateBucketRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateBucketMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates a log bucket.
+     * If the bucket has a `lifecycle_state` of `DELETE_REQUESTED`, then
+     * `FAILED_PRECONDITION` will be returned.
+     * After a bucket has been created, the bucket's location cannot be changed.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateBucket(com.google.logging.v2.UpdateBucketRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateBucketMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a log bucket.
+     * Changes the bucket's `lifecycle_state` to the `DELETE_REQUESTED` state.
+     * After 7 days, the bucket will be purged and all log entries in the bucket
+     * will be permanently deleted.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteBucket(com.google.logging.v2.DeleteBucketRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteBucketMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Undeletes a log bucket. A bucket that has been deleted can be undeleted
+     * within the grace period of 7 days.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + undeleteBucket(com.google.logging.v2.UndeleteBucketRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUndeleteBucketMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists views on a log bucket.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.logging.v2.ListViewsResponse> + listViews(com.google.logging.v2.ListViewsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListViewsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets a view on a log bucket..
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getView(com.google.logging.v2.GetViewRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetViewMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a view over log entries in a log bucket. A bucket may contain a
+     * maximum of 30 views.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createView(com.google.logging.v2.CreateViewRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateViewMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates a view on a log bucket. This method replaces the following fields
+     * in the existing view with values from the new view: `filter`.
+     * If an `UNAVAILABLE` error is returned, this indicates that system is not in
+     * a state where it can update the view. If this occurs, please try again in a
+     * few minutes.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateView(com.google.logging.v2.UpdateViewRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateViewMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a view on a log bucket.
+     * If an `UNAVAILABLE` error is returned, this indicates that system is not in
+     * a state where it can delete the view. If this occurs, please try again in a
+     * few minutes.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture deleteView( + com.google.logging.v2.DeleteViewRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteViewMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists sinks.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.logging.v2.ListSinksResponse> + listSinks(com.google.logging.v2.ListSinksRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListSinksMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets a sink.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getSink(com.google.logging.v2.GetSinkRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetSinkMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a sink that exports specified log entries to a destination. The
+     * export of newly-ingested log entries begins immediately, unless the sink's
+     * `writer_identity` is not permitted to write to the destination. A sink can
+     * export log entries only from the resource owning the sink.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createSink(com.google.logging.v2.CreateSinkRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateSinkMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates a sink. This method replaces the following fields in the existing
+     * sink with values from the new sink: `destination`, and `filter`.
+     * The updated sink might also have a new `writer_identity`; see the
+     * `unique_writer_identity` field.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateSink(com.google.logging.v2.UpdateSinkRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateSinkMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a sink. If the sink has a unique `writer_identity`, then that
+     * service account is also deleted.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture deleteSink( + com.google.logging.v2.DeleteSinkRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteSinkMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Asynchronously creates a linked dataset in BigQuery which makes it possible
+     * to use BigQuery to read the logs stored in the log bucket. A log bucket may
+     * currently only contain one link.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createLink(com.google.logging.v2.CreateLinkRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateLinkMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a link. This will also delete the corresponding BigQuery linked
+     * dataset.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteLink(com.google.logging.v2.DeleteLinkRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteLinkMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists links.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.logging.v2.ListLinksResponse> + listLinks(com.google.logging.v2.ListLinksRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListLinksMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets a link.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture getLink( + com.google.logging.v2.GetLinkRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetLinkMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists all the exclusions on the _Default sink in a parent resource.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.logging.v2.ListExclusionsResponse> + listExclusions(com.google.logging.v2.ListExclusionsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListExclusionsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets the description of an exclusion in the _Default sink.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getExclusion(com.google.logging.v2.GetExclusionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetExclusionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a new exclusion in the _Default sink in a specified parent
+     * resource. Only log entries belonging to that resource can be excluded. You
+     * can have up to 10 exclusions in a resource.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createExclusion(com.google.logging.v2.CreateExclusionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateExclusionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Changes one or more properties of an existing exclusion in the _Default
+     * sink.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateExclusion(com.google.logging.v2.UpdateExclusionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateExclusionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes an exclusion in the _Default sink.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteExclusion(com.google.logging.v2.DeleteExclusionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteExclusionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets the Logging CMEK settings for the given resource.
+     * Note: CMEK for the Log Router can be configured for Google Cloud projects,
+     * folders, organizations and billing accounts. Once configured for an
+     * organization, it applies to all projects and folders in the Google Cloud
+     * organization.
+     * See [Enabling CMEK for Log
+     * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+     * for more information.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getCmekSettings(com.google.logging.v2.GetCmekSettingsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetCmekSettingsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates the Log Router CMEK settings for the given resource.
+     * Note: CMEK for the Log Router can currently only be configured for Google
+     * Cloud organizations. Once configured, it applies to all projects and
+     * folders in the Google Cloud organization.
+     * [UpdateCmekSettings][google.logging.v2.ConfigServiceV2.UpdateCmekSettings]
+     * will fail if 1) `kms_key_name` is invalid, or 2) the associated service
+     * account does not have the required
+     * `roles/cloudkms.cryptoKeyEncrypterDecrypter` role assigned for the key, or
+     * 3) access to the key is disabled.
+     * See [Enabling CMEK for Log
+     * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+     * for more information.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateCmekSettings(com.google.logging.v2.UpdateCmekSettingsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateCmekSettingsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets the Log Router settings for the given resource.
+     * Note: Settings for the Log Router can be get for Google Cloud projects,
+     * folders, organizations and billing accounts. Currently it can only be
+     * configured for organizations. Once configured for an organization, it
+     * applies to all projects and folders in the Google Cloud organization.
+     * See [Enabling CMEK for Log
+     * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+     * for more information.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getSettings(com.google.logging.v2.GetSettingsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetSettingsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates the Log Router settings for the given resource.
+     * Note: Settings for the Log Router can currently only be configured for
+     * Google Cloud organizations. Once configured, it applies to all projects and
+     * folders in the Google Cloud organization.
+     * [UpdateSettings][google.logging.v2.ConfigServiceV2.UpdateSettings]
+     * will fail if 1) `kms_key_name` is invalid, or 2) the associated service
+     * account does not have the required
+     * `roles/cloudkms.cryptoKeyEncrypterDecrypter` role assigned for the key, or
+     * 3) access to the key is disabled. 4) `location_id` is not supported by
+     * Logging. 5) `location_id` violate OrgPolicy.
+     * See [Enabling CMEK for Log
+     * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+     * for more information.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateSettings(com.google.logging.v2.UpdateSettingsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateSettingsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Copies a set of log entries from a log bucket to a Cloud Storage bucket.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + copyLogEntries(com.google.logging.v2.CopyLogEntriesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCopyLogEntriesMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST_BUCKETS = 0; + private static final int METHODID_GET_BUCKET = 1; + private static final int METHODID_CREATE_BUCKET_ASYNC = 2; + private static final int METHODID_UPDATE_BUCKET_ASYNC = 3; + private static final int METHODID_CREATE_BUCKET = 4; + private static final int METHODID_UPDATE_BUCKET = 5; + private static final int METHODID_DELETE_BUCKET = 6; + private static final int METHODID_UNDELETE_BUCKET = 7; + private static final int METHODID_LIST_VIEWS = 8; + private static final int METHODID_GET_VIEW = 9; + private static final int METHODID_CREATE_VIEW = 10; + private static final int METHODID_UPDATE_VIEW = 11; + private static final int METHODID_DELETE_VIEW = 12; + private static final int METHODID_LIST_SINKS = 13; + private static final int METHODID_GET_SINK = 14; + private static final int METHODID_CREATE_SINK = 15; + private static final int METHODID_UPDATE_SINK = 16; + private static final int METHODID_DELETE_SINK = 17; + private static final int METHODID_CREATE_LINK = 18; + private static final int METHODID_DELETE_LINK = 19; + private static final int METHODID_LIST_LINKS = 20; + private static final int METHODID_GET_LINK = 21; + private static final int METHODID_LIST_EXCLUSIONS = 22; + private static final int METHODID_GET_EXCLUSION = 23; + private static final int METHODID_CREATE_EXCLUSION = 24; + private static final int METHODID_UPDATE_EXCLUSION = 25; + private static final int METHODID_DELETE_EXCLUSION = 26; + private static final int METHODID_GET_CMEK_SETTINGS = 27; + private static final int METHODID_UPDATE_CMEK_SETTINGS = 28; + private static final int METHODID_GET_SETTINGS = 29; + private static final int METHODID_UPDATE_SETTINGS = 30; + private static final int METHODID_COPY_LOG_ENTRIES = 31; + + 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 AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_LIST_BUCKETS: + serviceImpl.listBuckets( + (com.google.logging.v2.ListBucketsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_BUCKET: + serviceImpl.getBucket( + (com.google.logging.v2.GetBucketRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_BUCKET_ASYNC: + serviceImpl.createBucketAsync( + (com.google.logging.v2.CreateBucketRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_BUCKET_ASYNC: + serviceImpl.updateBucketAsync( + (com.google.logging.v2.UpdateBucketRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_BUCKET: + serviceImpl.createBucket( + (com.google.logging.v2.CreateBucketRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_BUCKET: + serviceImpl.updateBucket( + (com.google.logging.v2.UpdateBucketRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_BUCKET: + serviceImpl.deleteBucket( + (com.google.logging.v2.DeleteBucketRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UNDELETE_BUCKET: + serviceImpl.undeleteBucket( + (com.google.logging.v2.UndeleteBucketRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_VIEWS: + serviceImpl.listViews( + (com.google.logging.v2.ListViewsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_VIEW: + serviceImpl.getView( + (com.google.logging.v2.GetViewRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_VIEW: + serviceImpl.createView( + (com.google.logging.v2.CreateViewRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_VIEW: + serviceImpl.updateView( + (com.google.logging.v2.UpdateViewRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_VIEW: + serviceImpl.deleteView( + (com.google.logging.v2.DeleteViewRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_SINKS: + serviceImpl.listSinks( + (com.google.logging.v2.ListSinksRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_SINK: + serviceImpl.getSink( + (com.google.logging.v2.GetSinkRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_SINK: + serviceImpl.createSink( + (com.google.logging.v2.CreateSinkRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_SINK: + serviceImpl.updateSink( + (com.google.logging.v2.UpdateSinkRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_SINK: + serviceImpl.deleteSink( + (com.google.logging.v2.DeleteSinkRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_LINK: + serviceImpl.createLink( + (com.google.logging.v2.CreateLinkRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_LINK: + serviceImpl.deleteLink( + (com.google.logging.v2.DeleteLinkRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_LINKS: + serviceImpl.listLinks( + (com.google.logging.v2.ListLinksRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_LINK: + serviceImpl.getLink( + (com.google.logging.v2.GetLinkRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_EXCLUSIONS: + serviceImpl.listExclusions( + (com.google.logging.v2.ListExclusionsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_EXCLUSION: + serviceImpl.getExclusion( + (com.google.logging.v2.GetExclusionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_EXCLUSION: + serviceImpl.createExclusion( + (com.google.logging.v2.CreateExclusionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_EXCLUSION: + serviceImpl.updateExclusion( + (com.google.logging.v2.UpdateExclusionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_EXCLUSION: + serviceImpl.deleteExclusion( + (com.google.logging.v2.DeleteExclusionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_CMEK_SETTINGS: + serviceImpl.getCmekSettings( + (com.google.logging.v2.GetCmekSettingsRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_CMEK_SETTINGS: + serviceImpl.updateCmekSettings( + (com.google.logging.v2.UpdateCmekSettingsRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_SETTINGS: + serviceImpl.getSettings( + (com.google.logging.v2.GetSettingsRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_SETTINGS: + serviceImpl.updateSettings( + (com.google.logging.v2.UpdateSettingsRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_COPY_LOG_ENTRIES: + serviceImpl.copyLogEntries( + (com.google.logging.v2.CopyLogEntriesRequest) 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(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getListBucketsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.logging.v2.ListBucketsRequest, + com.google.logging.v2.ListBucketsResponse>(service, METHODID_LIST_BUCKETS))) + .addMethod( + getGetBucketMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.logging.v2.GetBucketRequest, com.google.logging.v2.LogBucket>( + service, METHODID_GET_BUCKET))) + .addMethod( + getCreateBucketAsyncMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.logging.v2.CreateBucketRequest, com.google.longrunning.Operation>( + service, METHODID_CREATE_BUCKET_ASYNC))) + .addMethod( + getUpdateBucketAsyncMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.logging.v2.UpdateBucketRequest, com.google.longrunning.Operation>( + service, METHODID_UPDATE_BUCKET_ASYNC))) + .addMethod( + getCreateBucketMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.logging.v2.CreateBucketRequest, com.google.logging.v2.LogBucket>( + service, METHODID_CREATE_BUCKET))) + .addMethod( + getUpdateBucketMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.logging.v2.UpdateBucketRequest, com.google.logging.v2.LogBucket>( + service, METHODID_UPDATE_BUCKET))) + .addMethod( + getDeleteBucketMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.logging.v2.DeleteBucketRequest, com.google.protobuf.Empty>( + service, METHODID_DELETE_BUCKET))) + .addMethod( + getUndeleteBucketMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.logging.v2.UndeleteBucketRequest, com.google.protobuf.Empty>( + service, METHODID_UNDELETE_BUCKET))) + .addMethod( + getListViewsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.logging.v2.ListViewsRequest, + com.google.logging.v2.ListViewsResponse>(service, METHODID_LIST_VIEWS))) + .addMethod( + getGetViewMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.logging.v2.GetViewRequest, com.google.logging.v2.LogView>( + service, METHODID_GET_VIEW))) + .addMethod( + getCreateViewMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.logging.v2.CreateViewRequest, com.google.logging.v2.LogView>( + service, METHODID_CREATE_VIEW))) + .addMethod( + getUpdateViewMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.logging.v2.UpdateViewRequest, com.google.logging.v2.LogView>( + service, METHODID_UPDATE_VIEW))) + .addMethod( + getDeleteViewMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.logging.v2.DeleteViewRequest, com.google.protobuf.Empty>( + service, METHODID_DELETE_VIEW))) + .addMethod( + getListSinksMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.logging.v2.ListSinksRequest, + com.google.logging.v2.ListSinksResponse>(service, METHODID_LIST_SINKS))) + .addMethod( + getGetSinkMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.logging.v2.GetSinkRequest, com.google.logging.v2.LogSink>( + service, METHODID_GET_SINK))) + .addMethod( + getCreateSinkMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.logging.v2.CreateSinkRequest, com.google.logging.v2.LogSink>( + service, METHODID_CREATE_SINK))) + .addMethod( + getUpdateSinkMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.logging.v2.UpdateSinkRequest, com.google.logging.v2.LogSink>( + service, METHODID_UPDATE_SINK))) + .addMethod( + getDeleteSinkMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.logging.v2.DeleteSinkRequest, com.google.protobuf.Empty>( + service, METHODID_DELETE_SINK))) + .addMethod( + getCreateLinkMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.logging.v2.CreateLinkRequest, com.google.longrunning.Operation>( + service, METHODID_CREATE_LINK))) + .addMethod( + getDeleteLinkMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.logging.v2.DeleteLinkRequest, com.google.longrunning.Operation>( + service, METHODID_DELETE_LINK))) + .addMethod( + getListLinksMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.logging.v2.ListLinksRequest, + com.google.logging.v2.ListLinksResponse>(service, METHODID_LIST_LINKS))) + .addMethod( + getGetLinkMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.logging.v2.GetLinkRequest, com.google.logging.v2.Link>( + service, METHODID_GET_LINK))) + .addMethod( + getListExclusionsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.logging.v2.ListExclusionsRequest, + com.google.logging.v2.ListExclusionsResponse>( + service, METHODID_LIST_EXCLUSIONS))) + .addMethod( + getGetExclusionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.logging.v2.GetExclusionRequest, com.google.logging.v2.LogExclusion>( + service, METHODID_GET_EXCLUSION))) + .addMethod( + getCreateExclusionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.logging.v2.CreateExclusionRequest, + com.google.logging.v2.LogExclusion>(service, METHODID_CREATE_EXCLUSION))) + .addMethod( + getUpdateExclusionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.logging.v2.UpdateExclusionRequest, + com.google.logging.v2.LogExclusion>(service, METHODID_UPDATE_EXCLUSION))) + .addMethod( + getDeleteExclusionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.logging.v2.DeleteExclusionRequest, com.google.protobuf.Empty>( + service, METHODID_DELETE_EXCLUSION))) + .addMethod( + getGetCmekSettingsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.logging.v2.GetCmekSettingsRequest, + com.google.logging.v2.CmekSettings>(service, METHODID_GET_CMEK_SETTINGS))) + .addMethod( + getUpdateCmekSettingsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.logging.v2.UpdateCmekSettingsRequest, + com.google.logging.v2.CmekSettings>(service, METHODID_UPDATE_CMEK_SETTINGS))) + .addMethod( + getGetSettingsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.logging.v2.GetSettingsRequest, com.google.logging.v2.Settings>( + service, METHODID_GET_SETTINGS))) + .addMethod( + getUpdateSettingsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.logging.v2.UpdateSettingsRequest, com.google.logging.v2.Settings>( + service, METHODID_UPDATE_SETTINGS))) + .addMethod( + getCopyLogEntriesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.logging.v2.CopyLogEntriesRequest, com.google.longrunning.Operation>( + service, METHODID_COPY_LOG_ENTRIES))) + .build(); + } + + private abstract static class ConfigServiceV2BaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + ConfigServiceV2BaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.logging.v2.LoggingConfigProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("ConfigServiceV2"); + } + } + + private static final class ConfigServiceV2FileDescriptorSupplier + extends ConfigServiceV2BaseDescriptorSupplier { + ConfigServiceV2FileDescriptorSupplier() {} + } + + private static final class ConfigServiceV2MethodDescriptorSupplier + extends ConfigServiceV2BaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + ConfigServiceV2MethodDescriptorSupplier(java.lang.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 (ConfigServiceV2Grpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new ConfigServiceV2FileDescriptorSupplier()) + .addMethod(getListBucketsMethod()) + .addMethod(getGetBucketMethod()) + .addMethod(getCreateBucketAsyncMethod()) + .addMethod(getUpdateBucketAsyncMethod()) + .addMethod(getCreateBucketMethod()) + .addMethod(getUpdateBucketMethod()) + .addMethod(getDeleteBucketMethod()) + .addMethod(getUndeleteBucketMethod()) + .addMethod(getListViewsMethod()) + .addMethod(getGetViewMethod()) + .addMethod(getCreateViewMethod()) + .addMethod(getUpdateViewMethod()) + .addMethod(getDeleteViewMethod()) + .addMethod(getListSinksMethod()) + .addMethod(getGetSinkMethod()) + .addMethod(getCreateSinkMethod()) + .addMethod(getUpdateSinkMethod()) + .addMethod(getDeleteSinkMethod()) + .addMethod(getCreateLinkMethod()) + .addMethod(getDeleteLinkMethod()) + .addMethod(getListLinksMethod()) + .addMethod(getGetLinkMethod()) + .addMethod(getListExclusionsMethod()) + .addMethod(getGetExclusionMethod()) + .addMethod(getCreateExclusionMethod()) + .addMethod(getUpdateExclusionMethod()) + .addMethod(getDeleteExclusionMethod()) + .addMethod(getGetCmekSettingsMethod()) + .addMethod(getUpdateCmekSettingsMethod()) + .addMethod(getGetSettingsMethod()) + .addMethod(getUpdateSettingsMethod()) + .addMethod(getCopyLogEntriesMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-logging/grpc-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LoggingServiceV2Grpc.java b/java-logging/grpc-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LoggingServiceV2Grpc.java new file mode 100644 index 000000000000..e654a1b5482d --- /dev/null +++ b/java-logging/grpc-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LoggingServiceV2Grpc.java @@ -0,0 +1,1105 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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.logging.v2; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Service for ingesting and querying logs.
+ * 
+ */ +@io.grpc.stub.annotations.GrpcGenerated +public final class LoggingServiceV2Grpc { + + private LoggingServiceV2Grpc() {} + + public static final java.lang.String SERVICE_NAME = "google.logging.v2.LoggingServiceV2"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.logging.v2.DeleteLogRequest, com.google.protobuf.Empty> + getDeleteLogMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteLog", + requestType = com.google.logging.v2.DeleteLogRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.logging.v2.DeleteLogRequest, com.google.protobuf.Empty> + getDeleteLogMethod() { + io.grpc.MethodDescriptor + getDeleteLogMethod; + if ((getDeleteLogMethod = LoggingServiceV2Grpc.getDeleteLogMethod) == null) { + synchronized (LoggingServiceV2Grpc.class) { + if ((getDeleteLogMethod = LoggingServiceV2Grpc.getDeleteLogMethod) == null) { + LoggingServiceV2Grpc.getDeleteLogMethod = + getDeleteLogMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteLog")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.DeleteLogRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new LoggingServiceV2MethodDescriptorSupplier("DeleteLog")) + .build(); + } + } + } + return getDeleteLogMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.logging.v2.WriteLogEntriesRequest, + com.google.logging.v2.WriteLogEntriesResponse> + getWriteLogEntriesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "WriteLogEntries", + requestType = com.google.logging.v2.WriteLogEntriesRequest.class, + responseType = com.google.logging.v2.WriteLogEntriesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.logging.v2.WriteLogEntriesRequest, + com.google.logging.v2.WriteLogEntriesResponse> + getWriteLogEntriesMethod() { + io.grpc.MethodDescriptor< + com.google.logging.v2.WriteLogEntriesRequest, + com.google.logging.v2.WriteLogEntriesResponse> + getWriteLogEntriesMethod; + if ((getWriteLogEntriesMethod = LoggingServiceV2Grpc.getWriteLogEntriesMethod) == null) { + synchronized (LoggingServiceV2Grpc.class) { + if ((getWriteLogEntriesMethod = LoggingServiceV2Grpc.getWriteLogEntriesMethod) == null) { + LoggingServiceV2Grpc.getWriteLogEntriesMethod = + getWriteLogEntriesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "WriteLogEntries")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.WriteLogEntriesRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.WriteLogEntriesResponse.getDefaultInstance())) + .setSchemaDescriptor( + new LoggingServiceV2MethodDescriptorSupplier("WriteLogEntries")) + .build(); + } + } + } + return getWriteLogEntriesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.logging.v2.ListLogEntriesRequest, com.google.logging.v2.ListLogEntriesResponse> + getListLogEntriesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListLogEntries", + requestType = com.google.logging.v2.ListLogEntriesRequest.class, + responseType = com.google.logging.v2.ListLogEntriesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.logging.v2.ListLogEntriesRequest, com.google.logging.v2.ListLogEntriesResponse> + getListLogEntriesMethod() { + io.grpc.MethodDescriptor< + com.google.logging.v2.ListLogEntriesRequest, + com.google.logging.v2.ListLogEntriesResponse> + getListLogEntriesMethod; + if ((getListLogEntriesMethod = LoggingServiceV2Grpc.getListLogEntriesMethod) == null) { + synchronized (LoggingServiceV2Grpc.class) { + if ((getListLogEntriesMethod = LoggingServiceV2Grpc.getListLogEntriesMethod) == null) { + LoggingServiceV2Grpc.getListLogEntriesMethod = + getListLogEntriesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListLogEntries")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.ListLogEntriesRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.ListLogEntriesResponse.getDefaultInstance())) + .setSchemaDescriptor( + new LoggingServiceV2MethodDescriptorSupplier("ListLogEntries")) + .build(); + } + } + } + return getListLogEntriesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.logging.v2.ListMonitoredResourceDescriptorsRequest, + com.google.logging.v2.ListMonitoredResourceDescriptorsResponse> + getListMonitoredResourceDescriptorsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListMonitoredResourceDescriptors", + requestType = com.google.logging.v2.ListMonitoredResourceDescriptorsRequest.class, + responseType = com.google.logging.v2.ListMonitoredResourceDescriptorsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.logging.v2.ListMonitoredResourceDescriptorsRequest, + com.google.logging.v2.ListMonitoredResourceDescriptorsResponse> + getListMonitoredResourceDescriptorsMethod() { + io.grpc.MethodDescriptor< + com.google.logging.v2.ListMonitoredResourceDescriptorsRequest, + com.google.logging.v2.ListMonitoredResourceDescriptorsResponse> + getListMonitoredResourceDescriptorsMethod; + if ((getListMonitoredResourceDescriptorsMethod = + LoggingServiceV2Grpc.getListMonitoredResourceDescriptorsMethod) + == null) { + synchronized (LoggingServiceV2Grpc.class) { + if ((getListMonitoredResourceDescriptorsMethod = + LoggingServiceV2Grpc.getListMonitoredResourceDescriptorsMethod) + == null) { + LoggingServiceV2Grpc.getListMonitoredResourceDescriptorsMethod = + getListMonitoredResourceDescriptorsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ListMonitoredResourceDescriptors")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.ListMonitoredResourceDescriptorsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.ListMonitoredResourceDescriptorsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new LoggingServiceV2MethodDescriptorSupplier( + "ListMonitoredResourceDescriptors")) + .build(); + } + } + } + return getListMonitoredResourceDescriptorsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.logging.v2.ListLogsRequest, com.google.logging.v2.ListLogsResponse> + getListLogsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListLogs", + requestType = com.google.logging.v2.ListLogsRequest.class, + responseType = com.google.logging.v2.ListLogsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.logging.v2.ListLogsRequest, com.google.logging.v2.ListLogsResponse> + getListLogsMethod() { + io.grpc.MethodDescriptor< + com.google.logging.v2.ListLogsRequest, com.google.logging.v2.ListLogsResponse> + getListLogsMethod; + if ((getListLogsMethod = LoggingServiceV2Grpc.getListLogsMethod) == null) { + synchronized (LoggingServiceV2Grpc.class) { + if ((getListLogsMethod = LoggingServiceV2Grpc.getListLogsMethod) == null) { + LoggingServiceV2Grpc.getListLogsMethod = + getListLogsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListLogs")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.ListLogsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.ListLogsResponse.getDefaultInstance())) + .setSchemaDescriptor(new LoggingServiceV2MethodDescriptorSupplier("ListLogs")) + .build(); + } + } + } + return getListLogsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.logging.v2.TailLogEntriesRequest, com.google.logging.v2.TailLogEntriesResponse> + getTailLogEntriesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "TailLogEntries", + requestType = com.google.logging.v2.TailLogEntriesRequest.class, + responseType = com.google.logging.v2.TailLogEntriesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + public static io.grpc.MethodDescriptor< + com.google.logging.v2.TailLogEntriesRequest, com.google.logging.v2.TailLogEntriesResponse> + getTailLogEntriesMethod() { + io.grpc.MethodDescriptor< + com.google.logging.v2.TailLogEntriesRequest, + com.google.logging.v2.TailLogEntriesResponse> + getTailLogEntriesMethod; + if ((getTailLogEntriesMethod = LoggingServiceV2Grpc.getTailLogEntriesMethod) == null) { + synchronized (LoggingServiceV2Grpc.class) { + if ((getTailLogEntriesMethod = LoggingServiceV2Grpc.getTailLogEntriesMethod) == null) { + LoggingServiceV2Grpc.getTailLogEntriesMethod = + getTailLogEntriesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "TailLogEntries")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.TailLogEntriesRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.TailLogEntriesResponse.getDefaultInstance())) + .setSchemaDescriptor( + new LoggingServiceV2MethodDescriptorSupplier("TailLogEntries")) + .build(); + } + } + } + return getTailLogEntriesMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static LoggingServiceV2Stub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public LoggingServiceV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new LoggingServiceV2Stub(channel, callOptions); + } + }; + return LoggingServiceV2Stub.newStub(factory, channel); + } + + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static LoggingServiceV2BlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public LoggingServiceV2BlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new LoggingServiceV2BlockingV2Stub(channel, callOptions); + } + }; + return LoggingServiceV2BlockingV2Stub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static LoggingServiceV2BlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public LoggingServiceV2BlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new LoggingServiceV2BlockingStub(channel, callOptions); + } + }; + return LoggingServiceV2BlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static LoggingServiceV2FutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public LoggingServiceV2FutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new LoggingServiceV2FutureStub(channel, callOptions); + } + }; + return LoggingServiceV2FutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service for ingesting and querying logs.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Deletes all the log entries in a log for the _Default Log Bucket. The log
+     * reappears if it receives new entries. Log entries written shortly before
+     * the delete operation might not be deleted. Entries received after the
+     * delete operation with a timestamp before the operation will be deleted.
+     * 
+ */ + default void deleteLog( + com.google.logging.v2.DeleteLogRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteLogMethod(), responseObserver); + } + + /** + * + * + *
+     * Writes log entries to Logging. This API method is the
+     * only way to send log entries to Logging. This method
+     * is used, directly or indirectly, by the Logging agent
+     * (fluentd) and all logging libraries configured to use Logging.
+     * A single request may contain log entries for a maximum of 1000
+     * different resources (projects, organizations, billing accounts or
+     * folders)
+     * 
+ */ + default void writeLogEntries( + com.google.logging.v2.WriteLogEntriesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getWriteLogEntriesMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists log entries.  Use this method to retrieve log entries that originated
+     * from a project/folder/organization/billing account.  For ways to export log
+     * entries, see [Exporting
+     * Logs](https://cloud.google.com/logging/docs/export).
+     * 
+ */ + default void listLogEntries( + com.google.logging.v2.ListLogEntriesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListLogEntriesMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists the descriptors for monitored resource types used by Logging.
+     * 
+ */ + default void listMonitoredResourceDescriptors( + com.google.logging.v2.ListMonitoredResourceDescriptorsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListMonitoredResourceDescriptorsMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists the logs in projects, organizations, folders, or billing accounts.
+     * Only logs that have entries are listed.
+     * 
+ */ + default void listLogs( + com.google.logging.v2.ListLogsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListLogsMethod(), responseObserver); + } + + /** + * + * + *
+     * Streaming read of log entries as they are ingested. Until the stream is
+     * terminated, it will continue reading logs.
+     * 
+ */ + default io.grpc.stub.StreamObserver tailLogEntries( + io.grpc.stub.StreamObserver + responseObserver) { + return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall( + getTailLogEntriesMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service LoggingServiceV2. + * + *
+   * Service for ingesting and querying logs.
+   * 
+ */ + public abstract static class LoggingServiceV2ImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return LoggingServiceV2Grpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service LoggingServiceV2. + * + *
+   * Service for ingesting and querying logs.
+   * 
+ */ + public static final class LoggingServiceV2Stub + extends io.grpc.stub.AbstractAsyncStub { + private LoggingServiceV2Stub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected LoggingServiceV2Stub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new LoggingServiceV2Stub(channel, callOptions); + } + + /** + * + * + *
+     * Deletes all the log entries in a log for the _Default Log Bucket. The log
+     * reappears if it receives new entries. Log entries written shortly before
+     * the delete operation might not be deleted. Entries received after the
+     * delete operation with a timestamp before the operation will be deleted.
+     * 
+ */ + public void deleteLog( + com.google.logging.v2.DeleteLogRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteLogMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Writes log entries to Logging. This API method is the
+     * only way to send log entries to Logging. This method
+     * is used, directly or indirectly, by the Logging agent
+     * (fluentd) and all logging libraries configured to use Logging.
+     * A single request may contain log entries for a maximum of 1000
+     * different resources (projects, organizations, billing accounts or
+     * folders)
+     * 
+ */ + public void writeLogEntries( + com.google.logging.v2.WriteLogEntriesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getWriteLogEntriesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists log entries.  Use this method to retrieve log entries that originated
+     * from a project/folder/organization/billing account.  For ways to export log
+     * entries, see [Exporting
+     * Logs](https://cloud.google.com/logging/docs/export).
+     * 
+ */ + public void listLogEntries( + com.google.logging.v2.ListLogEntriesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListLogEntriesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists the descriptors for monitored resource types used by Logging.
+     * 
+ */ + public void listMonitoredResourceDescriptors( + com.google.logging.v2.ListMonitoredResourceDescriptorsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListMonitoredResourceDescriptorsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists the logs in projects, organizations, folders, or billing accounts.
+     * Only logs that have entries are listed.
+     * 
+ */ + public void listLogs( + com.google.logging.v2.ListLogsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListLogsMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Streaming read of log entries as they are ingested. Until the stream is
+     * terminated, it will continue reading logs.
+     * 
+ */ + public io.grpc.stub.StreamObserver tailLogEntries( + io.grpc.stub.StreamObserver + responseObserver) { + return io.grpc.stub.ClientCalls.asyncBidiStreamingCall( + getChannel().newCall(getTailLogEntriesMethod(), getCallOptions()), responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service LoggingServiceV2. + * + *
+   * Service for ingesting and querying logs.
+   * 
+ */ + public static final class LoggingServiceV2BlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private LoggingServiceV2BlockingV2Stub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected LoggingServiceV2BlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new LoggingServiceV2BlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
+     * Deletes all the log entries in a log for the _Default Log Bucket. The log
+     * reappears if it receives new entries. Log entries written shortly before
+     * the delete operation might not be deleted. Entries received after the
+     * delete operation with a timestamp before the operation will be deleted.
+     * 
+ */ + public com.google.protobuf.Empty deleteLog(com.google.logging.v2.DeleteLogRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getDeleteLogMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Writes log entries to Logging. This API method is the
+     * only way to send log entries to Logging. This method
+     * is used, directly or indirectly, by the Logging agent
+     * (fluentd) and all logging libraries configured to use Logging.
+     * A single request may contain log entries for a maximum of 1000
+     * different resources (projects, organizations, billing accounts or
+     * folders)
+     * 
+ */ + public com.google.logging.v2.WriteLogEntriesResponse writeLogEntries( + com.google.logging.v2.WriteLogEntriesRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getWriteLogEntriesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists log entries.  Use this method to retrieve log entries that originated
+     * from a project/folder/organization/billing account.  For ways to export log
+     * entries, see [Exporting
+     * Logs](https://cloud.google.com/logging/docs/export).
+     * 
+ */ + public com.google.logging.v2.ListLogEntriesResponse listLogEntries( + com.google.logging.v2.ListLogEntriesRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListLogEntriesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists the descriptors for monitored resource types used by Logging.
+     * 
+ */ + public com.google.logging.v2.ListMonitoredResourceDescriptorsResponse + listMonitoredResourceDescriptors( + com.google.logging.v2.ListMonitoredResourceDescriptorsRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListMonitoredResourceDescriptorsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists the logs in projects, organizations, folders, or billing accounts.
+     * Only logs that have entries are listed.
+     * 
+ */ + public com.google.logging.v2.ListLogsResponse listLogs( + com.google.logging.v2.ListLogsRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListLogsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Streaming read of log entries as they are ingested. Until the stream is
+     * terminated, it will continue reading logs.
+     * 
+ */ + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/10918") + public io.grpc.stub.BlockingClientCall< + com.google.logging.v2.TailLogEntriesRequest, + com.google.logging.v2.TailLogEntriesResponse> + tailLogEntries() { + return io.grpc.stub.ClientCalls.blockingBidiStreamingCall( + getChannel(), getTailLogEntriesMethod(), getCallOptions()); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service LoggingServiceV2. + * + *
+   * Service for ingesting and querying logs.
+   * 
+ */ + public static final class LoggingServiceV2BlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private LoggingServiceV2BlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected LoggingServiceV2BlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new LoggingServiceV2BlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Deletes all the log entries in a log for the _Default Log Bucket. The log
+     * reappears if it receives new entries. Log entries written shortly before
+     * the delete operation might not be deleted. Entries received after the
+     * delete operation with a timestamp before the operation will be deleted.
+     * 
+ */ + public com.google.protobuf.Empty deleteLog(com.google.logging.v2.DeleteLogRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteLogMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Writes log entries to Logging. This API method is the
+     * only way to send log entries to Logging. This method
+     * is used, directly or indirectly, by the Logging agent
+     * (fluentd) and all logging libraries configured to use Logging.
+     * A single request may contain log entries for a maximum of 1000
+     * different resources (projects, organizations, billing accounts or
+     * folders)
+     * 
+ */ + public com.google.logging.v2.WriteLogEntriesResponse writeLogEntries( + com.google.logging.v2.WriteLogEntriesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getWriteLogEntriesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists log entries.  Use this method to retrieve log entries that originated
+     * from a project/folder/organization/billing account.  For ways to export log
+     * entries, see [Exporting
+     * Logs](https://cloud.google.com/logging/docs/export).
+     * 
+ */ + public com.google.logging.v2.ListLogEntriesResponse listLogEntries( + com.google.logging.v2.ListLogEntriesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListLogEntriesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists the descriptors for monitored resource types used by Logging.
+     * 
+ */ + public com.google.logging.v2.ListMonitoredResourceDescriptorsResponse + listMonitoredResourceDescriptors( + com.google.logging.v2.ListMonitoredResourceDescriptorsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListMonitoredResourceDescriptorsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists the logs in projects, organizations, folders, or billing accounts.
+     * Only logs that have entries are listed.
+     * 
+ */ + public com.google.logging.v2.ListLogsResponse listLogs( + com.google.logging.v2.ListLogsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListLogsMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service LoggingServiceV2. + * + *
+   * Service for ingesting and querying logs.
+   * 
+ */ + public static final class LoggingServiceV2FutureStub + extends io.grpc.stub.AbstractFutureStub { + private LoggingServiceV2FutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected LoggingServiceV2FutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new LoggingServiceV2FutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Deletes all the log entries in a log for the _Default Log Bucket. The log
+     * reappears if it receives new entries. Log entries written shortly before
+     * the delete operation might not be deleted. Entries received after the
+     * delete operation with a timestamp before the operation will be deleted.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture deleteLog( + com.google.logging.v2.DeleteLogRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteLogMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Writes log entries to Logging. This API method is the
+     * only way to send log entries to Logging. This method
+     * is used, directly or indirectly, by the Logging agent
+     * (fluentd) and all logging libraries configured to use Logging.
+     * A single request may contain log entries for a maximum of 1000
+     * different resources (projects, organizations, billing accounts or
+     * folders)
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.logging.v2.WriteLogEntriesResponse> + writeLogEntries(com.google.logging.v2.WriteLogEntriesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getWriteLogEntriesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists log entries.  Use this method to retrieve log entries that originated
+     * from a project/folder/organization/billing account.  For ways to export log
+     * entries, see [Exporting
+     * Logs](https://cloud.google.com/logging/docs/export).
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.logging.v2.ListLogEntriesResponse> + listLogEntries(com.google.logging.v2.ListLogEntriesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListLogEntriesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists the descriptors for monitored resource types used by Logging.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.logging.v2.ListMonitoredResourceDescriptorsResponse> + listMonitoredResourceDescriptors( + com.google.logging.v2.ListMonitoredResourceDescriptorsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListMonitoredResourceDescriptorsMethod(), getCallOptions()), + request); + } + + /** + * + * + *
+     * Lists the logs in projects, organizations, folders, or billing accounts.
+     * Only logs that have entries are listed.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.logging.v2.ListLogsResponse> + listLogs(com.google.logging.v2.ListLogsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListLogsMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_DELETE_LOG = 0; + private static final int METHODID_WRITE_LOG_ENTRIES = 1; + private static final int METHODID_LIST_LOG_ENTRIES = 2; + private static final int METHODID_LIST_MONITORED_RESOURCE_DESCRIPTORS = 3; + private static final int METHODID_LIST_LOGS = 4; + private static final int METHODID_TAIL_LOG_ENTRIES = 5; + + 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 AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService 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_DELETE_LOG: + serviceImpl.deleteLog( + (com.google.logging.v2.DeleteLogRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_WRITE_LOG_ENTRIES: + serviceImpl.writeLogEntries( + (com.google.logging.v2.WriteLogEntriesRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_LOG_ENTRIES: + serviceImpl.listLogEntries( + (com.google.logging.v2.ListLogEntriesRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_MONITORED_RESOURCE_DESCRIPTORS: + serviceImpl.listMonitoredResourceDescriptors( + (com.google.logging.v2.ListMonitoredResourceDescriptorsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.logging.v2.ListMonitoredResourceDescriptorsResponse>) + responseObserver); + break; + case METHODID_LIST_LOGS: + serviceImpl.listLogs( + (com.google.logging.v2.ListLogsRequest) 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) { + case METHODID_TAIL_LOG_ENTRIES: + return (io.grpc.stub.StreamObserver) + serviceImpl.tailLogEntries( + (io.grpc.stub.StreamObserver) + responseObserver); + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getDeleteLogMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.logging.v2.DeleteLogRequest, com.google.protobuf.Empty>( + service, METHODID_DELETE_LOG))) + .addMethod( + getWriteLogEntriesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.logging.v2.WriteLogEntriesRequest, + com.google.logging.v2.WriteLogEntriesResponse>( + service, METHODID_WRITE_LOG_ENTRIES))) + .addMethod( + getListLogEntriesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.logging.v2.ListLogEntriesRequest, + com.google.logging.v2.ListLogEntriesResponse>( + service, METHODID_LIST_LOG_ENTRIES))) + .addMethod( + getListMonitoredResourceDescriptorsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.logging.v2.ListMonitoredResourceDescriptorsRequest, + com.google.logging.v2.ListMonitoredResourceDescriptorsResponse>( + service, METHODID_LIST_MONITORED_RESOURCE_DESCRIPTORS))) + .addMethod( + getListLogsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.logging.v2.ListLogsRequest, com.google.logging.v2.ListLogsResponse>( + service, METHODID_LIST_LOGS))) + .addMethod( + getTailLogEntriesMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + com.google.logging.v2.TailLogEntriesRequest, + com.google.logging.v2.TailLogEntriesResponse>( + service, METHODID_TAIL_LOG_ENTRIES))) + .build(); + } + + private abstract static class LoggingServiceV2BaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + LoggingServiceV2BaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.logging.v2.LoggingProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("LoggingServiceV2"); + } + } + + private static final class LoggingServiceV2FileDescriptorSupplier + extends LoggingServiceV2BaseDescriptorSupplier { + LoggingServiceV2FileDescriptorSupplier() {} + } + + private static final class LoggingServiceV2MethodDescriptorSupplier + extends LoggingServiceV2BaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + LoggingServiceV2MethodDescriptorSupplier(java.lang.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 (LoggingServiceV2Grpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new LoggingServiceV2FileDescriptorSupplier()) + .addMethod(getDeleteLogMethod()) + .addMethod(getWriteLogEntriesMethod()) + .addMethod(getListLogEntriesMethod()) + .addMethod(getListMonitoredResourceDescriptorsMethod()) + .addMethod(getListLogsMethod()) + .addMethod(getTailLogEntriesMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-logging/grpc-google-cloud-logging-v2/src/main/java/com/google/logging/v2/MetricsServiceV2Grpc.java b/java-logging/grpc-google-cloud-logging-v2/src/main/java/com/google/logging/v2/MetricsServiceV2Grpc.java new file mode 100644 index 000000000000..ecc22d0246a0 --- /dev/null +++ b/java-logging/grpc-google-cloud-logging-v2/src/main/java/com/google/logging/v2/MetricsServiceV2Grpc.java @@ -0,0 +1,912 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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.logging.v2; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Service for configuring logs-based metrics.
+ * 
+ */ +@io.grpc.stub.annotations.GrpcGenerated +public final class MetricsServiceV2Grpc { + + private MetricsServiceV2Grpc() {} + + public static final java.lang.String SERVICE_NAME = "google.logging.v2.MetricsServiceV2"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.logging.v2.ListLogMetricsRequest, com.google.logging.v2.ListLogMetricsResponse> + getListLogMetricsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListLogMetrics", + requestType = com.google.logging.v2.ListLogMetricsRequest.class, + responseType = com.google.logging.v2.ListLogMetricsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.logging.v2.ListLogMetricsRequest, com.google.logging.v2.ListLogMetricsResponse> + getListLogMetricsMethod() { + io.grpc.MethodDescriptor< + com.google.logging.v2.ListLogMetricsRequest, + com.google.logging.v2.ListLogMetricsResponse> + getListLogMetricsMethod; + if ((getListLogMetricsMethod = MetricsServiceV2Grpc.getListLogMetricsMethod) == null) { + synchronized (MetricsServiceV2Grpc.class) { + if ((getListLogMetricsMethod = MetricsServiceV2Grpc.getListLogMetricsMethod) == null) { + MetricsServiceV2Grpc.getListLogMetricsMethod = + getListLogMetricsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListLogMetrics")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.ListLogMetricsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.ListLogMetricsResponse.getDefaultInstance())) + .setSchemaDescriptor( + new MetricsServiceV2MethodDescriptorSupplier("ListLogMetrics")) + .build(); + } + } + } + return getListLogMetricsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.logging.v2.GetLogMetricRequest, com.google.logging.v2.LogMetric> + getGetLogMetricMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetLogMetric", + requestType = com.google.logging.v2.GetLogMetricRequest.class, + responseType = com.google.logging.v2.LogMetric.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.logging.v2.GetLogMetricRequest, com.google.logging.v2.LogMetric> + getGetLogMetricMethod() { + io.grpc.MethodDescriptor< + com.google.logging.v2.GetLogMetricRequest, com.google.logging.v2.LogMetric> + getGetLogMetricMethod; + if ((getGetLogMetricMethod = MetricsServiceV2Grpc.getGetLogMetricMethod) == null) { + synchronized (MetricsServiceV2Grpc.class) { + if ((getGetLogMetricMethod = MetricsServiceV2Grpc.getGetLogMetricMethod) == null) { + MetricsServiceV2Grpc.getGetLogMetricMethod = + getGetLogMetricMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetLogMetric")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.GetLogMetricRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.LogMetric.getDefaultInstance())) + .setSchemaDescriptor( + new MetricsServiceV2MethodDescriptorSupplier("GetLogMetric")) + .build(); + } + } + } + return getGetLogMetricMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.logging.v2.CreateLogMetricRequest, com.google.logging.v2.LogMetric> + getCreateLogMetricMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateLogMetric", + requestType = com.google.logging.v2.CreateLogMetricRequest.class, + responseType = com.google.logging.v2.LogMetric.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.logging.v2.CreateLogMetricRequest, com.google.logging.v2.LogMetric> + getCreateLogMetricMethod() { + io.grpc.MethodDescriptor< + com.google.logging.v2.CreateLogMetricRequest, com.google.logging.v2.LogMetric> + getCreateLogMetricMethod; + if ((getCreateLogMetricMethod = MetricsServiceV2Grpc.getCreateLogMetricMethod) == null) { + synchronized (MetricsServiceV2Grpc.class) { + if ((getCreateLogMetricMethod = MetricsServiceV2Grpc.getCreateLogMetricMethod) == null) { + MetricsServiceV2Grpc.getCreateLogMetricMethod = + getCreateLogMetricMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateLogMetric")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.CreateLogMetricRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.LogMetric.getDefaultInstance())) + .setSchemaDescriptor( + new MetricsServiceV2MethodDescriptorSupplier("CreateLogMetric")) + .build(); + } + } + } + return getCreateLogMetricMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.logging.v2.UpdateLogMetricRequest, com.google.logging.v2.LogMetric> + getUpdateLogMetricMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateLogMetric", + requestType = com.google.logging.v2.UpdateLogMetricRequest.class, + responseType = com.google.logging.v2.LogMetric.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.logging.v2.UpdateLogMetricRequest, com.google.logging.v2.LogMetric> + getUpdateLogMetricMethod() { + io.grpc.MethodDescriptor< + com.google.logging.v2.UpdateLogMetricRequest, com.google.logging.v2.LogMetric> + getUpdateLogMetricMethod; + if ((getUpdateLogMetricMethod = MetricsServiceV2Grpc.getUpdateLogMetricMethod) == null) { + synchronized (MetricsServiceV2Grpc.class) { + if ((getUpdateLogMetricMethod = MetricsServiceV2Grpc.getUpdateLogMetricMethod) == null) { + MetricsServiceV2Grpc.getUpdateLogMetricMethod = + getUpdateLogMetricMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateLogMetric")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.UpdateLogMetricRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.LogMetric.getDefaultInstance())) + .setSchemaDescriptor( + new MetricsServiceV2MethodDescriptorSupplier("UpdateLogMetric")) + .build(); + } + } + } + return getUpdateLogMetricMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.logging.v2.DeleteLogMetricRequest, com.google.protobuf.Empty> + getDeleteLogMetricMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteLogMetric", + requestType = com.google.logging.v2.DeleteLogMetricRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.logging.v2.DeleteLogMetricRequest, com.google.protobuf.Empty> + getDeleteLogMetricMethod() { + io.grpc.MethodDescriptor< + com.google.logging.v2.DeleteLogMetricRequest, com.google.protobuf.Empty> + getDeleteLogMetricMethod; + if ((getDeleteLogMetricMethod = MetricsServiceV2Grpc.getDeleteLogMetricMethod) == null) { + synchronized (MetricsServiceV2Grpc.class) { + if ((getDeleteLogMetricMethod = MetricsServiceV2Grpc.getDeleteLogMetricMethod) == null) { + MetricsServiceV2Grpc.getDeleteLogMetricMethod = + getDeleteLogMetricMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteLogMetric")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.logging.v2.DeleteLogMetricRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new MetricsServiceV2MethodDescriptorSupplier("DeleteLogMetric")) + .build(); + } + } + } + return getDeleteLogMetricMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static MetricsServiceV2Stub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public MetricsServiceV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MetricsServiceV2Stub(channel, callOptions); + } + }; + return MetricsServiceV2Stub.newStub(factory, channel); + } + + /** Creates a new blocking-style stub that supports all types of calls on the service */ + public static MetricsServiceV2BlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public MetricsServiceV2BlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MetricsServiceV2BlockingV2Stub(channel, callOptions); + } + }; + return MetricsServiceV2BlockingV2Stub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static MetricsServiceV2BlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public MetricsServiceV2BlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MetricsServiceV2BlockingStub(channel, callOptions); + } + }; + return MetricsServiceV2BlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static MetricsServiceV2FutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public MetricsServiceV2FutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MetricsServiceV2FutureStub(channel, callOptions); + } + }; + return MetricsServiceV2FutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service for configuring logs-based metrics.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Lists logs-based metrics.
+     * 
+ */ + default void listLogMetrics( + com.google.logging.v2.ListLogMetricsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListLogMetricsMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets a logs-based metric.
+     * 
+ */ + default void getLogMetric( + com.google.logging.v2.GetLogMetricRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetLogMetricMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a logs-based metric.
+     * 
+ */ + default void createLogMetric( + com.google.logging.v2.CreateLogMetricRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateLogMetricMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates or updates a logs-based metric.
+     * 
+ */ + default void updateLogMetric( + com.google.logging.v2.UpdateLogMetricRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateLogMetricMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a logs-based metric.
+     * 
+ */ + default void deleteLogMetric( + com.google.logging.v2.DeleteLogMetricRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteLogMetricMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service MetricsServiceV2. + * + *
+   * Service for configuring logs-based metrics.
+   * 
+ */ + public abstract static class MetricsServiceV2ImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return MetricsServiceV2Grpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service MetricsServiceV2. + * + *
+   * Service for configuring logs-based metrics.
+   * 
+ */ + public static final class MetricsServiceV2Stub + extends io.grpc.stub.AbstractAsyncStub { + private MetricsServiceV2Stub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected MetricsServiceV2Stub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MetricsServiceV2Stub(channel, callOptions); + } + + /** + * + * + *
+     * Lists logs-based metrics.
+     * 
+ */ + public void listLogMetrics( + com.google.logging.v2.ListLogMetricsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListLogMetricsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets a logs-based metric.
+     * 
+ */ + public void getLogMetric( + com.google.logging.v2.GetLogMetricRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetLogMetricMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a logs-based metric.
+     * 
+ */ + public void createLogMetric( + com.google.logging.v2.CreateLogMetricRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateLogMetricMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates or updates a logs-based metric.
+     * 
+ */ + public void updateLogMetric( + com.google.logging.v2.UpdateLogMetricRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateLogMetricMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a logs-based metric.
+     * 
+ */ + public void deleteLogMetric( + com.google.logging.v2.DeleteLogMetricRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteLogMetricMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service MetricsServiceV2. + * + *
+   * Service for configuring logs-based metrics.
+   * 
+ */ + public static final class MetricsServiceV2BlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private MetricsServiceV2BlockingV2Stub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected MetricsServiceV2BlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MetricsServiceV2BlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
+     * Lists logs-based metrics.
+     * 
+ */ + public com.google.logging.v2.ListLogMetricsResponse listLogMetrics( + com.google.logging.v2.ListLogMetricsRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListLogMetricsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a logs-based metric.
+     * 
+ */ + public com.google.logging.v2.LogMetric getLogMetric( + com.google.logging.v2.GetLogMetricRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetLogMetricMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a logs-based metric.
+     * 
+ */ + public com.google.logging.v2.LogMetric createLogMetric( + com.google.logging.v2.CreateLogMetricRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getCreateLogMetricMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates or updates a logs-based metric.
+     * 
+ */ + public com.google.logging.v2.LogMetric updateLogMetric( + com.google.logging.v2.UpdateLogMetricRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getUpdateLogMetricMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a logs-based metric.
+     * 
+ */ + public com.google.protobuf.Empty deleteLogMetric( + com.google.logging.v2.DeleteLogMetricRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getDeleteLogMetricMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service MetricsServiceV2. + * + *
+   * Service for configuring logs-based metrics.
+   * 
+ */ + public static final class MetricsServiceV2BlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private MetricsServiceV2BlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected MetricsServiceV2BlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MetricsServiceV2BlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists logs-based metrics.
+     * 
+ */ + public com.google.logging.v2.ListLogMetricsResponse listLogMetrics( + com.google.logging.v2.ListLogMetricsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListLogMetricsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a logs-based metric.
+     * 
+ */ + public com.google.logging.v2.LogMetric getLogMetric( + com.google.logging.v2.GetLogMetricRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetLogMetricMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a logs-based metric.
+     * 
+ */ + public com.google.logging.v2.LogMetric createLogMetric( + com.google.logging.v2.CreateLogMetricRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateLogMetricMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates or updates a logs-based metric.
+     * 
+ */ + public com.google.logging.v2.LogMetric updateLogMetric( + com.google.logging.v2.UpdateLogMetricRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateLogMetricMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a logs-based metric.
+     * 
+ */ + public com.google.protobuf.Empty deleteLogMetric( + com.google.logging.v2.DeleteLogMetricRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteLogMetricMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service MetricsServiceV2. + * + *
+   * Service for configuring logs-based metrics.
+   * 
+ */ + public static final class MetricsServiceV2FutureStub + extends io.grpc.stub.AbstractFutureStub { + private MetricsServiceV2FutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected MetricsServiceV2FutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MetricsServiceV2FutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists logs-based metrics.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.logging.v2.ListLogMetricsResponse> + listLogMetrics(com.google.logging.v2.ListLogMetricsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListLogMetricsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets a logs-based metric.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getLogMetric(com.google.logging.v2.GetLogMetricRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetLogMetricMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a logs-based metric.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createLogMetric(com.google.logging.v2.CreateLogMetricRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateLogMetricMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates or updates a logs-based metric.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateLogMetric(com.google.logging.v2.UpdateLogMetricRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateLogMetricMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a logs-based metric.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteLogMetric(com.google.logging.v2.DeleteLogMetricRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteLogMetricMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST_LOG_METRICS = 0; + private static final int METHODID_GET_LOG_METRIC = 1; + private static final int METHODID_CREATE_LOG_METRIC = 2; + private static final int METHODID_UPDATE_LOG_METRIC = 3; + private static final int METHODID_DELETE_LOG_METRIC = 4; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_LIST_LOG_METRICS: + serviceImpl.listLogMetrics( + (com.google.logging.v2.ListLogMetricsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_LOG_METRIC: + serviceImpl.getLogMetric( + (com.google.logging.v2.GetLogMetricRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_LOG_METRIC: + serviceImpl.createLogMetric( + (com.google.logging.v2.CreateLogMetricRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_LOG_METRIC: + serviceImpl.updateLogMetric( + (com.google.logging.v2.UpdateLogMetricRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_LOG_METRIC: + serviceImpl.deleteLogMetric( + (com.google.logging.v2.DeleteLogMetricRequest) 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(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getListLogMetricsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.logging.v2.ListLogMetricsRequest, + com.google.logging.v2.ListLogMetricsResponse>( + service, METHODID_LIST_LOG_METRICS))) + .addMethod( + getGetLogMetricMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.logging.v2.GetLogMetricRequest, com.google.logging.v2.LogMetric>( + service, METHODID_GET_LOG_METRIC))) + .addMethod( + getCreateLogMetricMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.logging.v2.CreateLogMetricRequest, com.google.logging.v2.LogMetric>( + service, METHODID_CREATE_LOG_METRIC))) + .addMethod( + getUpdateLogMetricMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.logging.v2.UpdateLogMetricRequest, com.google.logging.v2.LogMetric>( + service, METHODID_UPDATE_LOG_METRIC))) + .addMethod( + getDeleteLogMetricMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.logging.v2.DeleteLogMetricRequest, com.google.protobuf.Empty>( + service, METHODID_DELETE_LOG_METRIC))) + .build(); + } + + private abstract static class MetricsServiceV2BaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + MetricsServiceV2BaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.logging.v2.LoggingMetricsProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("MetricsServiceV2"); + } + } + + private static final class MetricsServiceV2FileDescriptorSupplier + extends MetricsServiceV2BaseDescriptorSupplier { + MetricsServiceV2FileDescriptorSupplier() {} + } + + private static final class MetricsServiceV2MethodDescriptorSupplier + extends MetricsServiceV2BaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + MetricsServiceV2MethodDescriptorSupplier(java.lang.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 (MetricsServiceV2Grpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new MetricsServiceV2FileDescriptorSupplier()) + .addMethod(getListLogMetricsMethod()) + .addMethod(getGetLogMetricMethod()) + .addMethod(getCreateLogMetricMethod()) + .addMethod(getUpdateLogMetricMethod()) + .addMethod(getDeleteLogMetricMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-logging/java.header b/java-logging/java.header new file mode 100644 index 000000000000..d0970ba7d375 --- /dev/null +++ b/java-logging/java.header @@ -0,0 +1,15 @@ +^/\*$ +^ \* Copyright \d\d\d\d,? Google (Inc\.|LLC)$ +^ \*$ +^ \* Licensed under the Apache License, Version 2\.0 \(the "License"\);$ +^ \* you may not use this file except in compliance with the License\.$ +^ \* You may obtain a copy of the License at$ +^ \*$ +^ \*[ ]+https?://www.apache.org/licenses/LICENSE-2\.0$ +^ \*$ +^ \* Unless required by applicable law or agreed to in writing, software$ +^ \* distributed under the License is distributed on an "AS IS" BASIS,$ +^ \* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.$ +^ \* See the License for the specific language governing permissions and$ +^ \* limitations under the License\.$ +^ \*/$ diff --git a/java-logging/license-checks.xml b/java-logging/license-checks.xml new file mode 100644 index 000000000000..6597fced808e --- /dev/null +++ b/java-logging/license-checks.xml @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/java-logging/owlbot.py b/java-logging/owlbot.py new file mode 100644 index 000000000000..66c43071fc21 --- /dev/null +++ b/java-logging/owlbot.py @@ -0,0 +1,128 @@ +# 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 os +import synthtool as s +from synthtool.languages import java + +# The method renamings will be removed in the next major release(lines 34 - 51) +#s.replace('**/CmekSettingsName.java', 'formatBillingAccountName', 'formatBillingAccountCmekSettingsName') +DEPRECATION_JAVADOC = """Please use {{@link #{new_method}}} instead""" + +for library in s.get_staging_dirs(): + # put any special-case replacements here + java.copy_and_rename_method( + 'owl-bot-staging/v2/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java', + 'public static String formatBillingAccountName(String billingAccount)', + 'formatBillingAccountName', + 'formatBillingAccountCmekSettingsName' + ) + + java.deprecate_method( + 'owl-bot-staging/v2/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java', + 'public static String formatBillingAccountCmekSettingsName(String billingAccount)', + DEPRECATION_JAVADOC.format(new_method='formatBillingAccountName(String)') + ) + + java.copy_and_rename_method('owl-bot-staging/v2/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java','public static String formatFolderName(String folder)', 'formatFolderName', 'formatFolderCmekSettingsName') + java.deprecate_method( + 'owl-bot-staging/v2/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java', + 'public static String formatFolderCmekSettingsName(String folder)', + DEPRECATION_JAVADOC.format(new_method='formatFolderName(String)') + ) + + java.copy_and_rename_method('owl-bot-staging/v2/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java','public static String formatOrganizationName(String organization)', 'formatOrganizationName', 'formatOrganizationCmekSettingsName') + java.deprecate_method('owl-bot-staging/v2/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java','public static String formatOrganizationCmekSettingsName(String organization)', DEPRECATION_JAVADOC.format(new_method='formatOrganizationName(String)')) + + java.copy_and_rename_method('owl-bot-staging/v2/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java','public static String formatProjectName(String project)', 'formatProjectName', 'formatProjectCmekSettingsName') + java.deprecate_method('owl-bot-staging/v2/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java','public static String formatProjectCmekSettingsName(String project)', DEPRECATION_JAVADOC.format(new_method='formatProjectName(String)')) + + java.copy_and_rename_method('owl-bot-staging/v2/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java','public static BillingAccountCmekSettingsBuilder newBillingAccountBuilder()', 'newBillingAccountBuilder', 'newBillingAccountCmekSettingsBuilder') + java.deprecate_method('owl-bot-staging/v2/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java','public static BillingAccountCmekSettingsBuilder newBillingAccountCmekSettingsBuilder()', DEPRECATION_JAVADOC.format(new_method='newBillingAccountBuilder()')) + s.replace('**/CmekSettingsName', 'return newBillingAccountBuilder', 'return newBillingAccountCmekSettingsBuilder' ) + + java.copy_and_rename_method('owl-bot-staging/v2/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java','public static FolderCmekSettingsBuilder newFolderBuilder()', 'newFolderBuilder', 'newFolderCmekSettingsBuilder') + java.deprecate_method('owl-bot-staging/v2/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java','public static FolderCmekSettingsBuilder newFolderCmekSettingsBuilder()', DEPRECATION_JAVADOC.format(new_method='newFolderBuilder()')) + s.replace('**/CmekSettingsName.java', 'return newFolderBuilder', 'return newFolderCmekSettingsBuilder') + + java.copy_and_rename_method('owl-bot-staging/v2/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java','public static OrganizationCmekSettingsBuilder newOrganizationBuilder()', 'newOrganizationBuilder', 'newOrganizationCmekSettingsBuilder') + java.deprecate_method('owl-bot-staging/v2/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java','public static OrganizationCmekSettingsBuilder newOrganizationCmekSettingsBuilder()', DEPRECATION_JAVADOC.format(new_method='newOrganizationBuilder()')) + s.replace('**/CmekSettingsName.java', 'return newOrganizationBuilder', 'return newOrganizationCmekSettingsBuilder') + + java.copy_and_rename_method('owl-bot-staging/v2/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java', 'public static Builder newProjectBuilder()', 'newProjectBuilder', 'newProjectCmekSettingsBuilder') + java.deprecate_method('owl-bot-staging/v2/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java','public static Builder newProjectCmekSettingsBuilder()', DEPRECATION_JAVADOC.format(new_method='newProjectBuilder()')) + + java.copy_and_rename_method('owl-bot-staging/v2/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java', 'public static CmekSettingsName ofBillingAccountName(String billingAccount)', 'ofBillingAccountName', 'ofBillingAccountCmekSettingsName') + java.deprecate_method('owl-bot-staging/v2/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java','public static CmekSettingsName ofBillingAccountCmekSettingsName(String billingAccount)', DEPRECATION_JAVADOC.format(new_method='ofBillingAccountName(String)')) + s.replace('**/CmekSettingsName.java', 'return ofBillingAccountName', 'return ofBillingAccountCmekSettingsName') + + java.copy_and_rename_method('owl-bot-staging/v2/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java','public static CmekSettingsName ofFolderName(String folder)', 'ofFolderName', 'ofFolderCmekSettingsName') + java.deprecate_method('owl-bot-staging/v2/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java','public static CmekSettingsName ofFolderCmekSettingsName(String folder)', DEPRECATION_JAVADOC.format(new_method='ofFolderName(String)')) + s.replace('**/CmekSettingsName.java', 'return ofFolderName', 'return ofFolderCmekSettingsName') + + java.copy_and_rename_method('owl-bot-staging/v2/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java', 'public static CmekSettingsName ofOrganizationName(String organization)', 'ofOrganizationName', 'ofOrganizationCmekSettingsName') + java.deprecate_method('owl-bot-staging/v2/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java','public static CmekSettingsName ofOrganizationCmekSettingsName(String organization)', DEPRECATION_JAVADOC.format(new_method='ofOrganizationName(String)')) + s.replace('**/CmekSettingsName.java', 'return ofOrganizationName', 'return ofOrganizationCmekSettingsName') + + java.copy_and_rename_method('owl-bot-staging/v2/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java', 'public static CmekSettingsName ofProjectName(String project)', 'ofProjectName', 'ofProjectCmekSettingsName') + java.deprecate_method('owl-bot-staging/v2/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java','public static CmekSettingsName ofProjectCmekSettingsName(String project)', DEPRECATION_JAVADOC.format(new_method='ofProjectName(String)')) + s.replace('**/CmekSettingsName.java', 'return ofProjectName', 'return ofProjectCmekSettingsName') + + s.replace('**/CmekSettingsName.java', 'BillingAccountBuilder', 'BillingAccountCmekSettingsBuilder') + s.replace('**/CmekSettingsName.java', 'FolderBuilder', 'FolderCmekSettingsBuilder') + s.replace('**/CmekSettingsName.java', 'OrganizationBuilder', 'OrganizationCmekSettingsBuilder') + s.replace('**/ConfigClientTest.java', 'CmekSettingsName.ofProjectName', 'CmekSettingsName.ofProjectCmekSettingsName') + + s.move(library) + +s.remove_staging_dirs() +java.common_templates( + excludes=[ + ".gitignore", + ".github/CODEOWNERS", + ".github/blunderbuss.yml", + "CONTRIBUTING.md", + ".kokoro/requirements.in", + ".kokoro/requirements.txt", + ".kokoro/presubmit/graalvm-native.cfg", + ".kokoro/presubmit/graalvm-native-17.cfg" + ] +) + +# -------------------------------------------------------------------------- +# Modify test configs +# -------------------------------------------------------------------------- + +def _append_if_not_contained(src: str, dest: str, file: str): + if src in dest: + return dest + return f"{dest}\n{src}" + +def append_new_content(src: str, dest: str): + # add shared environment variables to test configs + s.move( + src, + dest, + merge=_append_if_not_contained, +) + +append_new_content(".kokoro/common_env_vars.cfg", ".kokoro/common.cfg") + +tracked_subdirs = ["continuous", "presubmit", "release", "nightly"] +for subdir in tracked_subdirs: + for path, subdirs, files in os.walk(f".kokoro/{subdir}"): + for name in files: + if name == "common.cfg": + file_path = os.path.join(path, name) + append_new_content(".kokoro/common_env_vars.cfg", file_path) \ No newline at end of file diff --git a/java-logging/pom.xml b/java-logging/pom.xml new file mode 100644 index 000000000000..0747316a7ac7 --- /dev/null +++ b/java-logging/pom.xml @@ -0,0 +1,103 @@ + + + 4.0.0 + com.google.cloud + google-cloud-logging-parent + pom + 3.23.10-SNAPSHOT + Google Cloud Logging Parent + https://github.com/googleapis/java-logging + + Java idiomatic client for Google Cloud Platform services. + + + + com.google.cloud + google-cloud-jar-parent + 1.76.0-SNAPSHOT + ../google-cloud-jar-parent/pom.xml + + + + + chingor + Jeff Ching + chingor@google.com + Google + + Developer + + + + + Google LLC + + + scm:git:git@github.com:googleapis/java-logging.git + scm:git:git@github.com:googleapis/java-logging.git + https://github.com/googleapis/java-logging + HEAD + + + https://github.com/googleapis/java-logging/issues + GitHub Issues + + + + + Apache-2.0 + https://www.apache.org/licenses/LICENSE-2.0.txt + + + + + UTF-8 + UTF-8 + github + google-cloud-logging-parent + + + + + + + com.google.api.grpc + proto-google-cloud-logging-v2 + 0.112.10-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-logging-v2 + 0.112.10-SNAPSHOT + + + com.google.cloud + google-cloud-logging + 3.23.10-SNAPSHOT + + + + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + org.objenesis:objenesis + + + + + + + + google-cloud-logging + grpc-google-cloud-logging-v2 + proto-google-cloud-logging-v2 + google-cloud-logging-bom + + + diff --git a/java-logging/proto-google-cloud-logging-v2/clirr-ignored-differences.xml b/java-logging/proto-google-cloud-logging-v2/clirr-ignored-differences.xml new file mode 100644 index 000000000000..ea753044d924 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/clirr-ignored-differences.xml @@ -0,0 +1,81 @@ + + + + + 7012 + com/google/logging/v2/*OrBuilder + * get*(*) + + + 7012 + com/google/logging/v2/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/logging/v2/*OrBuilder + boolean has*(*) + + + + + 7006 + com/google/logging/v2/** + * getDefaultInstanceForType() + ** + + + 7006 + com/google/logging/v2/** + * addRepeatedField(*) + ** + + + 7006 + com/google/logging/v2/** + * clear() + ** + + + 7006 + com/google/logging/v2/** + * clearField(*) + ** + + + 7006 + com/google/logging/v2/** + * clearOneof(*) + ** + + + 7006 + com/google/logging/v2/** + * clone() + ** + + + 7006 + com/google/logging/v2/** + * mergeUnknownFields(*) + ** + + + 7006 + com/google/logging/v2/** + * setField(*) + ** + + + 7006 + com/google/logging/v2/** + * setRepeatedField(*) + ** + + + 7006 + com/google/logging/v2/** + * setUnknownFields(*) + ** + + diff --git a/java-logging/proto-google-cloud-logging-v2/pom.xml b/java-logging/proto-google-cloud-logging-v2/pom.xml new file mode 100644 index 000000000000..96ec009324f6 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/pom.xml @@ -0,0 +1,42 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-logging-v2 + 0.112.10-SNAPSHOT + proto-google-cloud-logging-v2 + PROTO library for proto-google-cloud-logging-v2 + + com.google.cloud + google-cloud-logging-parent + 3.23.10-SNAPSHOT + + + + com.google.guava + guava + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api + api-common + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + \ No newline at end of file diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/BigQueryDataset.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/BigQueryDataset.java new file mode 100644 index 000000000000..585489e6f110 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/BigQueryDataset.java @@ -0,0 +1,673 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * Describes a BigQuery dataset that was created by a link.
+ * 
+ * + * Protobuf type {@code google.logging.v2.BigQueryDataset} + */ +public final class BigQueryDataset extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.BigQueryDataset) + BigQueryDatasetOrBuilder { + private static final long serialVersionUID = 0L; + + // Use BigQueryDataset.newBuilder() to construct. + private BigQueryDataset(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BigQueryDataset() { + datasetId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BigQueryDataset(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_BigQueryDataset_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_BigQueryDataset_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.BigQueryDataset.class, + com.google.logging.v2.BigQueryDataset.Builder.class); + } + + public static final int DATASET_ID_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object datasetId_ = ""; + + /** + * + * + *
+   * Output only. The full resource name of the BigQuery dataset. The DATASET_ID
+   * will match the ID of the link, so the link must match the naming
+   * restrictions of BigQuery datasets (alphanumeric characters and underscores
+   * only).
+   *
+   * The dataset will have a resource path of
+   *   "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET_ID]"
+   * 
+ * + * string dataset_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The datasetId. + */ + @java.lang.Override + public java.lang.String getDatasetId() { + java.lang.Object ref = datasetId_; + 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(); + datasetId_ = s; + return s; + } + } + + /** + * + * + *
+   * Output only. The full resource name of the BigQuery dataset. The DATASET_ID
+   * will match the ID of the link, so the link must match the naming
+   * restrictions of BigQuery datasets (alphanumeric characters and underscores
+   * only).
+   *
+   * The dataset will have a resource path of
+   *   "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET_ID]"
+   * 
+ * + * string dataset_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for datasetId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDatasetIdBytes() { + java.lang.Object ref = datasetId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + datasetId_ = 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(datasetId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, datasetId_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(datasetId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, datasetId_); + } + size += getUnknownFields().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.logging.v2.BigQueryDataset)) { + return super.equals(obj); + } + com.google.logging.v2.BigQueryDataset other = (com.google.logging.v2.BigQueryDataset) obj; + + if (!getDatasetId().equals(other.getDatasetId())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + DATASET_ID_FIELD_NUMBER; + hash = (53 * hash) + getDatasetId().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.BigQueryDataset parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.BigQueryDataset parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.BigQueryDataset parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.BigQueryDataset 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.logging.v2.BigQueryDataset parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.BigQueryDataset parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.BigQueryDataset parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.BigQueryDataset 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.logging.v2.BigQueryDataset parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.BigQueryDataset 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.logging.v2.BigQueryDataset parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.BigQueryDataset 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.logging.v2.BigQueryDataset 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; + } + + /** + * + * + *
+   * Describes a BigQuery dataset that was created by a link.
+   * 
+ * + * Protobuf type {@code google.logging.v2.BigQueryDataset} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.BigQueryDataset) + com.google.logging.v2.BigQueryDatasetOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_BigQueryDataset_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_BigQueryDataset_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.BigQueryDataset.class, + com.google.logging.v2.BigQueryDataset.Builder.class); + } + + // Construct using com.google.logging.v2.BigQueryDataset.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + datasetId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_BigQueryDataset_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.BigQueryDataset getDefaultInstanceForType() { + return com.google.logging.v2.BigQueryDataset.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.BigQueryDataset build() { + com.google.logging.v2.BigQueryDataset result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.BigQueryDataset buildPartial() { + com.google.logging.v2.BigQueryDataset result = + new com.google.logging.v2.BigQueryDataset(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.logging.v2.BigQueryDataset result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.datasetId_ = datasetId_; + } + } + + @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.logging.v2.BigQueryDataset) { + return mergeFrom((com.google.logging.v2.BigQueryDataset) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.BigQueryDataset other) { + if (other == com.google.logging.v2.BigQueryDataset.getDefaultInstance()) return this; + if (!other.getDatasetId().isEmpty()) { + datasetId_ = other.datasetId_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + datasetId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object datasetId_ = ""; + + /** + * + * + *
+     * Output only. The full resource name of the BigQuery dataset. The DATASET_ID
+     * will match the ID of the link, so the link must match the naming
+     * restrictions of BigQuery datasets (alphanumeric characters and underscores
+     * only).
+     *
+     * The dataset will have a resource path of
+     *   "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET_ID]"
+     * 
+ * + * string dataset_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The datasetId. + */ + public java.lang.String getDatasetId() { + java.lang.Object ref = datasetId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + datasetId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Output only. The full resource name of the BigQuery dataset. The DATASET_ID
+     * will match the ID of the link, so the link must match the naming
+     * restrictions of BigQuery datasets (alphanumeric characters and underscores
+     * only).
+     *
+     * The dataset will have a resource path of
+     *   "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET_ID]"
+     * 
+ * + * string dataset_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for datasetId. + */ + public com.google.protobuf.ByteString getDatasetIdBytes() { + java.lang.Object ref = datasetId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + datasetId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Output only. The full resource name of the BigQuery dataset. The DATASET_ID
+     * will match the ID of the link, so the link must match the naming
+     * restrictions of BigQuery datasets (alphanumeric characters and underscores
+     * only).
+     *
+     * The dataset will have a resource path of
+     *   "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET_ID]"
+     * 
+ * + * string dataset_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The datasetId to set. + * @return This builder for chaining. + */ + public Builder setDatasetId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + datasetId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The full resource name of the BigQuery dataset. The DATASET_ID
+     * will match the ID of the link, so the link must match the naming
+     * restrictions of BigQuery datasets (alphanumeric characters and underscores
+     * only).
+     *
+     * The dataset will have a resource path of
+     *   "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET_ID]"
+     * 
+ * + * string dataset_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearDatasetId() { + datasetId_ = getDefaultInstance().getDatasetId(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The full resource name of the BigQuery dataset. The DATASET_ID
+     * will match the ID of the link, so the link must match the naming
+     * restrictions of BigQuery datasets (alphanumeric characters and underscores
+     * only).
+     *
+     * The dataset will have a resource path of
+     *   "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET_ID]"
+     * 
+ * + * string dataset_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for datasetId to set. + * @return This builder for chaining. + */ + public Builder setDatasetIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + datasetId_ = value; + 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.logging.v2.BigQueryDataset) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.BigQueryDataset) + private static final com.google.logging.v2.BigQueryDataset DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.BigQueryDataset(); + } + + public static com.google.logging.v2.BigQueryDataset getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BigQueryDataset parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.BigQueryDataset getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/BigQueryDatasetOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/BigQueryDatasetOrBuilder.java new file mode 100644 index 000000000000..74e807c5e8e6 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/BigQueryDatasetOrBuilder.java @@ -0,0 +1,64 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface BigQueryDatasetOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.BigQueryDataset) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The full resource name of the BigQuery dataset. The DATASET_ID
+   * will match the ID of the link, so the link must match the naming
+   * restrictions of BigQuery datasets (alphanumeric characters and underscores
+   * only).
+   *
+   * The dataset will have a resource path of
+   *   "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET_ID]"
+   * 
+ * + * string dataset_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The datasetId. + */ + java.lang.String getDatasetId(); + + /** + * + * + *
+   * Output only. The full resource name of the BigQuery dataset. The DATASET_ID
+   * will match the ID of the link, so the link must match the naming
+   * restrictions of BigQuery datasets (alphanumeric characters and underscores
+   * only).
+   *
+   * The dataset will have a resource path of
+   *   "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET_ID]"
+   * 
+ * + * string dataset_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for datasetId. + */ + com.google.protobuf.ByteString getDatasetIdBytes(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/BigQueryOptions.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/BigQueryOptions.java new file mode 100644 index 000000000000..58b38a994cb1 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/BigQueryOptions.java @@ -0,0 +1,699 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * Options that change functionality of a sink exporting data to BigQuery.
+ * 
+ * + * Protobuf type {@code google.logging.v2.BigQueryOptions} + */ +public final class BigQueryOptions extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.BigQueryOptions) + BigQueryOptionsOrBuilder { + private static final long serialVersionUID = 0L; + + // Use BigQueryOptions.newBuilder() to construct. + private BigQueryOptions(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BigQueryOptions() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BigQueryOptions(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_BigQueryOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_BigQueryOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.BigQueryOptions.class, + com.google.logging.v2.BigQueryOptions.Builder.class); + } + + public static final int USE_PARTITIONED_TABLES_FIELD_NUMBER = 1; + private boolean usePartitionedTables_ = false; + + /** + * + * + *
+   * Optional. Whether to use [BigQuery's partition
+   * tables](https://cloud.google.com/bigquery/docs/partitioned-tables). By
+   * default, Cloud Logging creates dated tables based on the log entries'
+   * timestamps, e.g. syslog_20170523. With partitioned tables the date suffix
+   * is no longer present and [special query
+   * syntax](https://cloud.google.com/bigquery/docs/querying-partitioned-tables)
+   * has to be used instead. In both cases, tables are sharded based on UTC
+   * timezone.
+   * 
+ * + * bool use_partitioned_tables = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The usePartitionedTables. + */ + @java.lang.Override + public boolean getUsePartitionedTables() { + return usePartitionedTables_; + } + + public static final int USES_TIMESTAMP_COLUMN_PARTITIONING_FIELD_NUMBER = 3; + private boolean usesTimestampColumnPartitioning_ = false; + + /** + * + * + *
+   * Output only. True if new timestamp column based partitioning is in use,
+   * false if legacy ingestion-time partitioning is in use.
+   *
+   * All new sinks will have this field set true and will use timestamp column
+   * based partitioning. If use_partitioned_tables is false, this value has no
+   * meaning and will be false. Legacy sinks using partitioned tables will have
+   * this field set to false.
+   * 
+ * + * bool uses_timestamp_column_partitioning = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The usesTimestampColumnPartitioning. + */ + @java.lang.Override + public boolean getUsesTimestampColumnPartitioning() { + return usesTimestampColumnPartitioning_; + } + + 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 (usePartitionedTables_ != false) { + output.writeBool(1, usePartitionedTables_); + } + if (usesTimestampColumnPartitioning_ != false) { + output.writeBool(3, usesTimestampColumnPartitioning_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (usePartitionedTables_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, usePartitionedTables_); + } + if (usesTimestampColumnPartitioning_ != false) { + size += + com.google.protobuf.CodedOutputStream.computeBoolSize( + 3, usesTimestampColumnPartitioning_); + } + size += getUnknownFields().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.logging.v2.BigQueryOptions)) { + return super.equals(obj); + } + com.google.logging.v2.BigQueryOptions other = (com.google.logging.v2.BigQueryOptions) obj; + + if (getUsePartitionedTables() != other.getUsePartitionedTables()) return false; + if (getUsesTimestampColumnPartitioning() != other.getUsesTimestampColumnPartitioning()) + return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + USE_PARTITIONED_TABLES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getUsePartitionedTables()); + hash = (37 * hash) + USES_TIMESTAMP_COLUMN_PARTITIONING_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashBoolean(getUsesTimestampColumnPartitioning()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.BigQueryOptions parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.BigQueryOptions parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.BigQueryOptions parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.BigQueryOptions 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.logging.v2.BigQueryOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.BigQueryOptions parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.BigQueryOptions parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.BigQueryOptions 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.logging.v2.BigQueryOptions parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.BigQueryOptions 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.logging.v2.BigQueryOptions parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.BigQueryOptions 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.logging.v2.BigQueryOptions 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; + } + + /** + * + * + *
+   * Options that change functionality of a sink exporting data to BigQuery.
+   * 
+ * + * Protobuf type {@code google.logging.v2.BigQueryOptions} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.BigQueryOptions) + com.google.logging.v2.BigQueryOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_BigQueryOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_BigQueryOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.BigQueryOptions.class, + com.google.logging.v2.BigQueryOptions.Builder.class); + } + + // Construct using com.google.logging.v2.BigQueryOptions.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + usePartitionedTables_ = false; + usesTimestampColumnPartitioning_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_BigQueryOptions_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.BigQueryOptions getDefaultInstanceForType() { + return com.google.logging.v2.BigQueryOptions.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.BigQueryOptions build() { + com.google.logging.v2.BigQueryOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.BigQueryOptions buildPartial() { + com.google.logging.v2.BigQueryOptions result = + new com.google.logging.v2.BigQueryOptions(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.logging.v2.BigQueryOptions result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.usePartitionedTables_ = usePartitionedTables_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.usesTimestampColumnPartitioning_ = usesTimestampColumnPartitioning_; + } + } + + @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.logging.v2.BigQueryOptions) { + return mergeFrom((com.google.logging.v2.BigQueryOptions) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.BigQueryOptions other) { + if (other == com.google.logging.v2.BigQueryOptions.getDefaultInstance()) return this; + if (other.getUsePartitionedTables() != false) { + setUsePartitionedTables(other.getUsePartitionedTables()); + } + if (other.getUsesTimestampColumnPartitioning() != false) { + setUsesTimestampColumnPartitioning(other.getUsesTimestampColumnPartitioning()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + usePartitionedTables_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 24: + { + usesTimestampColumnPartitioning_ = input.readBool(); + bitField0_ |= 0x00000002; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private boolean usePartitionedTables_; + + /** + * + * + *
+     * Optional. Whether to use [BigQuery's partition
+     * tables](https://cloud.google.com/bigquery/docs/partitioned-tables). By
+     * default, Cloud Logging creates dated tables based on the log entries'
+     * timestamps, e.g. syslog_20170523. With partitioned tables the date suffix
+     * is no longer present and [special query
+     * syntax](https://cloud.google.com/bigquery/docs/querying-partitioned-tables)
+     * has to be used instead. In both cases, tables are sharded based on UTC
+     * timezone.
+     * 
+ * + * bool use_partitioned_tables = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The usePartitionedTables. + */ + @java.lang.Override + public boolean getUsePartitionedTables() { + return usePartitionedTables_; + } + + /** + * + * + *
+     * Optional. Whether to use [BigQuery's partition
+     * tables](https://cloud.google.com/bigquery/docs/partitioned-tables). By
+     * default, Cloud Logging creates dated tables based on the log entries'
+     * timestamps, e.g. syslog_20170523. With partitioned tables the date suffix
+     * is no longer present and [special query
+     * syntax](https://cloud.google.com/bigquery/docs/querying-partitioned-tables)
+     * has to be used instead. In both cases, tables are sharded based on UTC
+     * timezone.
+     * 
+ * + * bool use_partitioned_tables = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The usePartitionedTables to set. + * @return This builder for chaining. + */ + public Builder setUsePartitionedTables(boolean value) { + + usePartitionedTables_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Whether to use [BigQuery's partition
+     * tables](https://cloud.google.com/bigquery/docs/partitioned-tables). By
+     * default, Cloud Logging creates dated tables based on the log entries'
+     * timestamps, e.g. syslog_20170523. With partitioned tables the date suffix
+     * is no longer present and [special query
+     * syntax](https://cloud.google.com/bigquery/docs/querying-partitioned-tables)
+     * has to be used instead. In both cases, tables are sharded based on UTC
+     * timezone.
+     * 
+ * + * bool use_partitioned_tables = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearUsePartitionedTables() { + bitField0_ = (bitField0_ & ~0x00000001); + usePartitionedTables_ = false; + onChanged(); + return this; + } + + private boolean usesTimestampColumnPartitioning_; + + /** + * + * + *
+     * Output only. True if new timestamp column based partitioning is in use,
+     * false if legacy ingestion-time partitioning is in use.
+     *
+     * All new sinks will have this field set true and will use timestamp column
+     * based partitioning. If use_partitioned_tables is false, this value has no
+     * meaning and will be false. Legacy sinks using partitioned tables will have
+     * this field set to false.
+     * 
+ * + * + * bool uses_timestamp_column_partitioning = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The usesTimestampColumnPartitioning. + */ + @java.lang.Override + public boolean getUsesTimestampColumnPartitioning() { + return usesTimestampColumnPartitioning_; + } + + /** + * + * + *
+     * Output only. True if new timestamp column based partitioning is in use,
+     * false if legacy ingestion-time partitioning is in use.
+     *
+     * All new sinks will have this field set true and will use timestamp column
+     * based partitioning. If use_partitioned_tables is false, this value has no
+     * meaning and will be false. Legacy sinks using partitioned tables will have
+     * this field set to false.
+     * 
+ * + * + * bool uses_timestamp_column_partitioning = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The usesTimestampColumnPartitioning to set. + * @return This builder for chaining. + */ + public Builder setUsesTimestampColumnPartitioning(boolean value) { + + usesTimestampColumnPartitioning_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. True if new timestamp column based partitioning is in use,
+     * false if legacy ingestion-time partitioning is in use.
+     *
+     * All new sinks will have this field set true and will use timestamp column
+     * based partitioning. If use_partitioned_tables is false, this value has no
+     * meaning and will be false. Legacy sinks using partitioned tables will have
+     * this field set to false.
+     * 
+ * + * + * bool uses_timestamp_column_partitioning = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearUsesTimestampColumnPartitioning() { + bitField0_ = (bitField0_ & ~0x00000002); + usesTimestampColumnPartitioning_ = 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.logging.v2.BigQueryOptions) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.BigQueryOptions) + private static final com.google.logging.v2.BigQueryOptions DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.BigQueryOptions(); + } + + public static com.google.logging.v2.BigQueryOptions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BigQueryOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.BigQueryOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/BigQueryOptionsOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/BigQueryOptionsOrBuilder.java new file mode 100644 index 000000000000..e9cd03d9e87a --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/BigQueryOptionsOrBuilder.java @@ -0,0 +1,66 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface BigQueryOptionsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.BigQueryOptions) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. Whether to use [BigQuery's partition
+   * tables](https://cloud.google.com/bigquery/docs/partitioned-tables). By
+   * default, Cloud Logging creates dated tables based on the log entries'
+   * timestamps, e.g. syslog_20170523. With partitioned tables the date suffix
+   * is no longer present and [special query
+   * syntax](https://cloud.google.com/bigquery/docs/querying-partitioned-tables)
+   * has to be used instead. In both cases, tables are sharded based on UTC
+   * timezone.
+   * 
+ * + * bool use_partitioned_tables = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The usePartitionedTables. + */ + boolean getUsePartitionedTables(); + + /** + * + * + *
+   * Output only. True if new timestamp column based partitioning is in use,
+   * false if legacy ingestion-time partitioning is in use.
+   *
+   * All new sinks will have this field set true and will use timestamp column
+   * based partitioning. If use_partitioned_tables is false, this value has no
+   * meaning and will be false. Legacy sinks using partitioned tables will have
+   * this field set to false.
+   * 
+ * + * bool uses_timestamp_column_partitioning = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The usesTimestampColumnPartitioning. + */ + boolean getUsesTimestampColumnPartitioning(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/BillingAccountLocationName.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/BillingAccountLocationName.java new file mode 100644 index 000000000000..4ced3ee80342 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/BillingAccountLocationName.java @@ -0,0 +1,195 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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.logging.v2; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class BillingAccountLocationName implements ResourceName { + private static final PathTemplate BILLING_ACCOUNT_LOCATION = + PathTemplate.createWithoutUrlEncoding( + "billingAccounts/{billing_account}/locations/{location}"); + private volatile Map fieldValuesMap; + private final String billingAccount; + private final String location; + + @Deprecated + protected BillingAccountLocationName() { + billingAccount = null; + location = null; + } + + private BillingAccountLocationName(Builder builder) { + billingAccount = Preconditions.checkNotNull(builder.getBillingAccount()); + location = Preconditions.checkNotNull(builder.getLocation()); + } + + public String getBillingAccount() { + return billingAccount; + } + + public String getLocation() { + return location; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static BillingAccountLocationName of(String billingAccount, String location) { + return newBuilder().setBillingAccount(billingAccount).setLocation(location).build(); + } + + public static String format(String billingAccount, String location) { + return newBuilder().setBillingAccount(billingAccount).setLocation(location).build().toString(); + } + + public static BillingAccountLocationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + BILLING_ACCOUNT_LOCATION.validatedMatch( + formattedString, + "BillingAccountLocationName.parse: formattedString not in valid format"); + return of(matchMap.get("billing_account"), matchMap.get("location")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (BillingAccountLocationName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return BILLING_ACCOUNT_LOCATION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (billingAccount != null) { + fieldMapBuilder.put("billing_account", billingAccount); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return BILLING_ACCOUNT_LOCATION.instantiate( + "billing_account", billingAccount, "location", location); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + BillingAccountLocationName that = ((BillingAccountLocationName) o); + return Objects.equals(this.billingAccount, that.billingAccount) + && Objects.equals(this.location, that.location); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(billingAccount); + h *= 1000003; + h ^= Objects.hashCode(location); + return h; + } + + /** Builder for billingAccounts/{billing_account}/locations/{location}. */ + public static class Builder { + private String billingAccount; + private String location; + + protected Builder() {} + + public String getBillingAccount() { + return billingAccount; + } + + public String getLocation() { + return location; + } + + public Builder setBillingAccount(String billingAccount) { + this.billingAccount = billingAccount; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + private Builder(BillingAccountLocationName billingAccountLocationName) { + this.billingAccount = billingAccountLocationName.billingAccount; + this.location = billingAccountLocationName.location; + } + + public BillingAccountLocationName build() { + return new BillingAccountLocationName(this); + } + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/BillingAccountName.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/BillingAccountName.java new file mode 100644 index 000000000000..39901d9517f0 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/BillingAccountName.java @@ -0,0 +1,168 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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.logging.v2; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class BillingAccountName implements ResourceName { + private static final PathTemplate BILLING_ACCOUNT = + PathTemplate.createWithoutUrlEncoding("billingAccounts/{billing_account}"); + private volatile Map fieldValuesMap; + private final String billingAccount; + + @Deprecated + protected BillingAccountName() { + billingAccount = null; + } + + private BillingAccountName(Builder builder) { + billingAccount = Preconditions.checkNotNull(builder.getBillingAccount()); + } + + public String getBillingAccount() { + return billingAccount; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static BillingAccountName of(String billingAccount) { + return newBuilder().setBillingAccount(billingAccount).build(); + } + + public static String format(String billingAccount) { + return newBuilder().setBillingAccount(billingAccount).build().toString(); + } + + public static BillingAccountName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + BILLING_ACCOUNT.validatedMatch( + formattedString, "BillingAccountName.parse: formattedString not in valid format"); + return of(matchMap.get("billing_account")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (BillingAccountName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return BILLING_ACCOUNT.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (billingAccount != null) { + fieldMapBuilder.put("billing_account", billingAccount); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return BILLING_ACCOUNT.instantiate("billing_account", billingAccount); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + BillingAccountName that = ((BillingAccountName) o); + return Objects.equals(this.billingAccount, that.billingAccount); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(billingAccount); + return h; + } + + /** Builder for billingAccounts/{billing_account}. */ + public static class Builder { + private String billingAccount; + + protected Builder() {} + + public String getBillingAccount() { + return billingAccount; + } + + public Builder setBillingAccount(String billingAccount) { + this.billingAccount = billingAccount; + return this; + } + + private Builder(BillingAccountName billingAccountName) { + this.billingAccount = billingAccountName.billingAccount; + } + + public BillingAccountName build() { + return new BillingAccountName(this); + } + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/BucketMetadata.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/BucketMetadata.java new file mode 100644 index 000000000000..4120fa1c9afa --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/BucketMetadata.java @@ -0,0 +1,1848 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * Metadata for LongRunningUpdateBucket Operations.
+ * 
+ * + * Protobuf type {@code google.logging.v2.BucketMetadata} + */ +public final class BucketMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.BucketMetadata) + BucketMetadataOrBuilder { + private static final long serialVersionUID = 0L; + + // Use BucketMetadata.newBuilder() to construct. + private BucketMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BucketMetadata() { + state_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BucketMetadata(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_BucketMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_BucketMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.BucketMetadata.class, + com.google.logging.v2.BucketMetadata.Builder.class); + } + + private int bitField0_; + private int requestCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object request_; + + public enum RequestCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + CREATE_BUCKET_REQUEST(4), + UPDATE_BUCKET_REQUEST(5), + REQUEST_NOT_SET(0); + private final int value; + + private RequestCase(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 RequestCase valueOf(int value) { + return forNumber(value); + } + + public static RequestCase forNumber(int value) { + switch (value) { + case 4: + return CREATE_BUCKET_REQUEST; + case 5: + return UPDATE_BUCKET_REQUEST; + case 0: + return REQUEST_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public RequestCase getRequestCase() { + return RequestCase.forNumber(requestCase_); + } + + public static final int START_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp startTime_; + + /** + * + * + *
+   * The create time of an operation.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return Whether the startTime field is set. + */ + @java.lang.Override + public boolean hasStartTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The create time of an operation.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return The startTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getStartTime() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + + /** + * + * + *
+   * The create time of an operation.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + + public static final int END_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp endTime_; + + /** + * + * + *
+   * The end time of an operation.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * The end time of an operation.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + /** + * + * + *
+   * The end time of an operation.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + public static final int STATE_FIELD_NUMBER = 3; + private int state_ = 0; + + /** + * + * + *
+   * State of an operation.
+   * 
+ * + * .google.logging.v2.OperationState state = 3; + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + + /** + * + * + *
+   * State of an operation.
+   * 
+ * + * .google.logging.v2.OperationState state = 3; + * + * @return The state. + */ + @java.lang.Override + public com.google.logging.v2.OperationState getState() { + com.google.logging.v2.OperationState result = + com.google.logging.v2.OperationState.forNumber(state_); + return result == null ? com.google.logging.v2.OperationState.UNRECOGNIZED : result; + } + + public static final int CREATE_BUCKET_REQUEST_FIELD_NUMBER = 4; + + /** + * + * + *
+   * LongRunningCreateBucket RPC request.
+   * 
+ * + * .google.logging.v2.CreateBucketRequest create_bucket_request = 4; + * + * @return Whether the createBucketRequest field is set. + */ + @java.lang.Override + public boolean hasCreateBucketRequest() { + return requestCase_ == 4; + } + + /** + * + * + *
+   * LongRunningCreateBucket RPC request.
+   * 
+ * + * .google.logging.v2.CreateBucketRequest create_bucket_request = 4; + * + * @return The createBucketRequest. + */ + @java.lang.Override + public com.google.logging.v2.CreateBucketRequest getCreateBucketRequest() { + if (requestCase_ == 4) { + return (com.google.logging.v2.CreateBucketRequest) request_; + } + return com.google.logging.v2.CreateBucketRequest.getDefaultInstance(); + } + + /** + * + * + *
+   * LongRunningCreateBucket RPC request.
+   * 
+ * + * .google.logging.v2.CreateBucketRequest create_bucket_request = 4; + */ + @java.lang.Override + public com.google.logging.v2.CreateBucketRequestOrBuilder getCreateBucketRequestOrBuilder() { + if (requestCase_ == 4) { + return (com.google.logging.v2.CreateBucketRequest) request_; + } + return com.google.logging.v2.CreateBucketRequest.getDefaultInstance(); + } + + public static final int UPDATE_BUCKET_REQUEST_FIELD_NUMBER = 5; + + /** + * + * + *
+   * LongRunningUpdateBucket RPC request.
+   * 
+ * + * .google.logging.v2.UpdateBucketRequest update_bucket_request = 5; + * + * @return Whether the updateBucketRequest field is set. + */ + @java.lang.Override + public boolean hasUpdateBucketRequest() { + return requestCase_ == 5; + } + + /** + * + * + *
+   * LongRunningUpdateBucket RPC request.
+   * 
+ * + * .google.logging.v2.UpdateBucketRequest update_bucket_request = 5; + * + * @return The updateBucketRequest. + */ + @java.lang.Override + public com.google.logging.v2.UpdateBucketRequest getUpdateBucketRequest() { + if (requestCase_ == 5) { + return (com.google.logging.v2.UpdateBucketRequest) request_; + } + return com.google.logging.v2.UpdateBucketRequest.getDefaultInstance(); + } + + /** + * + * + *
+   * LongRunningUpdateBucket RPC request.
+   * 
+ * + * .google.logging.v2.UpdateBucketRequest update_bucket_request = 5; + */ + @java.lang.Override + public com.google.logging.v2.UpdateBucketRequestOrBuilder getUpdateBucketRequestOrBuilder() { + if (requestCase_ == 5) { + return (com.google.logging.v2.UpdateBucketRequest) request_; + } + return com.google.logging.v2.UpdateBucketRequest.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getStartTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getEndTime()); + } + if (state_ != com.google.logging.v2.OperationState.OPERATION_STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(3, state_); + } + if (requestCase_ == 4) { + output.writeMessage(4, (com.google.logging.v2.CreateBucketRequest) request_); + } + if (requestCase_ == 5) { + output.writeMessage(5, (com.google.logging.v2.UpdateBucketRequest) request_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getStartTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getEndTime()); + } + if (state_ != com.google.logging.v2.OperationState.OPERATION_STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, state_); + } + if (requestCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.logging.v2.CreateBucketRequest) request_); + } + if (requestCase_ == 5) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 5, (com.google.logging.v2.UpdateBucketRequest) request_); + } + size += getUnknownFields().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.logging.v2.BucketMetadata)) { + return super.equals(obj); + } + com.google.logging.v2.BucketMetadata other = (com.google.logging.v2.BucketMetadata) obj; + + 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 (state_ != other.state_) return false; + if (!getRequestCase().equals(other.getRequestCase())) return false; + switch (requestCase_) { + case 4: + if (!getCreateBucketRequest().equals(other.getCreateBucketRequest())) return false; + break; + case 5: + if (!getUpdateBucketRequest().equals(other.getUpdateBucketRequest())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().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(); + } + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + switch (requestCase_) { + case 4: + hash = (37 * hash) + CREATE_BUCKET_REQUEST_FIELD_NUMBER; + hash = (53 * hash) + getCreateBucketRequest().hashCode(); + break; + case 5: + hash = (37 * hash) + UPDATE_BUCKET_REQUEST_FIELD_NUMBER; + hash = (53 * hash) + getUpdateBucketRequest().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.BucketMetadata parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.BucketMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.BucketMetadata parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.BucketMetadata 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.logging.v2.BucketMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.BucketMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.BucketMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.BucketMetadata 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.logging.v2.BucketMetadata parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.BucketMetadata 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.logging.v2.BucketMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.BucketMetadata 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.logging.v2.BucketMetadata 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; + } + + /** + * + * + *
+   * Metadata for LongRunningUpdateBucket Operations.
+   * 
+ * + * Protobuf type {@code google.logging.v2.BucketMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.BucketMetadata) + com.google.logging.v2.BucketMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_BucketMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_BucketMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.BucketMetadata.class, + com.google.logging.v2.BucketMetadata.Builder.class); + } + + // Construct using com.google.logging.v2.BucketMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getStartTimeFieldBuilder(); + getEndTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + state_ = 0; + if (createBucketRequestBuilder_ != null) { + createBucketRequestBuilder_.clear(); + } + if (updateBucketRequestBuilder_ != null) { + updateBucketRequestBuilder_.clear(); + } + requestCase_ = 0; + request_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_BucketMetadata_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.BucketMetadata getDefaultInstanceForType() { + return com.google.logging.v2.BucketMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.BucketMetadata build() { + com.google.logging.v2.BucketMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.BucketMetadata buildPartial() { + com.google.logging.v2.BucketMetadata result = new com.google.logging.v2.BucketMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.logging.v2.BucketMetadata result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.startTime_ = startTimeBuilder_ == null ? startTime_ : startTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.endTime_ = endTimeBuilder_ == null ? endTime_ : endTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.state_ = state_; + } + result.bitField0_ |= to_bitField0_; + } + + private void buildPartialOneofs(com.google.logging.v2.BucketMetadata result) { + result.requestCase_ = requestCase_; + result.request_ = this.request_; + if (requestCase_ == 4 && createBucketRequestBuilder_ != null) { + result.request_ = createBucketRequestBuilder_.build(); + } + if (requestCase_ == 5 && updateBucketRequestBuilder_ != null) { + result.request_ = updateBucketRequestBuilder_.build(); + } + } + + @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.logging.v2.BucketMetadata) { + return mergeFrom((com.google.logging.v2.BucketMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.BucketMetadata other) { + if (other == com.google.logging.v2.BucketMetadata.getDefaultInstance()) return this; + if (other.hasStartTime()) { + mergeStartTime(other.getStartTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + switch (other.getRequestCase()) { + case CREATE_BUCKET_REQUEST: + { + mergeCreateBucketRequest(other.getCreateBucketRequest()); + break; + } + case UPDATE_BUCKET_REQUEST: + { + mergeUpdateBucketRequest(other.getUpdateBucketRequest()); + break; + } + case REQUEST_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getStartTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getEndTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + state_ = input.readEnum(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: + { + input.readMessage( + getCreateBucketRequestFieldBuilder().getBuilder(), extensionRegistry); + requestCase_ = 4; + break; + } // case 34 + case 42: + { + input.readMessage( + getUpdateBucketRequestFieldBuilder().getBuilder(), extensionRegistry); + requestCase_ = 5; + break; + } // case 42 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int requestCase_ = 0; + private java.lang.Object request_; + + public RequestCase getRequestCase() { + return RequestCase.forNumber(requestCase_); + } + + public Builder clearRequest() { + requestCase_ = 0; + request_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + 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 create time of an operation.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return Whether the startTime field is set. + */ + public boolean hasStartTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The create time of an operation.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @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 create time of an operation.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public Builder setStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTime_ = value; + } else { + startTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The create time of an operation.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (startTimeBuilder_ == null) { + startTime_ = builderForValue.build(); + } else { + startTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The create time of an operation.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public Builder mergeStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && startTime_ != null + && startTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getStartTimeBuilder().mergeFrom(value); + } else { + startTime_ = value; + } + } else { + startTimeBuilder_.mergeFrom(value); + } + if (startTime_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The create time of an operation.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public Builder clearStartTime() { + bitField0_ = (bitField0_ & ~0x00000001); + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The create time of an operation.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getStartTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The create time of an operation.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + if (startTimeBuilder_ != null) { + return startTimeBuilder_.getMessageOrBuilder(); + } else { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + } + + /** + * + * + *
+     * The create time of an operation.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + 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 time of an operation.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * The end time of an operation.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @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 time of an operation.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + } else { + endTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The end time of an operation.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The end time of an operation.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && endTime_ != null + && endTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEndTimeBuilder().mergeFrom(value); + } else { + endTime_ = value; + } + } else { + endTimeBuilder_.mergeFrom(value); + } + if (endTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The end time of an operation.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder clearEndTime() { + bitField0_ = (bitField0_ & ~0x00000002); + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The end time of an operation.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getEndTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The end time of an operation.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + + /** + * + * + *
+     * The end time of an operation.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTime(), getParentForChildren(), isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + private int state_ = 0; + + /** + * + * + *
+     * State of an operation.
+     * 
+ * + * .google.logging.v2.OperationState state = 3; + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + + /** + * + * + *
+     * State of an operation.
+     * 
+ * + * .google.logging.v2.OperationState state = 3; + * + * @param value The enum numeric value on the wire for state to set. + * @return This builder for chaining. + */ + public Builder setStateValue(int value) { + state_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * State of an operation.
+     * 
+ * + * .google.logging.v2.OperationState state = 3; + * + * @return The state. + */ + @java.lang.Override + public com.google.logging.v2.OperationState getState() { + com.google.logging.v2.OperationState result = + com.google.logging.v2.OperationState.forNumber(state_); + return result == null ? com.google.logging.v2.OperationState.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * State of an operation.
+     * 
+ * + * .google.logging.v2.OperationState state = 3; + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.logging.v2.OperationState value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + state_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * State of an operation.
+     * 
+ * + * .google.logging.v2.OperationState state = 3; + * + * @return This builder for chaining. + */ + public Builder clearState() { + bitField0_ = (bitField0_ & ~0x00000004); + state_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.CreateBucketRequest, + com.google.logging.v2.CreateBucketRequest.Builder, + com.google.logging.v2.CreateBucketRequestOrBuilder> + createBucketRequestBuilder_; + + /** + * + * + *
+     * LongRunningCreateBucket RPC request.
+     * 
+ * + * .google.logging.v2.CreateBucketRequest create_bucket_request = 4; + * + * @return Whether the createBucketRequest field is set. + */ + @java.lang.Override + public boolean hasCreateBucketRequest() { + return requestCase_ == 4; + } + + /** + * + * + *
+     * LongRunningCreateBucket RPC request.
+     * 
+ * + * .google.logging.v2.CreateBucketRequest create_bucket_request = 4; + * + * @return The createBucketRequest. + */ + @java.lang.Override + public com.google.logging.v2.CreateBucketRequest getCreateBucketRequest() { + if (createBucketRequestBuilder_ == null) { + if (requestCase_ == 4) { + return (com.google.logging.v2.CreateBucketRequest) request_; + } + return com.google.logging.v2.CreateBucketRequest.getDefaultInstance(); + } else { + if (requestCase_ == 4) { + return createBucketRequestBuilder_.getMessage(); + } + return com.google.logging.v2.CreateBucketRequest.getDefaultInstance(); + } + } + + /** + * + * + *
+     * LongRunningCreateBucket RPC request.
+     * 
+ * + * .google.logging.v2.CreateBucketRequest create_bucket_request = 4; + */ + public Builder setCreateBucketRequest(com.google.logging.v2.CreateBucketRequest value) { + if (createBucketRequestBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + request_ = value; + onChanged(); + } else { + createBucketRequestBuilder_.setMessage(value); + } + requestCase_ = 4; + return this; + } + + /** + * + * + *
+     * LongRunningCreateBucket RPC request.
+     * 
+ * + * .google.logging.v2.CreateBucketRequest create_bucket_request = 4; + */ + public Builder setCreateBucketRequest( + com.google.logging.v2.CreateBucketRequest.Builder builderForValue) { + if (createBucketRequestBuilder_ == null) { + request_ = builderForValue.build(); + onChanged(); + } else { + createBucketRequestBuilder_.setMessage(builderForValue.build()); + } + requestCase_ = 4; + return this; + } + + /** + * + * + *
+     * LongRunningCreateBucket RPC request.
+     * 
+ * + * .google.logging.v2.CreateBucketRequest create_bucket_request = 4; + */ + public Builder mergeCreateBucketRequest(com.google.logging.v2.CreateBucketRequest value) { + if (createBucketRequestBuilder_ == null) { + if (requestCase_ == 4 + && request_ != com.google.logging.v2.CreateBucketRequest.getDefaultInstance()) { + request_ = + com.google.logging.v2.CreateBucketRequest.newBuilder( + (com.google.logging.v2.CreateBucketRequest) request_) + .mergeFrom(value) + .buildPartial(); + } else { + request_ = value; + } + onChanged(); + } else { + if (requestCase_ == 4) { + createBucketRequestBuilder_.mergeFrom(value); + } else { + createBucketRequestBuilder_.setMessage(value); + } + } + requestCase_ = 4; + return this; + } + + /** + * + * + *
+     * LongRunningCreateBucket RPC request.
+     * 
+ * + * .google.logging.v2.CreateBucketRequest create_bucket_request = 4; + */ + public Builder clearCreateBucketRequest() { + if (createBucketRequestBuilder_ == null) { + if (requestCase_ == 4) { + requestCase_ = 0; + request_ = null; + onChanged(); + } + } else { + if (requestCase_ == 4) { + requestCase_ = 0; + request_ = null; + } + createBucketRequestBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * LongRunningCreateBucket RPC request.
+     * 
+ * + * .google.logging.v2.CreateBucketRequest create_bucket_request = 4; + */ + public com.google.logging.v2.CreateBucketRequest.Builder getCreateBucketRequestBuilder() { + return getCreateBucketRequestFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * LongRunningCreateBucket RPC request.
+     * 
+ * + * .google.logging.v2.CreateBucketRequest create_bucket_request = 4; + */ + @java.lang.Override + public com.google.logging.v2.CreateBucketRequestOrBuilder getCreateBucketRequestOrBuilder() { + if ((requestCase_ == 4) && (createBucketRequestBuilder_ != null)) { + return createBucketRequestBuilder_.getMessageOrBuilder(); + } else { + if (requestCase_ == 4) { + return (com.google.logging.v2.CreateBucketRequest) request_; + } + return com.google.logging.v2.CreateBucketRequest.getDefaultInstance(); + } + } + + /** + * + * + *
+     * LongRunningCreateBucket RPC request.
+     * 
+ * + * .google.logging.v2.CreateBucketRequest create_bucket_request = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.CreateBucketRequest, + com.google.logging.v2.CreateBucketRequest.Builder, + com.google.logging.v2.CreateBucketRequestOrBuilder> + getCreateBucketRequestFieldBuilder() { + if (createBucketRequestBuilder_ == null) { + if (!(requestCase_ == 4)) { + request_ = com.google.logging.v2.CreateBucketRequest.getDefaultInstance(); + } + createBucketRequestBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.CreateBucketRequest, + com.google.logging.v2.CreateBucketRequest.Builder, + com.google.logging.v2.CreateBucketRequestOrBuilder>( + (com.google.logging.v2.CreateBucketRequest) request_, + getParentForChildren(), + isClean()); + request_ = null; + } + requestCase_ = 4; + onChanged(); + return createBucketRequestBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.UpdateBucketRequest, + com.google.logging.v2.UpdateBucketRequest.Builder, + com.google.logging.v2.UpdateBucketRequestOrBuilder> + updateBucketRequestBuilder_; + + /** + * + * + *
+     * LongRunningUpdateBucket RPC request.
+     * 
+ * + * .google.logging.v2.UpdateBucketRequest update_bucket_request = 5; + * + * @return Whether the updateBucketRequest field is set. + */ + @java.lang.Override + public boolean hasUpdateBucketRequest() { + return requestCase_ == 5; + } + + /** + * + * + *
+     * LongRunningUpdateBucket RPC request.
+     * 
+ * + * .google.logging.v2.UpdateBucketRequest update_bucket_request = 5; + * + * @return The updateBucketRequest. + */ + @java.lang.Override + public com.google.logging.v2.UpdateBucketRequest getUpdateBucketRequest() { + if (updateBucketRequestBuilder_ == null) { + if (requestCase_ == 5) { + return (com.google.logging.v2.UpdateBucketRequest) request_; + } + return com.google.logging.v2.UpdateBucketRequest.getDefaultInstance(); + } else { + if (requestCase_ == 5) { + return updateBucketRequestBuilder_.getMessage(); + } + return com.google.logging.v2.UpdateBucketRequest.getDefaultInstance(); + } + } + + /** + * + * + *
+     * LongRunningUpdateBucket RPC request.
+     * 
+ * + * .google.logging.v2.UpdateBucketRequest update_bucket_request = 5; + */ + public Builder setUpdateBucketRequest(com.google.logging.v2.UpdateBucketRequest value) { + if (updateBucketRequestBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + request_ = value; + onChanged(); + } else { + updateBucketRequestBuilder_.setMessage(value); + } + requestCase_ = 5; + return this; + } + + /** + * + * + *
+     * LongRunningUpdateBucket RPC request.
+     * 
+ * + * .google.logging.v2.UpdateBucketRequest update_bucket_request = 5; + */ + public Builder setUpdateBucketRequest( + com.google.logging.v2.UpdateBucketRequest.Builder builderForValue) { + if (updateBucketRequestBuilder_ == null) { + request_ = builderForValue.build(); + onChanged(); + } else { + updateBucketRequestBuilder_.setMessage(builderForValue.build()); + } + requestCase_ = 5; + return this; + } + + /** + * + * + *
+     * LongRunningUpdateBucket RPC request.
+     * 
+ * + * .google.logging.v2.UpdateBucketRequest update_bucket_request = 5; + */ + public Builder mergeUpdateBucketRequest(com.google.logging.v2.UpdateBucketRequest value) { + if (updateBucketRequestBuilder_ == null) { + if (requestCase_ == 5 + && request_ != com.google.logging.v2.UpdateBucketRequest.getDefaultInstance()) { + request_ = + com.google.logging.v2.UpdateBucketRequest.newBuilder( + (com.google.logging.v2.UpdateBucketRequest) request_) + .mergeFrom(value) + .buildPartial(); + } else { + request_ = value; + } + onChanged(); + } else { + if (requestCase_ == 5) { + updateBucketRequestBuilder_.mergeFrom(value); + } else { + updateBucketRequestBuilder_.setMessage(value); + } + } + requestCase_ = 5; + return this; + } + + /** + * + * + *
+     * LongRunningUpdateBucket RPC request.
+     * 
+ * + * .google.logging.v2.UpdateBucketRequest update_bucket_request = 5; + */ + public Builder clearUpdateBucketRequest() { + if (updateBucketRequestBuilder_ == null) { + if (requestCase_ == 5) { + requestCase_ = 0; + request_ = null; + onChanged(); + } + } else { + if (requestCase_ == 5) { + requestCase_ = 0; + request_ = null; + } + updateBucketRequestBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * LongRunningUpdateBucket RPC request.
+     * 
+ * + * .google.logging.v2.UpdateBucketRequest update_bucket_request = 5; + */ + public com.google.logging.v2.UpdateBucketRequest.Builder getUpdateBucketRequestBuilder() { + return getUpdateBucketRequestFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * LongRunningUpdateBucket RPC request.
+     * 
+ * + * .google.logging.v2.UpdateBucketRequest update_bucket_request = 5; + */ + @java.lang.Override + public com.google.logging.v2.UpdateBucketRequestOrBuilder getUpdateBucketRequestOrBuilder() { + if ((requestCase_ == 5) && (updateBucketRequestBuilder_ != null)) { + return updateBucketRequestBuilder_.getMessageOrBuilder(); + } else { + if (requestCase_ == 5) { + return (com.google.logging.v2.UpdateBucketRequest) request_; + } + return com.google.logging.v2.UpdateBucketRequest.getDefaultInstance(); + } + } + + /** + * + * + *
+     * LongRunningUpdateBucket RPC request.
+     * 
+ * + * .google.logging.v2.UpdateBucketRequest update_bucket_request = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.UpdateBucketRequest, + com.google.logging.v2.UpdateBucketRequest.Builder, + com.google.logging.v2.UpdateBucketRequestOrBuilder> + getUpdateBucketRequestFieldBuilder() { + if (updateBucketRequestBuilder_ == null) { + if (!(requestCase_ == 5)) { + request_ = com.google.logging.v2.UpdateBucketRequest.getDefaultInstance(); + } + updateBucketRequestBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.UpdateBucketRequest, + com.google.logging.v2.UpdateBucketRequest.Builder, + com.google.logging.v2.UpdateBucketRequestOrBuilder>( + (com.google.logging.v2.UpdateBucketRequest) request_, + getParentForChildren(), + isClean()); + request_ = null; + } + requestCase_ = 5; + onChanged(); + return updateBucketRequestBuilder_; + } + + @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.logging.v2.BucketMetadata) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.BucketMetadata) + private static final com.google.logging.v2.BucketMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.BucketMetadata(); + } + + public static com.google.logging.v2.BucketMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BucketMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.BucketMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/BucketMetadataOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/BucketMetadataOrBuilder.java new file mode 100644 index 000000000000..5141f284cf3b --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/BucketMetadataOrBuilder.java @@ -0,0 +1,202 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface BucketMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.BucketMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The create time of an operation.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return Whether the startTime field is set. + */ + boolean hasStartTime(); + + /** + * + * + *
+   * The create time of an operation.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return The startTime. + */ + com.google.protobuf.Timestamp getStartTime(); + + /** + * + * + *
+   * The create time of an operation.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); + + /** + * + * + *
+   * The end time of an operation.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + + /** + * + * + *
+   * The end time of an operation.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + + /** + * + * + *
+   * The end time of an operation.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); + + /** + * + * + *
+   * State of an operation.
+   * 
+ * + * .google.logging.v2.OperationState state = 3; + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + + /** + * + * + *
+   * State of an operation.
+   * 
+ * + * .google.logging.v2.OperationState state = 3; + * + * @return The state. + */ + com.google.logging.v2.OperationState getState(); + + /** + * + * + *
+   * LongRunningCreateBucket RPC request.
+   * 
+ * + * .google.logging.v2.CreateBucketRequest create_bucket_request = 4; + * + * @return Whether the createBucketRequest field is set. + */ + boolean hasCreateBucketRequest(); + + /** + * + * + *
+   * LongRunningCreateBucket RPC request.
+   * 
+ * + * .google.logging.v2.CreateBucketRequest create_bucket_request = 4; + * + * @return The createBucketRequest. + */ + com.google.logging.v2.CreateBucketRequest getCreateBucketRequest(); + + /** + * + * + *
+   * LongRunningCreateBucket RPC request.
+   * 
+ * + * .google.logging.v2.CreateBucketRequest create_bucket_request = 4; + */ + com.google.logging.v2.CreateBucketRequestOrBuilder getCreateBucketRequestOrBuilder(); + + /** + * + * + *
+   * LongRunningUpdateBucket RPC request.
+   * 
+ * + * .google.logging.v2.UpdateBucketRequest update_bucket_request = 5; + * + * @return Whether the updateBucketRequest field is set. + */ + boolean hasUpdateBucketRequest(); + + /** + * + * + *
+   * LongRunningUpdateBucket RPC request.
+   * 
+ * + * .google.logging.v2.UpdateBucketRequest update_bucket_request = 5; + * + * @return The updateBucketRequest. + */ + com.google.logging.v2.UpdateBucketRequest getUpdateBucketRequest(); + + /** + * + * + *
+   * LongRunningUpdateBucket RPC request.
+   * 
+ * + * .google.logging.v2.UpdateBucketRequest update_bucket_request = 5; + */ + com.google.logging.v2.UpdateBucketRequestOrBuilder getUpdateBucketRequestOrBuilder(); + + com.google.logging.v2.BucketMetadata.RequestCase getRequestCase(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettings.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettings.java new file mode 100644 index 000000000000..562200a440e3 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettings.java @@ -0,0 +1,1593 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * Describes the customer-managed encryption key (CMEK) settings associated with
+ * a project, folder, organization, billing account, or flexible resource.
+ *
+ * Note: CMEK for the Log Router can currently only be configured for Google
+ * Cloud organizations. Once configured, it applies to all projects and folders
+ * in the Google Cloud organization.
+ *
+ * See [Enabling CMEK for Log
+ * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for
+ * more information.
+ * 
+ * + * Protobuf type {@code google.logging.v2.CmekSettings} + */ +public final class CmekSettings extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.CmekSettings) + CmekSettingsOrBuilder { + private static final long serialVersionUID = 0L; + + // Use CmekSettings.newBuilder() to construct. + private CmekSettings(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CmekSettings() { + name_ = ""; + kmsKeyName_ = ""; + kmsKeyVersionName_ = ""; + serviceAccountId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CmekSettings(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_CmekSettings_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_CmekSettings_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.CmekSettings.class, + com.google.logging.v2.CmekSettings.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Output only. The resource name of the CMEK settings.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * Output only. The resource name of the CMEK settings.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KMS_KEY_NAME_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object kmsKeyName_ = ""; + + /** + * + * + *
+   * The resource name for the configured Cloud KMS key.
+   *
+   * KMS key name format:
+   *
+   *     "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]"
+   *
+   * For example:
+   *
+   *   `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key"`
+   *
+   *
+   *
+   * To enable CMEK for the Log Router, set this field to a valid
+   * `kms_key_name` for which the associated service account has the required
+   * cloudkms.cryptoKeyEncrypterDecrypter roles assigned for the key.
+   *
+   * The Cloud KMS key used by the Log Router can be updated by changing the
+   * `kms_key_name` to a new valid key name or disabled by setting the key name
+   * to an empty string. Encryption operations that are in progress will be
+   * completed with the key that was in use when they started. Decryption
+   * operations will be completed using the key that was used at the time of
+   * encryption unless access to that key has been revoked.
+   *
+   * To disable CMEK for the Log Router, set this field to an empty string.
+   *
+   * See [Enabling CMEK for Log
+   * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+   * for more information.
+   * 
+ * + * string kms_key_name = 2; + * + * @return The kmsKeyName. + */ + @java.lang.Override + public java.lang.String getKmsKeyName() { + java.lang.Object ref = kmsKeyName_; + 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(); + kmsKeyName_ = s; + return s; + } + } + + /** + * + * + *
+   * The resource name for the configured Cloud KMS key.
+   *
+   * KMS key name format:
+   *
+   *     "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]"
+   *
+   * For example:
+   *
+   *   `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key"`
+   *
+   *
+   *
+   * To enable CMEK for the Log Router, set this field to a valid
+   * `kms_key_name` for which the associated service account has the required
+   * cloudkms.cryptoKeyEncrypterDecrypter roles assigned for the key.
+   *
+   * The Cloud KMS key used by the Log Router can be updated by changing the
+   * `kms_key_name` to a new valid key name or disabled by setting the key name
+   * to an empty string. Encryption operations that are in progress will be
+   * completed with the key that was in use when they started. Decryption
+   * operations will be completed using the key that was used at the time of
+   * encryption unless access to that key has been revoked.
+   *
+   * To disable CMEK for the Log Router, set this field to an empty string.
+   *
+   * See [Enabling CMEK for Log
+   * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+   * for more information.
+   * 
+ * + * string kms_key_name = 2; + * + * @return The bytes for kmsKeyName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKmsKeyNameBytes() { + java.lang.Object ref = kmsKeyName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKeyName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KMS_KEY_VERSION_NAME_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object kmsKeyVersionName_ = ""; + + /** + * + * + *
+   * The CryptoKeyVersion resource name for the configured Cloud KMS key.
+   *
+   * KMS key name format:
+   *
+   *     "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]/cryptoKeyVersions/[VERSION]"
+   *
+   * For example:
+   *
+   *   `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key/cryptoKeyVersions/1"`
+   *
+   * This is a read-only field used to convey the specific configured
+   * CryptoKeyVersion of `kms_key` that has been configured. It will be
+   * populated in cases where the CMEK settings are bound to a single key
+   * version.
+   *
+   * If this field is populated, the `kms_key` is tied to a specific
+   * CryptoKeyVersion.
+   * 
+ * + * string kms_key_version_name = 4; + * + * @return The kmsKeyVersionName. + */ + @java.lang.Override + public java.lang.String getKmsKeyVersionName() { + java.lang.Object ref = kmsKeyVersionName_; + 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(); + kmsKeyVersionName_ = s; + return s; + } + } + + /** + * + * + *
+   * The CryptoKeyVersion resource name for the configured Cloud KMS key.
+   *
+   * KMS key name format:
+   *
+   *     "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]/cryptoKeyVersions/[VERSION]"
+   *
+   * For example:
+   *
+   *   `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key/cryptoKeyVersions/1"`
+   *
+   * This is a read-only field used to convey the specific configured
+   * CryptoKeyVersion of `kms_key` that has been configured. It will be
+   * populated in cases where the CMEK settings are bound to a single key
+   * version.
+   *
+   * If this field is populated, the `kms_key` is tied to a specific
+   * CryptoKeyVersion.
+   * 
+ * + * string kms_key_version_name = 4; + * + * @return The bytes for kmsKeyVersionName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKmsKeyVersionNameBytes() { + java.lang.Object ref = kmsKeyVersionName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKeyVersionName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SERVICE_ACCOUNT_ID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object serviceAccountId_ = ""; + + /** + * + * + *
+   * Output only. The service account that will be used by the Log Router to
+   * access your Cloud KMS key.
+   *
+   * Before enabling CMEK for Log Router, you must first assign the
+   * cloudkms.cryptoKeyEncrypterDecrypter role to the service account that
+   * the Log Router will use to access your Cloud KMS key. Use
+   * [GetCmekSettings][google.logging.v2.ConfigServiceV2.GetCmekSettings] to
+   * obtain the service account ID.
+   *
+   * See [Enabling CMEK for Log
+   * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+   * for more information.
+   * 
+ * + * string service_account_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The serviceAccountId. + */ + @java.lang.Override + public java.lang.String getServiceAccountId() { + java.lang.Object ref = serviceAccountId_; + 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(); + serviceAccountId_ = s; + return s; + } + } + + /** + * + * + *
+   * Output only. The service account that will be used by the Log Router to
+   * access your Cloud KMS key.
+   *
+   * Before enabling CMEK for Log Router, you must first assign the
+   * cloudkms.cryptoKeyEncrypterDecrypter role to the service account that
+   * the Log Router will use to access your Cloud KMS key. Use
+   * [GetCmekSettings][google.logging.v2.ConfigServiceV2.GetCmekSettings] to
+   * obtain the service account ID.
+   *
+   * See [Enabling CMEK for Log
+   * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+   * for more information.
+   * 
+ * + * string service_account_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for serviceAccountId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServiceAccountIdBytes() { + java.lang.Object ref = serviceAccountId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceAccountId_ = 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kmsKeyName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, kmsKeyName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceAccountId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, serviceAccountId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kmsKeyVersionName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, kmsKeyVersionName_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kmsKeyName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, kmsKeyName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceAccountId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, serviceAccountId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kmsKeyVersionName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, kmsKeyVersionName_); + } + size += getUnknownFields().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.logging.v2.CmekSettings)) { + return super.equals(obj); + } + com.google.logging.v2.CmekSettings other = (com.google.logging.v2.CmekSettings) obj; + + if (!getName().equals(other.getName())) return false; + if (!getKmsKeyName().equals(other.getKmsKeyName())) return false; + if (!getKmsKeyVersionName().equals(other.getKmsKeyVersionName())) return false; + if (!getServiceAccountId().equals(other.getServiceAccountId())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + KMS_KEY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getKmsKeyName().hashCode(); + hash = (37 * hash) + KMS_KEY_VERSION_NAME_FIELD_NUMBER; + hash = (53 * hash) + getKmsKeyVersionName().hashCode(); + hash = (37 * hash) + SERVICE_ACCOUNT_ID_FIELD_NUMBER; + hash = (53 * hash) + getServiceAccountId().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.CmekSettings parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.CmekSettings parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.CmekSettings parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.CmekSettings 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.logging.v2.CmekSettings parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.CmekSettings parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.CmekSettings parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.CmekSettings 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.logging.v2.CmekSettings parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.CmekSettings 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.logging.v2.CmekSettings parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.CmekSettings 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.logging.v2.CmekSettings 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; + } + + /** + * + * + *
+   * Describes the customer-managed encryption key (CMEK) settings associated with
+   * a project, folder, organization, billing account, or flexible resource.
+   *
+   * Note: CMEK for the Log Router can currently only be configured for Google
+   * Cloud organizations. Once configured, it applies to all projects and folders
+   * in the Google Cloud organization.
+   *
+   * See [Enabling CMEK for Log
+   * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for
+   * more information.
+   * 
+ * + * Protobuf type {@code google.logging.v2.CmekSettings} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.CmekSettings) + com.google.logging.v2.CmekSettingsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_CmekSettings_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_CmekSettings_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.CmekSettings.class, + com.google.logging.v2.CmekSettings.Builder.class); + } + + // Construct using com.google.logging.v2.CmekSettings.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + kmsKeyName_ = ""; + kmsKeyVersionName_ = ""; + serviceAccountId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_CmekSettings_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.CmekSettings getDefaultInstanceForType() { + return com.google.logging.v2.CmekSettings.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.CmekSettings build() { + com.google.logging.v2.CmekSettings result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.CmekSettings buildPartial() { + com.google.logging.v2.CmekSettings result = new com.google.logging.v2.CmekSettings(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.logging.v2.CmekSettings result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.kmsKeyName_ = kmsKeyName_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.kmsKeyVersionName_ = kmsKeyVersionName_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.serviceAccountId_ = serviceAccountId_; + } + } + + @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.logging.v2.CmekSettings) { + return mergeFrom((com.google.logging.v2.CmekSettings) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.CmekSettings other) { + if (other == com.google.logging.v2.CmekSettings.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getKmsKeyName().isEmpty()) { + kmsKeyName_ = other.kmsKeyName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getKmsKeyVersionName().isEmpty()) { + kmsKeyVersionName_ = other.kmsKeyVersionName_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getServiceAccountId().isEmpty()) { + serviceAccountId_ = other.serviceAccountId_; + bitField0_ |= 0x00000008; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + kmsKeyName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + serviceAccountId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 26 + case 34: + { + kmsKeyVersionName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Output only. The resource name of the CMEK settings.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Output only. The resource name of the CMEK settings.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Output only. The resource name of the CMEK settings.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The resource name of the CMEK settings.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The resource name of the CMEK settings.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object kmsKeyName_ = ""; + + /** + * + * + *
+     * The resource name for the configured Cloud KMS key.
+     *
+     * KMS key name format:
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key"`
+     *
+     *
+     *
+     * To enable CMEK for the Log Router, set this field to a valid
+     * `kms_key_name` for which the associated service account has the required
+     * cloudkms.cryptoKeyEncrypterDecrypter roles assigned for the key.
+     *
+     * The Cloud KMS key used by the Log Router can be updated by changing the
+     * `kms_key_name` to a new valid key name or disabled by setting the key name
+     * to an empty string. Encryption operations that are in progress will be
+     * completed with the key that was in use when they started. Decryption
+     * operations will be completed using the key that was used at the time of
+     * encryption unless access to that key has been revoked.
+     *
+     * To disable CMEK for the Log Router, set this field to an empty string.
+     *
+     * See [Enabling CMEK for Log
+     * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+     * for more information.
+     * 
+ * + * string kms_key_name = 2; + * + * @return The kmsKeyName. + */ + public java.lang.String getKmsKeyName() { + java.lang.Object ref = kmsKeyName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kmsKeyName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The resource name for the configured Cloud KMS key.
+     *
+     * KMS key name format:
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key"`
+     *
+     *
+     *
+     * To enable CMEK for the Log Router, set this field to a valid
+     * `kms_key_name` for which the associated service account has the required
+     * cloudkms.cryptoKeyEncrypterDecrypter roles assigned for the key.
+     *
+     * The Cloud KMS key used by the Log Router can be updated by changing the
+     * `kms_key_name` to a new valid key name or disabled by setting the key name
+     * to an empty string. Encryption operations that are in progress will be
+     * completed with the key that was in use when they started. Decryption
+     * operations will be completed using the key that was used at the time of
+     * encryption unless access to that key has been revoked.
+     *
+     * To disable CMEK for the Log Router, set this field to an empty string.
+     *
+     * See [Enabling CMEK for Log
+     * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+     * for more information.
+     * 
+ * + * string kms_key_name = 2; + * + * @return The bytes for kmsKeyName. + */ + public com.google.protobuf.ByteString getKmsKeyNameBytes() { + java.lang.Object ref = kmsKeyName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKeyName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The resource name for the configured Cloud KMS key.
+     *
+     * KMS key name format:
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key"`
+     *
+     *
+     *
+     * To enable CMEK for the Log Router, set this field to a valid
+     * `kms_key_name` for which the associated service account has the required
+     * cloudkms.cryptoKeyEncrypterDecrypter roles assigned for the key.
+     *
+     * The Cloud KMS key used by the Log Router can be updated by changing the
+     * `kms_key_name` to a new valid key name or disabled by setting the key name
+     * to an empty string. Encryption operations that are in progress will be
+     * completed with the key that was in use when they started. Decryption
+     * operations will be completed using the key that was used at the time of
+     * encryption unless access to that key has been revoked.
+     *
+     * To disable CMEK for the Log Router, set this field to an empty string.
+     *
+     * See [Enabling CMEK for Log
+     * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+     * for more information.
+     * 
+ * + * string kms_key_name = 2; + * + * @param value The kmsKeyName to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kmsKeyName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The resource name for the configured Cloud KMS key.
+     *
+     * KMS key name format:
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key"`
+     *
+     *
+     *
+     * To enable CMEK for the Log Router, set this field to a valid
+     * `kms_key_name` for which the associated service account has the required
+     * cloudkms.cryptoKeyEncrypterDecrypter roles assigned for the key.
+     *
+     * The Cloud KMS key used by the Log Router can be updated by changing the
+     * `kms_key_name` to a new valid key name or disabled by setting the key name
+     * to an empty string. Encryption operations that are in progress will be
+     * completed with the key that was in use when they started. Decryption
+     * operations will be completed using the key that was used at the time of
+     * encryption unless access to that key has been revoked.
+     *
+     * To disable CMEK for the Log Router, set this field to an empty string.
+     *
+     * See [Enabling CMEK for Log
+     * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+     * for more information.
+     * 
+ * + * string kms_key_name = 2; + * + * @return This builder for chaining. + */ + public Builder clearKmsKeyName() { + kmsKeyName_ = getDefaultInstance().getKmsKeyName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * The resource name for the configured Cloud KMS key.
+     *
+     * KMS key name format:
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key"`
+     *
+     *
+     *
+     * To enable CMEK for the Log Router, set this field to a valid
+     * `kms_key_name` for which the associated service account has the required
+     * cloudkms.cryptoKeyEncrypterDecrypter roles assigned for the key.
+     *
+     * The Cloud KMS key used by the Log Router can be updated by changing the
+     * `kms_key_name` to a new valid key name or disabled by setting the key name
+     * to an empty string. Encryption operations that are in progress will be
+     * completed with the key that was in use when they started. Decryption
+     * operations will be completed using the key that was used at the time of
+     * encryption unless access to that key has been revoked.
+     *
+     * To disable CMEK for the Log Router, set this field to an empty string.
+     *
+     * See [Enabling CMEK for Log
+     * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+     * for more information.
+     * 
+ * + * string kms_key_name = 2; + * + * @param value The bytes for kmsKeyName to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kmsKeyName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object kmsKeyVersionName_ = ""; + + /** + * + * + *
+     * The CryptoKeyVersion resource name for the configured Cloud KMS key.
+     *
+     * KMS key name format:
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]/cryptoKeyVersions/[VERSION]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key/cryptoKeyVersions/1"`
+     *
+     * This is a read-only field used to convey the specific configured
+     * CryptoKeyVersion of `kms_key` that has been configured. It will be
+     * populated in cases where the CMEK settings are bound to a single key
+     * version.
+     *
+     * If this field is populated, the `kms_key` is tied to a specific
+     * CryptoKeyVersion.
+     * 
+ * + * string kms_key_version_name = 4; + * + * @return The kmsKeyVersionName. + */ + public java.lang.String getKmsKeyVersionName() { + java.lang.Object ref = kmsKeyVersionName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kmsKeyVersionName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The CryptoKeyVersion resource name for the configured Cloud KMS key.
+     *
+     * KMS key name format:
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]/cryptoKeyVersions/[VERSION]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key/cryptoKeyVersions/1"`
+     *
+     * This is a read-only field used to convey the specific configured
+     * CryptoKeyVersion of `kms_key` that has been configured. It will be
+     * populated in cases where the CMEK settings are bound to a single key
+     * version.
+     *
+     * If this field is populated, the `kms_key` is tied to a specific
+     * CryptoKeyVersion.
+     * 
+ * + * string kms_key_version_name = 4; + * + * @return The bytes for kmsKeyVersionName. + */ + public com.google.protobuf.ByteString getKmsKeyVersionNameBytes() { + java.lang.Object ref = kmsKeyVersionName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKeyVersionName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The CryptoKeyVersion resource name for the configured Cloud KMS key.
+     *
+     * KMS key name format:
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]/cryptoKeyVersions/[VERSION]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key/cryptoKeyVersions/1"`
+     *
+     * This is a read-only field used to convey the specific configured
+     * CryptoKeyVersion of `kms_key` that has been configured. It will be
+     * populated in cases where the CMEK settings are bound to a single key
+     * version.
+     *
+     * If this field is populated, the `kms_key` is tied to a specific
+     * CryptoKeyVersion.
+     * 
+ * + * string kms_key_version_name = 4; + * + * @param value The kmsKeyVersionName to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyVersionName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kmsKeyVersionName_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The CryptoKeyVersion resource name for the configured Cloud KMS key.
+     *
+     * KMS key name format:
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]/cryptoKeyVersions/[VERSION]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key/cryptoKeyVersions/1"`
+     *
+     * This is a read-only field used to convey the specific configured
+     * CryptoKeyVersion of `kms_key` that has been configured. It will be
+     * populated in cases where the CMEK settings are bound to a single key
+     * version.
+     *
+     * If this field is populated, the `kms_key` is tied to a specific
+     * CryptoKeyVersion.
+     * 
+ * + * string kms_key_version_name = 4; + * + * @return This builder for chaining. + */ + public Builder clearKmsKeyVersionName() { + kmsKeyVersionName_ = getDefaultInstance().getKmsKeyVersionName(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * The CryptoKeyVersion resource name for the configured Cloud KMS key.
+     *
+     * KMS key name format:
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]/cryptoKeyVersions/[VERSION]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key/cryptoKeyVersions/1"`
+     *
+     * This is a read-only field used to convey the specific configured
+     * CryptoKeyVersion of `kms_key` that has been configured. It will be
+     * populated in cases where the CMEK settings are bound to a single key
+     * version.
+     *
+     * If this field is populated, the `kms_key` is tied to a specific
+     * CryptoKeyVersion.
+     * 
+ * + * string kms_key_version_name = 4; + * + * @param value The bytes for kmsKeyVersionName to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyVersionNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kmsKeyVersionName_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object serviceAccountId_ = ""; + + /** + * + * + *
+     * Output only. The service account that will be used by the Log Router to
+     * access your Cloud KMS key.
+     *
+     * Before enabling CMEK for Log Router, you must first assign the
+     * cloudkms.cryptoKeyEncrypterDecrypter role to the service account that
+     * the Log Router will use to access your Cloud KMS key. Use
+     * [GetCmekSettings][google.logging.v2.ConfigServiceV2.GetCmekSettings] to
+     * obtain the service account ID.
+     *
+     * See [Enabling CMEK for Log
+     * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+     * for more information.
+     * 
+ * + * string service_account_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The serviceAccountId. + */ + public java.lang.String getServiceAccountId() { + java.lang.Object ref = serviceAccountId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceAccountId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Output only. The service account that will be used by the Log Router to
+     * access your Cloud KMS key.
+     *
+     * Before enabling CMEK for Log Router, you must first assign the
+     * cloudkms.cryptoKeyEncrypterDecrypter role to the service account that
+     * the Log Router will use to access your Cloud KMS key. Use
+     * [GetCmekSettings][google.logging.v2.ConfigServiceV2.GetCmekSettings] to
+     * obtain the service account ID.
+     *
+     * See [Enabling CMEK for Log
+     * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+     * for more information.
+     * 
+ * + * string service_account_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for serviceAccountId. + */ + public com.google.protobuf.ByteString getServiceAccountIdBytes() { + java.lang.Object ref = serviceAccountId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceAccountId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Output only. The service account that will be used by the Log Router to
+     * access your Cloud KMS key.
+     *
+     * Before enabling CMEK for Log Router, you must first assign the
+     * cloudkms.cryptoKeyEncrypterDecrypter role to the service account that
+     * the Log Router will use to access your Cloud KMS key. Use
+     * [GetCmekSettings][google.logging.v2.ConfigServiceV2.GetCmekSettings] to
+     * obtain the service account ID.
+     *
+     * See [Enabling CMEK for Log
+     * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+     * for more information.
+     * 
+ * + * string service_account_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The serviceAccountId to set. + * @return This builder for chaining. + */ + public Builder setServiceAccountId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + serviceAccountId_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The service account that will be used by the Log Router to
+     * access your Cloud KMS key.
+     *
+     * Before enabling CMEK for Log Router, you must first assign the
+     * cloudkms.cryptoKeyEncrypterDecrypter role to the service account that
+     * the Log Router will use to access your Cloud KMS key. Use
+     * [GetCmekSettings][google.logging.v2.ConfigServiceV2.GetCmekSettings] to
+     * obtain the service account ID.
+     *
+     * See [Enabling CMEK for Log
+     * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+     * for more information.
+     * 
+ * + * string service_account_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearServiceAccountId() { + serviceAccountId_ = getDefaultInstance().getServiceAccountId(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The service account that will be used by the Log Router to
+     * access your Cloud KMS key.
+     *
+     * Before enabling CMEK for Log Router, you must first assign the
+     * cloudkms.cryptoKeyEncrypterDecrypter role to the service account that
+     * the Log Router will use to access your Cloud KMS key. Use
+     * [GetCmekSettings][google.logging.v2.ConfigServiceV2.GetCmekSettings] to
+     * obtain the service account ID.
+     *
+     * See [Enabling CMEK for Log
+     * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+     * for more information.
+     * 
+ * + * string service_account_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for serviceAccountId to set. + * @return This builder for chaining. + */ + public Builder setServiceAccountIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + serviceAccountId_ = value; + bitField0_ |= 0x00000008; + 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.logging.v2.CmekSettings) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.CmekSettings) + private static final com.google.logging.v2.CmekSettings DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.CmekSettings(); + } + + public static com.google.logging.v2.CmekSettings getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CmekSettings parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.CmekSettings getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java new file mode 100644 index 000000000000..b6faec28b304 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java @@ -0,0 +1,446 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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.logging.v2; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.pathtemplate.ValidationException; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class CmekSettingsName implements ResourceName { + private static final PathTemplate PROJECT = + PathTemplate.createWithoutUrlEncoding("projects/{project}/cmekSettings"); + private static final PathTemplate ORGANIZATION = + PathTemplate.createWithoutUrlEncoding("organizations/{organization}/cmekSettings"); + private static final PathTemplate FOLDER = + PathTemplate.createWithoutUrlEncoding("folders/{folder}/cmekSettings"); + private static final PathTemplate BILLING_ACCOUNT = + PathTemplate.createWithoutUrlEncoding("billingAccounts/{billing_account}/cmekSettings"); + private volatile Map fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; + private final String project; + private final String organization; + private final String folder; + private final String billingAccount; + + @Deprecated + protected CmekSettingsName() { + project = null; + organization = null; + folder = null; + billingAccount = null; + } + + private CmekSettingsName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + organization = null; + folder = null; + billingAccount = null; + pathTemplate = PROJECT; + } + + private CmekSettingsName(OrganizationCmekSettingsBuilder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + project = null; + folder = null; + billingAccount = null; + pathTemplate = ORGANIZATION; + } + + private CmekSettingsName(FolderCmekSettingsBuilder builder) { + folder = Preconditions.checkNotNull(builder.getFolder()); + project = null; + organization = null; + billingAccount = null; + pathTemplate = FOLDER; + } + + private CmekSettingsName(BillingAccountCmekSettingsBuilder builder) { + billingAccount = Preconditions.checkNotNull(builder.getBillingAccount()); + project = null; + organization = null; + folder = null; + pathTemplate = BILLING_ACCOUNT; + } + + public String getProject() { + return project; + } + + public String getOrganization() { + return organization; + } + + public String getFolder() { + return folder; + } + + public String getBillingAccount() { + return billingAccount; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public static Builder newProjectBuilder() { + return new Builder(); + } + + /** + * @deprecated Please use {@link #newProjectBuilder()} instead + */ + @Deprecated + public static Builder newProjectCmekSettingsBuilder() { + return new Builder(); + } + + public static OrganizationCmekSettingsBuilder newOrganizationCmekSettingsBuilder() { + return new OrganizationCmekSettingsBuilder(); + } + + public static FolderCmekSettingsBuilder newFolderCmekSettingsBuilder() { + return new FolderCmekSettingsBuilder(); + } + + public static BillingAccountCmekSettingsBuilder newBillingAccountCmekSettingsBuilder() { + return new BillingAccountCmekSettingsBuilder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static CmekSettingsName of(String project) { + return newBuilder().setProject(project).build(); + } + + public static CmekSettingsName ofProjectName(String project) { + return newBuilder().setProject(project).build(); + } + + /** + * @deprecated Please use {@link #ofProjectName(String)} instead + */ + @Deprecated + public static CmekSettingsName ofProjectCmekSettingsName(String project) { + return newBuilder().setProject(project).build(); + } + + public static CmekSettingsName ofOrganizationName(String organization) { + return newOrganizationCmekSettingsBuilder().setOrganization(organization).build(); + } + + /** + * @deprecated Please use {@link #ofOrganizationName(String)} instead + */ + @Deprecated + public static CmekSettingsName ofOrganizationCmekSettingsName(String organization) { + return newOrganizationCmekSettingsBuilder().setOrganization(organization).build(); + } + + public static CmekSettingsName ofFolderName(String folder) { + return newFolderCmekSettingsBuilder().setFolder(folder).build(); + } + + /** + * @deprecated Please use {@link #ofFolderName(String)} instead + */ + @Deprecated + public static CmekSettingsName ofFolderCmekSettingsName(String folder) { + return newFolderCmekSettingsBuilder().setFolder(folder).build(); + } + + public static CmekSettingsName ofBillingAccountName(String billingAccount) { + return newBillingAccountCmekSettingsBuilder().setBillingAccount(billingAccount).build(); + } + + /** + * @deprecated Please use {@link #ofBillingAccountName(String)} instead + */ + @Deprecated + public static CmekSettingsName ofBillingAccountCmekSettingsName(String billingAccount) { + return newBillingAccountCmekSettingsBuilder().setBillingAccount(billingAccount).build(); + } + + public static String format(String project) { + return newBuilder().setProject(project).build().toString(); + } + + public static String formatProjectName(String project) { + return newBuilder().setProject(project).build().toString(); + } + + /** + * @deprecated Please use {@link #formatProjectName(String)} instead + */ + @Deprecated + public static String formatProjectCmekSettingsName(String project) { + return newBuilder().setProject(project).build().toString(); + } + + public static String formatOrganizationName(String organization) { + return newOrganizationCmekSettingsBuilder().setOrganization(organization).build().toString(); + } + + /** + * @deprecated Please use {@link #formatOrganizationName(String)} instead + */ + @Deprecated + public static String formatOrganizationCmekSettingsName(String organization) { + return newOrganizationCmekSettingsBuilder().setOrganization(organization).build().toString(); + } + + public static String formatFolderName(String folder) { + return newFolderCmekSettingsBuilder().setFolder(folder).build().toString(); + } + + /** + * @deprecated Please use {@link #formatFolderName(String)} instead + */ + @Deprecated + public static String formatFolderCmekSettingsName(String folder) { + return newFolderCmekSettingsBuilder().setFolder(folder).build().toString(); + } + + public static String formatBillingAccountName(String billingAccount) { + return newBillingAccountCmekSettingsBuilder() + .setBillingAccount(billingAccount) + .build() + .toString(); + } + + /** + * @deprecated Please use {@link #formatBillingAccountName(String)} instead + */ + @Deprecated + public static String formatBillingAccountCmekSettingsName(String billingAccount) { + return newBillingAccountCmekSettingsBuilder() + .setBillingAccount(billingAccount) + .build() + .toString(); + } + + public static CmekSettingsName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + if (PROJECT.matches(formattedString)) { + Map matchMap = PROJECT.match(formattedString); + return ofProjectCmekSettingsName(matchMap.get("project")); + } else if (ORGANIZATION.matches(formattedString)) { + Map matchMap = ORGANIZATION.match(formattedString); + return ofOrganizationCmekSettingsName(matchMap.get("organization")); + } else if (FOLDER.matches(formattedString)) { + Map matchMap = FOLDER.match(formattedString); + return ofFolderCmekSettingsName(matchMap.get("folder")); + } else if (BILLING_ACCOUNT.matches(formattedString)) { + Map matchMap = BILLING_ACCOUNT.match(formattedString); + return ofBillingAccountCmekSettingsName(matchMap.get("billing_account")); + } + throw new ValidationException("CmekSettingsName.parse: formattedString not in valid format"); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (CmekSettingsName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT.matches(formattedString) + || ORGANIZATION.matches(formattedString) + || FOLDER.matches(formattedString) + || BILLING_ACCOUNT.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (organization != null) { + fieldMapBuilder.put("organization", organization); + } + if (folder != null) { + fieldMapBuilder.put("folder", folder); + } + if (billingAccount != null) { + fieldMapBuilder.put("billing_account", billingAccount); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + CmekSettingsName that = ((CmekSettingsName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.organization, that.organization) + && Objects.equals(this.folder, that.folder) + && Objects.equals(this.billingAccount, that.billingAccount); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(fixedValue); + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(organization); + h *= 1000003; + h ^= Objects.hashCode(folder); + h *= 1000003; + h ^= Objects.hashCode(billingAccount); + return h; + } + + /** Builder for projects/{project}/cmekSettings. */ + public static class Builder { + private String project; + + protected Builder() {} + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + private Builder(CmekSettingsName cmekSettingsName) { + Preconditions.checkArgument( + Objects.equals(cmekSettingsName.pathTemplate, PROJECT), + "toBuilder is only supported when CmekSettingsName has the pattern of" + + " projects/{project}/cmekSettings"); + this.project = cmekSettingsName.project; + } + + public CmekSettingsName build() { + return new CmekSettingsName(this); + } + } + + /** Builder for organizations/{organization}/cmekSettings. */ + public static class OrganizationCmekSettingsBuilder { + private String organization; + + protected OrganizationCmekSettingsBuilder() {} + + public String getOrganization() { + return organization; + } + + public OrganizationCmekSettingsBuilder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public CmekSettingsName build() { + return new CmekSettingsName(this); + } + } + + /** Builder for folders/{folder}/cmekSettings. */ + public static class FolderCmekSettingsBuilder { + private String folder; + + protected FolderCmekSettingsBuilder() {} + + public String getFolder() { + return folder; + } + + public FolderCmekSettingsBuilder setFolder(String folder) { + this.folder = folder; + return this; + } + + public CmekSettingsName build() { + return new CmekSettingsName(this); + } + } + + /** Builder for billingAccounts/{billing_account}/cmekSettings. */ + public static class BillingAccountCmekSettingsBuilder { + private String billingAccount; + + protected BillingAccountCmekSettingsBuilder() {} + + public String getBillingAccount() { + return billingAccount; + } + + public BillingAccountCmekSettingsBuilder setBillingAccount(String billingAccount) { + this.billingAccount = billingAccount; + return this; + } + + public CmekSettingsName build() { + return new CmekSettingsName(this); + } + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsOrBuilder.java new file mode 100644 index 000000000000..c3f9d00c2b6c --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsOrBuilder.java @@ -0,0 +1,238 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface CmekSettingsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.CmekSettings) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The resource name of the CMEK settings.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Output only. The resource name of the CMEK settings.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The resource name for the configured Cloud KMS key.
+   *
+   * KMS key name format:
+   *
+   *     "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]"
+   *
+   * For example:
+   *
+   *   `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key"`
+   *
+   *
+   *
+   * To enable CMEK for the Log Router, set this field to a valid
+   * `kms_key_name` for which the associated service account has the required
+   * cloudkms.cryptoKeyEncrypterDecrypter roles assigned for the key.
+   *
+   * The Cloud KMS key used by the Log Router can be updated by changing the
+   * `kms_key_name` to a new valid key name or disabled by setting the key name
+   * to an empty string. Encryption operations that are in progress will be
+   * completed with the key that was in use when they started. Decryption
+   * operations will be completed using the key that was used at the time of
+   * encryption unless access to that key has been revoked.
+   *
+   * To disable CMEK for the Log Router, set this field to an empty string.
+   *
+   * See [Enabling CMEK for Log
+   * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+   * for more information.
+   * 
+ * + * string kms_key_name = 2; + * + * @return The kmsKeyName. + */ + java.lang.String getKmsKeyName(); + + /** + * + * + *
+   * The resource name for the configured Cloud KMS key.
+   *
+   * KMS key name format:
+   *
+   *     "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]"
+   *
+   * For example:
+   *
+   *   `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key"`
+   *
+   *
+   *
+   * To enable CMEK for the Log Router, set this field to a valid
+   * `kms_key_name` for which the associated service account has the required
+   * cloudkms.cryptoKeyEncrypterDecrypter roles assigned for the key.
+   *
+   * The Cloud KMS key used by the Log Router can be updated by changing the
+   * `kms_key_name` to a new valid key name or disabled by setting the key name
+   * to an empty string. Encryption operations that are in progress will be
+   * completed with the key that was in use when they started. Decryption
+   * operations will be completed using the key that was used at the time of
+   * encryption unless access to that key has been revoked.
+   *
+   * To disable CMEK for the Log Router, set this field to an empty string.
+   *
+   * See [Enabling CMEK for Log
+   * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+   * for more information.
+   * 
+ * + * string kms_key_name = 2; + * + * @return The bytes for kmsKeyName. + */ + com.google.protobuf.ByteString getKmsKeyNameBytes(); + + /** + * + * + *
+   * The CryptoKeyVersion resource name for the configured Cloud KMS key.
+   *
+   * KMS key name format:
+   *
+   *     "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]/cryptoKeyVersions/[VERSION]"
+   *
+   * For example:
+   *
+   *   `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key/cryptoKeyVersions/1"`
+   *
+   * This is a read-only field used to convey the specific configured
+   * CryptoKeyVersion of `kms_key` that has been configured. It will be
+   * populated in cases where the CMEK settings are bound to a single key
+   * version.
+   *
+   * If this field is populated, the `kms_key` is tied to a specific
+   * CryptoKeyVersion.
+   * 
+ * + * string kms_key_version_name = 4; + * + * @return The kmsKeyVersionName. + */ + java.lang.String getKmsKeyVersionName(); + + /** + * + * + *
+   * The CryptoKeyVersion resource name for the configured Cloud KMS key.
+   *
+   * KMS key name format:
+   *
+   *     "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]/cryptoKeyVersions/[VERSION]"
+   *
+   * For example:
+   *
+   *   `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key/cryptoKeyVersions/1"`
+   *
+   * This is a read-only field used to convey the specific configured
+   * CryptoKeyVersion of `kms_key` that has been configured. It will be
+   * populated in cases where the CMEK settings are bound to a single key
+   * version.
+   *
+   * If this field is populated, the `kms_key` is tied to a specific
+   * CryptoKeyVersion.
+   * 
+ * + * string kms_key_version_name = 4; + * + * @return The bytes for kmsKeyVersionName. + */ + com.google.protobuf.ByteString getKmsKeyVersionNameBytes(); + + /** + * + * + *
+   * Output only. The service account that will be used by the Log Router to
+   * access your Cloud KMS key.
+   *
+   * Before enabling CMEK for Log Router, you must first assign the
+   * cloudkms.cryptoKeyEncrypterDecrypter role to the service account that
+   * the Log Router will use to access your Cloud KMS key. Use
+   * [GetCmekSettings][google.logging.v2.ConfigServiceV2.GetCmekSettings] to
+   * obtain the service account ID.
+   *
+   * See [Enabling CMEK for Log
+   * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+   * for more information.
+   * 
+ * + * string service_account_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The serviceAccountId. + */ + java.lang.String getServiceAccountId(); + + /** + * + * + *
+   * Output only. The service account that will be used by the Log Router to
+   * access your Cloud KMS key.
+   *
+   * Before enabling CMEK for Log Router, you must first assign the
+   * cloudkms.cryptoKeyEncrypterDecrypter role to the service account that
+   * the Log Router will use to access your Cloud KMS key. Use
+   * [GetCmekSettings][google.logging.v2.ConfigServiceV2.GetCmekSettings] to
+   * obtain the service account ID.
+   *
+   * See [Enabling CMEK for Log
+   * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+   * for more information.
+   * 
+ * + * string service_account_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for serviceAccountId. + */ + com.google.protobuf.ByteString getServiceAccountIdBytes(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CopyLogEntriesMetadata.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CopyLogEntriesMetadata.java new file mode 100644 index 000000000000..31bd88766dca --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CopyLogEntriesMetadata.java @@ -0,0 +1,1859 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * Metadata for CopyLogEntries long running operations.
+ * 
+ * + * Protobuf type {@code google.logging.v2.CopyLogEntriesMetadata} + */ +public final class CopyLogEntriesMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.CopyLogEntriesMetadata) + CopyLogEntriesMetadataOrBuilder { + private static final long serialVersionUID = 0L; + + // Use CopyLogEntriesMetadata.newBuilder() to construct. + private CopyLogEntriesMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CopyLogEntriesMetadata() { + state_ = 0; + writerIdentity_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CopyLogEntriesMetadata(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_CopyLogEntriesMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_CopyLogEntriesMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.CopyLogEntriesMetadata.class, + com.google.logging.v2.CopyLogEntriesMetadata.Builder.class); + } + + private int bitField0_; + public static final int START_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp startTime_; + + /** + * + * + *
+   * The create time of an operation.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return Whether the startTime field is set. + */ + @java.lang.Override + public boolean hasStartTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The create time of an operation.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return The startTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getStartTime() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + + /** + * + * + *
+   * The create time of an operation.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + + public static final int END_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp endTime_; + + /** + * + * + *
+   * The end time of an operation.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * The end time of an operation.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + /** + * + * + *
+   * The end time of an operation.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + public static final int STATE_FIELD_NUMBER = 3; + private int state_ = 0; + + /** + * + * + *
+   * State of an operation.
+   * 
+ * + * .google.logging.v2.OperationState state = 3; + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + + /** + * + * + *
+   * State of an operation.
+   * 
+ * + * .google.logging.v2.OperationState state = 3; + * + * @return The state. + */ + @java.lang.Override + public com.google.logging.v2.OperationState getState() { + com.google.logging.v2.OperationState result = + com.google.logging.v2.OperationState.forNumber(state_); + return result == null ? com.google.logging.v2.OperationState.UNRECOGNIZED : result; + } + + public static final int CANCELLATION_REQUESTED_FIELD_NUMBER = 4; + private boolean cancellationRequested_ = false; + + /** + * + * + *
+   * Identifies whether the user has requested cancellation of the operation.
+   * 
+ * + * bool cancellation_requested = 4; + * + * @return The cancellationRequested. + */ + @java.lang.Override + public boolean getCancellationRequested() { + return cancellationRequested_; + } + + public static final int REQUEST_FIELD_NUMBER = 5; + private com.google.logging.v2.CopyLogEntriesRequest request_; + + /** + * + * + *
+   * CopyLogEntries RPC request.
+   * 
+ * + * .google.logging.v2.CopyLogEntriesRequest request = 5; + * + * @return Whether the request field is set. + */ + @java.lang.Override + public boolean hasRequest() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * CopyLogEntries RPC request.
+   * 
+ * + * .google.logging.v2.CopyLogEntriesRequest request = 5; + * + * @return The request. + */ + @java.lang.Override + public com.google.logging.v2.CopyLogEntriesRequest getRequest() { + return request_ == null + ? com.google.logging.v2.CopyLogEntriesRequest.getDefaultInstance() + : request_; + } + + /** + * + * + *
+   * CopyLogEntries RPC request.
+   * 
+ * + * .google.logging.v2.CopyLogEntriesRequest request = 5; + */ + @java.lang.Override + public com.google.logging.v2.CopyLogEntriesRequestOrBuilder getRequestOrBuilder() { + return request_ == null + ? com.google.logging.v2.CopyLogEntriesRequest.getDefaultInstance() + : request_; + } + + public static final int PROGRESS_FIELD_NUMBER = 6; + private int progress_ = 0; + + /** + * + * + *
+   * Estimated progress of the operation (0 - 100%).
+   * 
+ * + * int32 progress = 6; + * + * @return The progress. + */ + @java.lang.Override + public int getProgress() { + return progress_; + } + + public static final int WRITER_IDENTITY_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object writerIdentity_ = ""; + + /** + * + * + *
+   * The IAM identity of a service account that must be granted access to the
+   * destination.
+   *
+   * If the service account is not granted permission to the destination within
+   * an hour, the operation will be cancelled.
+   *
+   * For example: `"serviceAccount:foo@bar.com"`
+   * 
+ * + * string writer_identity = 7; + * + * @return The writerIdentity. + */ + @java.lang.Override + public java.lang.String getWriterIdentity() { + java.lang.Object ref = writerIdentity_; + 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(); + writerIdentity_ = s; + return s; + } + } + + /** + * + * + *
+   * The IAM identity of a service account that must be granted access to the
+   * destination.
+   *
+   * If the service account is not granted permission to the destination within
+   * an hour, the operation will be cancelled.
+   *
+   * For example: `"serviceAccount:foo@bar.com"`
+   * 
+ * + * string writer_identity = 7; + * + * @return The bytes for writerIdentity. + */ + @java.lang.Override + public com.google.protobuf.ByteString getWriterIdentityBytes() { + java.lang.Object ref = writerIdentity_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + writerIdentity_ = 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getStartTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getEndTime()); + } + if (state_ != com.google.logging.v2.OperationState.OPERATION_STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(3, state_); + } + if (cancellationRequested_ != false) { + output.writeBool(4, cancellationRequested_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(5, getRequest()); + } + if (progress_ != 0) { + output.writeInt32(6, progress_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(writerIdentity_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, writerIdentity_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getStartTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getEndTime()); + } + if (state_ != com.google.logging.v2.OperationState.OPERATION_STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, state_); + } + if (cancellationRequested_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, cancellationRequested_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getRequest()); + } + if (progress_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(6, progress_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(writerIdentity_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, writerIdentity_); + } + size += getUnknownFields().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.logging.v2.CopyLogEntriesMetadata)) { + return super.equals(obj); + } + com.google.logging.v2.CopyLogEntriesMetadata other = + (com.google.logging.v2.CopyLogEntriesMetadata) obj; + + 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 (state_ != other.state_) return false; + if (getCancellationRequested() != other.getCancellationRequested()) return false; + if (hasRequest() != other.hasRequest()) return false; + if (hasRequest()) { + if (!getRequest().equals(other.getRequest())) return false; + } + if (getProgress() != other.getProgress()) return false; + if (!getWriterIdentity().equals(other.getWriterIdentity())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().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(); + } + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (37 * hash) + CANCELLATION_REQUESTED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getCancellationRequested()); + if (hasRequest()) { + hash = (37 * hash) + REQUEST_FIELD_NUMBER; + hash = (53 * hash) + getRequest().hashCode(); + } + hash = (37 * hash) + PROGRESS_FIELD_NUMBER; + hash = (53 * hash) + getProgress(); + hash = (37 * hash) + WRITER_IDENTITY_FIELD_NUMBER; + hash = (53 * hash) + getWriterIdentity().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.CopyLogEntriesMetadata parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.CopyLogEntriesMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.CopyLogEntriesMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.CopyLogEntriesMetadata 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.logging.v2.CopyLogEntriesMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.CopyLogEntriesMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.CopyLogEntriesMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.CopyLogEntriesMetadata 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.logging.v2.CopyLogEntriesMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.CopyLogEntriesMetadata 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.logging.v2.CopyLogEntriesMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.CopyLogEntriesMetadata 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.logging.v2.CopyLogEntriesMetadata 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; + } + + /** + * + * + *
+   * Metadata for CopyLogEntries long running operations.
+   * 
+ * + * Protobuf type {@code google.logging.v2.CopyLogEntriesMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.CopyLogEntriesMetadata) + com.google.logging.v2.CopyLogEntriesMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_CopyLogEntriesMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_CopyLogEntriesMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.CopyLogEntriesMetadata.class, + com.google.logging.v2.CopyLogEntriesMetadata.Builder.class); + } + + // Construct using com.google.logging.v2.CopyLogEntriesMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getStartTimeFieldBuilder(); + getEndTimeFieldBuilder(); + getRequestFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + state_ = 0; + cancellationRequested_ = false; + request_ = null; + if (requestBuilder_ != null) { + requestBuilder_.dispose(); + requestBuilder_ = null; + } + progress_ = 0; + writerIdentity_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_CopyLogEntriesMetadata_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.CopyLogEntriesMetadata getDefaultInstanceForType() { + return com.google.logging.v2.CopyLogEntriesMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.CopyLogEntriesMetadata build() { + com.google.logging.v2.CopyLogEntriesMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.CopyLogEntriesMetadata buildPartial() { + com.google.logging.v2.CopyLogEntriesMetadata result = + new com.google.logging.v2.CopyLogEntriesMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.logging.v2.CopyLogEntriesMetadata result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.startTime_ = startTimeBuilder_ == null ? startTime_ : startTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.endTime_ = endTimeBuilder_ == null ? endTime_ : endTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.state_ = state_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.cancellationRequested_ = cancellationRequested_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.request_ = requestBuilder_ == null ? request_ : requestBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.progress_ = progress_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.writerIdentity_ = writerIdentity_; + } + result.bitField0_ |= to_bitField0_; + } + + @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.logging.v2.CopyLogEntriesMetadata) { + return mergeFrom((com.google.logging.v2.CopyLogEntriesMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.CopyLogEntriesMetadata other) { + if (other == com.google.logging.v2.CopyLogEntriesMetadata.getDefaultInstance()) return this; + if (other.hasStartTime()) { + mergeStartTime(other.getStartTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (other.getCancellationRequested() != false) { + setCancellationRequested(other.getCancellationRequested()); + } + if (other.hasRequest()) { + mergeRequest(other.getRequest()); + } + if (other.getProgress() != 0) { + setProgress(other.getProgress()); + } + if (!other.getWriterIdentity().isEmpty()) { + writerIdentity_ = other.writerIdentity_; + bitField0_ |= 0x00000040; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getStartTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getEndTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + state_ = input.readEnum(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: + { + cancellationRequested_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 42: + { + input.readMessage(getRequestFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 48: + { + progress_ = input.readInt32(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 58: + { + writerIdentity_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 58 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + 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 create time of an operation.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return Whether the startTime field is set. + */ + public boolean hasStartTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The create time of an operation.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @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 create time of an operation.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public Builder setStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTime_ = value; + } else { + startTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The create time of an operation.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (startTimeBuilder_ == null) { + startTime_ = builderForValue.build(); + } else { + startTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The create time of an operation.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public Builder mergeStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && startTime_ != null + && startTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getStartTimeBuilder().mergeFrom(value); + } else { + startTime_ = value; + } + } else { + startTimeBuilder_.mergeFrom(value); + } + if (startTime_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The create time of an operation.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public Builder clearStartTime() { + bitField0_ = (bitField0_ & ~0x00000001); + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The create time of an operation.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getStartTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The create time of an operation.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + if (startTimeBuilder_ != null) { + return startTimeBuilder_.getMessageOrBuilder(); + } else { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + } + + /** + * + * + *
+     * The create time of an operation.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + 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 time of an operation.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * The end time of an operation.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @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 time of an operation.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + } else { + endTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The end time of an operation.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The end time of an operation.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && endTime_ != null + && endTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEndTimeBuilder().mergeFrom(value); + } else { + endTime_ = value; + } + } else { + endTimeBuilder_.mergeFrom(value); + } + if (endTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The end time of an operation.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder clearEndTime() { + bitField0_ = (bitField0_ & ~0x00000002); + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The end time of an operation.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getEndTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The end time of an operation.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + + /** + * + * + *
+     * The end time of an operation.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTime(), getParentForChildren(), isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + private int state_ = 0; + + /** + * + * + *
+     * State of an operation.
+     * 
+ * + * .google.logging.v2.OperationState state = 3; + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + + /** + * + * + *
+     * State of an operation.
+     * 
+ * + * .google.logging.v2.OperationState state = 3; + * + * @param value The enum numeric value on the wire for state to set. + * @return This builder for chaining. + */ + public Builder setStateValue(int value) { + state_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * State of an operation.
+     * 
+ * + * .google.logging.v2.OperationState state = 3; + * + * @return The state. + */ + @java.lang.Override + public com.google.logging.v2.OperationState getState() { + com.google.logging.v2.OperationState result = + com.google.logging.v2.OperationState.forNumber(state_); + return result == null ? com.google.logging.v2.OperationState.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * State of an operation.
+     * 
+ * + * .google.logging.v2.OperationState state = 3; + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.logging.v2.OperationState value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + state_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * State of an operation.
+     * 
+ * + * .google.logging.v2.OperationState state = 3; + * + * @return This builder for chaining. + */ + public Builder clearState() { + bitField0_ = (bitField0_ & ~0x00000004); + state_ = 0; + onChanged(); + return this; + } + + private boolean cancellationRequested_; + + /** + * + * + *
+     * Identifies whether the user has requested cancellation of the operation.
+     * 
+ * + * bool cancellation_requested = 4; + * + * @return The cancellationRequested. + */ + @java.lang.Override + public boolean getCancellationRequested() { + return cancellationRequested_; + } + + /** + * + * + *
+     * Identifies whether the user has requested cancellation of the operation.
+     * 
+ * + * bool cancellation_requested = 4; + * + * @param value The cancellationRequested to set. + * @return This builder for chaining. + */ + public Builder setCancellationRequested(boolean value) { + + cancellationRequested_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Identifies whether the user has requested cancellation of the operation.
+     * 
+ * + * bool cancellation_requested = 4; + * + * @return This builder for chaining. + */ + public Builder clearCancellationRequested() { + bitField0_ = (bitField0_ & ~0x00000008); + cancellationRequested_ = false; + onChanged(); + return this; + } + + private com.google.logging.v2.CopyLogEntriesRequest request_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.CopyLogEntriesRequest, + com.google.logging.v2.CopyLogEntriesRequest.Builder, + com.google.logging.v2.CopyLogEntriesRequestOrBuilder> + requestBuilder_; + + /** + * + * + *
+     * CopyLogEntries RPC request.
+     * 
+ * + * .google.logging.v2.CopyLogEntriesRequest request = 5; + * + * @return Whether the request field is set. + */ + public boolean hasRequest() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * CopyLogEntries RPC request.
+     * 
+ * + * .google.logging.v2.CopyLogEntriesRequest request = 5; + * + * @return The request. + */ + public com.google.logging.v2.CopyLogEntriesRequest getRequest() { + if (requestBuilder_ == null) { + return request_ == null + ? com.google.logging.v2.CopyLogEntriesRequest.getDefaultInstance() + : request_; + } else { + return requestBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * CopyLogEntries RPC request.
+     * 
+ * + * .google.logging.v2.CopyLogEntriesRequest request = 5; + */ + public Builder setRequest(com.google.logging.v2.CopyLogEntriesRequest value) { + if (requestBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + request_ = value; + } else { + requestBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * CopyLogEntries RPC request.
+     * 
+ * + * .google.logging.v2.CopyLogEntriesRequest request = 5; + */ + public Builder setRequest(com.google.logging.v2.CopyLogEntriesRequest.Builder builderForValue) { + if (requestBuilder_ == null) { + request_ = builderForValue.build(); + } else { + requestBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * CopyLogEntries RPC request.
+     * 
+ * + * .google.logging.v2.CopyLogEntriesRequest request = 5; + */ + public Builder mergeRequest(com.google.logging.v2.CopyLogEntriesRequest value) { + if (requestBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && request_ != null + && request_ != com.google.logging.v2.CopyLogEntriesRequest.getDefaultInstance()) { + getRequestBuilder().mergeFrom(value); + } else { + request_ = value; + } + } else { + requestBuilder_.mergeFrom(value); + } + if (request_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * CopyLogEntries RPC request.
+     * 
+ * + * .google.logging.v2.CopyLogEntriesRequest request = 5; + */ + public Builder clearRequest() { + bitField0_ = (bitField0_ & ~0x00000010); + request_ = null; + if (requestBuilder_ != null) { + requestBuilder_.dispose(); + requestBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * CopyLogEntries RPC request.
+     * 
+ * + * .google.logging.v2.CopyLogEntriesRequest request = 5; + */ + public com.google.logging.v2.CopyLogEntriesRequest.Builder getRequestBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getRequestFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * CopyLogEntries RPC request.
+     * 
+ * + * .google.logging.v2.CopyLogEntriesRequest request = 5; + */ + public com.google.logging.v2.CopyLogEntriesRequestOrBuilder getRequestOrBuilder() { + if (requestBuilder_ != null) { + return requestBuilder_.getMessageOrBuilder(); + } else { + return request_ == null + ? com.google.logging.v2.CopyLogEntriesRequest.getDefaultInstance() + : request_; + } + } + + /** + * + * + *
+     * CopyLogEntries RPC request.
+     * 
+ * + * .google.logging.v2.CopyLogEntriesRequest request = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.CopyLogEntriesRequest, + com.google.logging.v2.CopyLogEntriesRequest.Builder, + com.google.logging.v2.CopyLogEntriesRequestOrBuilder> + getRequestFieldBuilder() { + if (requestBuilder_ == null) { + requestBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.CopyLogEntriesRequest, + com.google.logging.v2.CopyLogEntriesRequest.Builder, + com.google.logging.v2.CopyLogEntriesRequestOrBuilder>( + getRequest(), getParentForChildren(), isClean()); + request_ = null; + } + return requestBuilder_; + } + + private int progress_; + + /** + * + * + *
+     * Estimated progress of the operation (0 - 100%).
+     * 
+ * + * int32 progress = 6; + * + * @return The progress. + */ + @java.lang.Override + public int getProgress() { + return progress_; + } + + /** + * + * + *
+     * Estimated progress of the operation (0 - 100%).
+     * 
+ * + * int32 progress = 6; + * + * @param value The progress to set. + * @return This builder for chaining. + */ + public Builder setProgress(int value) { + + progress_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Estimated progress of the operation (0 - 100%).
+     * 
+ * + * int32 progress = 6; + * + * @return This builder for chaining. + */ + public Builder clearProgress() { + bitField0_ = (bitField0_ & ~0x00000020); + progress_ = 0; + onChanged(); + return this; + } + + private java.lang.Object writerIdentity_ = ""; + + /** + * + * + *
+     * The IAM identity of a service account that must be granted access to the
+     * destination.
+     *
+     * If the service account is not granted permission to the destination within
+     * an hour, the operation will be cancelled.
+     *
+     * For example: `"serviceAccount:foo@bar.com"`
+     * 
+ * + * string writer_identity = 7; + * + * @return The writerIdentity. + */ + public java.lang.String getWriterIdentity() { + java.lang.Object ref = writerIdentity_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + writerIdentity_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The IAM identity of a service account that must be granted access to the
+     * destination.
+     *
+     * If the service account is not granted permission to the destination within
+     * an hour, the operation will be cancelled.
+     *
+     * For example: `"serviceAccount:foo@bar.com"`
+     * 
+ * + * string writer_identity = 7; + * + * @return The bytes for writerIdentity. + */ + public com.google.protobuf.ByteString getWriterIdentityBytes() { + java.lang.Object ref = writerIdentity_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + writerIdentity_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The IAM identity of a service account that must be granted access to the
+     * destination.
+     *
+     * If the service account is not granted permission to the destination within
+     * an hour, the operation will be cancelled.
+     *
+     * For example: `"serviceAccount:foo@bar.com"`
+     * 
+ * + * string writer_identity = 7; + * + * @param value The writerIdentity to set. + * @return This builder for chaining. + */ + public Builder setWriterIdentity(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + writerIdentity_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * The IAM identity of a service account that must be granted access to the
+     * destination.
+     *
+     * If the service account is not granted permission to the destination within
+     * an hour, the operation will be cancelled.
+     *
+     * For example: `"serviceAccount:foo@bar.com"`
+     * 
+ * + * string writer_identity = 7; + * + * @return This builder for chaining. + */ + public Builder clearWriterIdentity() { + writerIdentity_ = getDefaultInstance().getWriterIdentity(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + + /** + * + * + *
+     * The IAM identity of a service account that must be granted access to the
+     * destination.
+     *
+     * If the service account is not granted permission to the destination within
+     * an hour, the operation will be cancelled.
+     *
+     * For example: `"serviceAccount:foo@bar.com"`
+     * 
+ * + * string writer_identity = 7; + * + * @param value The bytes for writerIdentity to set. + * @return This builder for chaining. + */ + public Builder setWriterIdentityBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + writerIdentity_ = value; + bitField0_ |= 0x00000040; + 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.logging.v2.CopyLogEntriesMetadata) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.CopyLogEntriesMetadata) + private static final com.google.logging.v2.CopyLogEntriesMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.CopyLogEntriesMetadata(); + } + + public static com.google.logging.v2.CopyLogEntriesMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CopyLogEntriesMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.CopyLogEntriesMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CopyLogEntriesMetadataOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CopyLogEntriesMetadataOrBuilder.java new file mode 100644 index 000000000000..a7f6eca408ac --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CopyLogEntriesMetadataOrBuilder.java @@ -0,0 +1,227 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface CopyLogEntriesMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.CopyLogEntriesMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The create time of an operation.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return Whether the startTime field is set. + */ + boolean hasStartTime(); + + /** + * + * + *
+   * The create time of an operation.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return The startTime. + */ + com.google.protobuf.Timestamp getStartTime(); + + /** + * + * + *
+   * The create time of an operation.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); + + /** + * + * + *
+   * The end time of an operation.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + + /** + * + * + *
+   * The end time of an operation.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + + /** + * + * + *
+   * The end time of an operation.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); + + /** + * + * + *
+   * State of an operation.
+   * 
+ * + * .google.logging.v2.OperationState state = 3; + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + + /** + * + * + *
+   * State of an operation.
+   * 
+ * + * .google.logging.v2.OperationState state = 3; + * + * @return The state. + */ + com.google.logging.v2.OperationState getState(); + + /** + * + * + *
+   * Identifies whether the user has requested cancellation of the operation.
+   * 
+ * + * bool cancellation_requested = 4; + * + * @return The cancellationRequested. + */ + boolean getCancellationRequested(); + + /** + * + * + *
+   * CopyLogEntries RPC request.
+   * 
+ * + * .google.logging.v2.CopyLogEntriesRequest request = 5; + * + * @return Whether the request field is set. + */ + boolean hasRequest(); + + /** + * + * + *
+   * CopyLogEntries RPC request.
+   * 
+ * + * .google.logging.v2.CopyLogEntriesRequest request = 5; + * + * @return The request. + */ + com.google.logging.v2.CopyLogEntriesRequest getRequest(); + + /** + * + * + *
+   * CopyLogEntries RPC request.
+   * 
+ * + * .google.logging.v2.CopyLogEntriesRequest request = 5; + */ + com.google.logging.v2.CopyLogEntriesRequestOrBuilder getRequestOrBuilder(); + + /** + * + * + *
+   * Estimated progress of the operation (0 - 100%).
+   * 
+ * + * int32 progress = 6; + * + * @return The progress. + */ + int getProgress(); + + /** + * + * + *
+   * The IAM identity of a service account that must be granted access to the
+   * destination.
+   *
+   * If the service account is not granted permission to the destination within
+   * an hour, the operation will be cancelled.
+   *
+   * For example: `"serviceAccount:foo@bar.com"`
+   * 
+ * + * string writer_identity = 7; + * + * @return The writerIdentity. + */ + java.lang.String getWriterIdentity(); + + /** + * + * + *
+   * The IAM identity of a service account that must be granted access to the
+   * destination.
+   *
+   * If the service account is not granted permission to the destination within
+   * an hour, the operation will be cancelled.
+   *
+   * For example: `"serviceAccount:foo@bar.com"`
+   * 
+ * + * string writer_identity = 7; + * + * @return The bytes for writerIdentity. + */ + com.google.protobuf.ByteString getWriterIdentityBytes(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CopyLogEntriesRequest.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CopyLogEntriesRequest.java new file mode 100644 index 000000000000..becd41ae8c26 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CopyLogEntriesRequest.java @@ -0,0 +1,1046 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * The parameters to CopyLogEntries.
+ * 
+ * + * Protobuf type {@code google.logging.v2.CopyLogEntriesRequest} + */ +public final class CopyLogEntriesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.CopyLogEntriesRequest) + CopyLogEntriesRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use CopyLogEntriesRequest.newBuilder() to construct. + private CopyLogEntriesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CopyLogEntriesRequest() { + name_ = ""; + filter_ = ""; + destination_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CopyLogEntriesRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_CopyLogEntriesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_CopyLogEntriesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.CopyLogEntriesRequest.class, + com.google.logging.v2.CopyLogEntriesRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. Log bucket from which to copy log entries.
+   *
+   * For example:
+   *
+   *   `"projects/my-project/locations/global/buckets/my-source-bucket"`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. Log bucket from which to copy log entries.
+   *
+   * For example:
+   *
+   *   `"projects/my-project/locations/global/buckets/my-source-bucket"`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + + /** + * + * + *
+   * Optional. A filter specifying which log entries to copy. The filter must be
+   * no more than 20k characters. An empty filter matches all log entries.
+   * 
+ * + * string filter = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. A filter specifying which log entries to copy. The filter must be
+   * no more than 20k characters. An empty filter matches all log entries.
+   * 
+ * + * string filter = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESTINATION_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object destination_ = ""; + + /** + * + * + *
+   * Required. Destination to which to copy log entries.
+   * 
+ * + * string destination = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The destination. + */ + @java.lang.Override + public java.lang.String getDestination() { + java.lang.Object ref = destination_; + 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(); + destination_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. Destination to which to copy log entries.
+   * 
+ * + * string destination = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for destination. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDestinationBytes() { + java.lang.Object ref = destination_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + destination_ = 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(destination_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, destination_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(destination_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, destination_); + } + size += getUnknownFields().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.logging.v2.CopyLogEntriesRequest)) { + return super.equals(obj); + } + com.google.logging.v2.CopyLogEntriesRequest other = + (com.google.logging.v2.CopyLogEntriesRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getDestination().equals(other.getDestination())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + DESTINATION_FIELD_NUMBER; + hash = (53 * hash) + getDestination().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.CopyLogEntriesRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.CopyLogEntriesRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.CopyLogEntriesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.CopyLogEntriesRequest 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.logging.v2.CopyLogEntriesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.CopyLogEntriesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.CopyLogEntriesRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.CopyLogEntriesRequest 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.logging.v2.CopyLogEntriesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.CopyLogEntriesRequest 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.logging.v2.CopyLogEntriesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.CopyLogEntriesRequest 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.logging.v2.CopyLogEntriesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The parameters to CopyLogEntries.
+   * 
+ * + * Protobuf type {@code google.logging.v2.CopyLogEntriesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.CopyLogEntriesRequest) + com.google.logging.v2.CopyLogEntriesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_CopyLogEntriesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_CopyLogEntriesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.CopyLogEntriesRequest.class, + com.google.logging.v2.CopyLogEntriesRequest.Builder.class); + } + + // Construct using com.google.logging.v2.CopyLogEntriesRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + filter_ = ""; + destination_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_CopyLogEntriesRequest_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.CopyLogEntriesRequest getDefaultInstanceForType() { + return com.google.logging.v2.CopyLogEntriesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.CopyLogEntriesRequest build() { + com.google.logging.v2.CopyLogEntriesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.CopyLogEntriesRequest buildPartial() { + com.google.logging.v2.CopyLogEntriesRequest result = + new com.google.logging.v2.CopyLogEntriesRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.logging.v2.CopyLogEntriesRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.filter_ = filter_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.destination_ = destination_; + } + } + + @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.logging.v2.CopyLogEntriesRequest) { + return mergeFrom((com.google.logging.v2.CopyLogEntriesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.CopyLogEntriesRequest other) { + if (other == com.google.logging.v2.CopyLogEntriesRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getDestination().isEmpty()) { + destination_ = other.destination_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 26: + { + filter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 26 + case 34: + { + destination_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. Log bucket from which to copy log entries.
+     *
+     * For example:
+     *
+     *   `"projects/my-project/locations/global/buckets/my-source-bucket"`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. Log bucket from which to copy log entries.
+     *
+     * For example:
+     *
+     *   `"projects/my-project/locations/global/buckets/my-source-bucket"`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. Log bucket from which to copy log entries.
+     *
+     * For example:
+     *
+     *   `"projects/my-project/locations/global/buckets/my-source-bucket"`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Log bucket from which to copy log entries.
+     *
+     * For example:
+     *
+     *   `"projects/my-project/locations/global/buckets/my-source-bucket"`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Log bucket from which to copy log entries.
+     *
+     * For example:
+     *
+     *   `"projects/my-project/locations/global/buckets/my-source-bucket"`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + + /** + * + * + *
+     * Optional. A filter specifying which log entries to copy. The filter must be
+     * no more than 20k characters. An empty filter matches all log entries.
+     * 
+ * + * string filter = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. A filter specifying which log entries to copy. The filter must be
+     * no more than 20k characters. An empty filter matches all log entries.
+     * 
+ * + * string filter = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. A filter specifying which log entries to copy. The filter must be
+     * no more than 20k characters. An empty filter matches all log entries.
+     * 
+ * + * string filter = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. A filter specifying which log entries to copy. The filter must be
+     * no more than 20k characters. An empty filter matches all log entries.
+     * 
+ * + * string filter = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. A filter specifying which log entries to copy. The filter must be
+     * no more than 20k characters. An empty filter matches all log entries.
+     * 
+ * + * string filter = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + filter_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object destination_ = ""; + + /** + * + * + *
+     * Required. Destination to which to copy log entries.
+     * 
+ * + * string destination = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The destination. + */ + public java.lang.String getDestination() { + java.lang.Object ref = destination_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + destination_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. Destination to which to copy log entries.
+     * 
+ * + * string destination = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for destination. + */ + public com.google.protobuf.ByteString getDestinationBytes() { + java.lang.Object ref = destination_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + destination_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. Destination to which to copy log entries.
+     * 
+ * + * string destination = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The destination to set. + * @return This builder for chaining. + */ + public Builder setDestination(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + destination_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Destination to which to copy log entries.
+     * 
+ * + * string destination = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearDestination() { + destination_ = getDefaultInstance().getDestination(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Destination to which to copy log entries.
+     * 
+ * + * string destination = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for destination to set. + * @return This builder for chaining. + */ + public Builder setDestinationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + destination_ = value; + bitField0_ |= 0x00000004; + 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.logging.v2.CopyLogEntriesRequest) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.CopyLogEntriesRequest) + private static final com.google.logging.v2.CopyLogEntriesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.CopyLogEntriesRequest(); + } + + public static com.google.logging.v2.CopyLogEntriesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CopyLogEntriesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.CopyLogEntriesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CopyLogEntriesRequestOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CopyLogEntriesRequestOrBuilder.java new file mode 100644 index 000000000000..85b163ba252a --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CopyLogEntriesRequestOrBuilder.java @@ -0,0 +1,114 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface CopyLogEntriesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.CopyLogEntriesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Log bucket from which to copy log entries.
+   *
+   * For example:
+   *
+   *   `"projects/my-project/locations/global/buckets/my-source-bucket"`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Required. Log bucket from which to copy log entries.
+   *
+   * For example:
+   *
+   *   `"projects/my-project/locations/global/buckets/my-source-bucket"`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. A filter specifying which log entries to copy. The filter must be
+   * no more than 20k characters. An empty filter matches all log entries.
+   * 
+ * + * string filter = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + java.lang.String getFilter(); + + /** + * + * + *
+   * Optional. A filter specifying which log entries to copy. The filter must be
+   * no more than 20k characters. An empty filter matches all log entries.
+   * 
+ * + * string filter = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Required. Destination to which to copy log entries.
+   * 
+ * + * string destination = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The destination. + */ + java.lang.String getDestination(); + + /** + * + * + *
+   * Required. Destination to which to copy log entries.
+   * 
+ * + * string destination = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for destination. + */ + com.google.protobuf.ByteString getDestinationBytes(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CopyLogEntriesResponse.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CopyLogEntriesResponse.java new file mode 100644 index 000000000000..a4b8ec3b7e79 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CopyLogEntriesResponse.java @@ -0,0 +1,540 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * Response type for CopyLogEntries long running operations.
+ * 
+ * + * Protobuf type {@code google.logging.v2.CopyLogEntriesResponse} + */ +public final class CopyLogEntriesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.CopyLogEntriesResponse) + CopyLogEntriesResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use CopyLogEntriesResponse.newBuilder() to construct. + private CopyLogEntriesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CopyLogEntriesResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CopyLogEntriesResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_CopyLogEntriesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_CopyLogEntriesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.CopyLogEntriesResponse.class, + com.google.logging.v2.CopyLogEntriesResponse.Builder.class); + } + + public static final int LOG_ENTRIES_COPIED_COUNT_FIELD_NUMBER = 1; + private long logEntriesCopiedCount_ = 0L; + + /** + * + * + *
+   * Number of log entries copied.
+   * 
+ * + * int64 log_entries_copied_count = 1; + * + * @return The logEntriesCopiedCount. + */ + @java.lang.Override + public long getLogEntriesCopiedCount() { + return logEntriesCopiedCount_; + } + + 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 (logEntriesCopiedCount_ != 0L) { + output.writeInt64(1, logEntriesCopiedCount_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (logEntriesCopiedCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, logEntriesCopiedCount_); + } + size += getUnknownFields().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.logging.v2.CopyLogEntriesResponse)) { + return super.equals(obj); + } + com.google.logging.v2.CopyLogEntriesResponse other = + (com.google.logging.v2.CopyLogEntriesResponse) obj; + + if (getLogEntriesCopiedCount() != other.getLogEntriesCopiedCount()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + LOG_ENTRIES_COPIED_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getLogEntriesCopiedCount()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.CopyLogEntriesResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.CopyLogEntriesResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.CopyLogEntriesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.CopyLogEntriesResponse 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.logging.v2.CopyLogEntriesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.CopyLogEntriesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.CopyLogEntriesResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.CopyLogEntriesResponse 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.logging.v2.CopyLogEntriesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.CopyLogEntriesResponse 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.logging.v2.CopyLogEntriesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.CopyLogEntriesResponse 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.logging.v2.CopyLogEntriesResponse 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 type for CopyLogEntries long running operations.
+   * 
+ * + * Protobuf type {@code google.logging.v2.CopyLogEntriesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.CopyLogEntriesResponse) + com.google.logging.v2.CopyLogEntriesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_CopyLogEntriesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_CopyLogEntriesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.CopyLogEntriesResponse.class, + com.google.logging.v2.CopyLogEntriesResponse.Builder.class); + } + + // Construct using com.google.logging.v2.CopyLogEntriesResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + logEntriesCopiedCount_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_CopyLogEntriesResponse_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.CopyLogEntriesResponse getDefaultInstanceForType() { + return com.google.logging.v2.CopyLogEntriesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.CopyLogEntriesResponse build() { + com.google.logging.v2.CopyLogEntriesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.CopyLogEntriesResponse buildPartial() { + com.google.logging.v2.CopyLogEntriesResponse result = + new com.google.logging.v2.CopyLogEntriesResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.logging.v2.CopyLogEntriesResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.logEntriesCopiedCount_ = logEntriesCopiedCount_; + } + } + + @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.logging.v2.CopyLogEntriesResponse) { + return mergeFrom((com.google.logging.v2.CopyLogEntriesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.CopyLogEntriesResponse other) { + if (other == com.google.logging.v2.CopyLogEntriesResponse.getDefaultInstance()) return this; + if (other.getLogEntriesCopiedCount() != 0L) { + setLogEntriesCopiedCount(other.getLogEntriesCopiedCount()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + logEntriesCopiedCount_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private long logEntriesCopiedCount_; + + /** + * + * + *
+     * Number of log entries copied.
+     * 
+ * + * int64 log_entries_copied_count = 1; + * + * @return The logEntriesCopiedCount. + */ + @java.lang.Override + public long getLogEntriesCopiedCount() { + return logEntriesCopiedCount_; + } + + /** + * + * + *
+     * Number of log entries copied.
+     * 
+ * + * int64 log_entries_copied_count = 1; + * + * @param value The logEntriesCopiedCount to set. + * @return This builder for chaining. + */ + public Builder setLogEntriesCopiedCount(long value) { + + logEntriesCopiedCount_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Number of log entries copied.
+     * 
+ * + * int64 log_entries_copied_count = 1; + * + * @return This builder for chaining. + */ + public Builder clearLogEntriesCopiedCount() { + bitField0_ = (bitField0_ & ~0x00000001); + logEntriesCopiedCount_ = 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.logging.v2.CopyLogEntriesResponse) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.CopyLogEntriesResponse) + private static final com.google.logging.v2.CopyLogEntriesResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.CopyLogEntriesResponse(); + } + + public static com.google.logging.v2.CopyLogEntriesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CopyLogEntriesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.CopyLogEntriesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CopyLogEntriesResponseOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CopyLogEntriesResponseOrBuilder.java new file mode 100644 index 000000000000..34c265661911 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CopyLogEntriesResponseOrBuilder.java @@ -0,0 +1,39 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface CopyLogEntriesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.CopyLogEntriesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Number of log entries copied.
+   * 
+ * + * int64 log_entries_copied_count = 1; + * + * @return The logEntriesCopiedCount. + */ + long getLogEntriesCopiedCount(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateBucketRequest.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateBucketRequest.java new file mode 100644 index 000000000000..53c6c1bfc638 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateBucketRequest.java @@ -0,0 +1,1208 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * The parameters to `CreateBucket`.
+ * 
+ * + * Protobuf type {@code google.logging.v2.CreateBucketRequest} + */ +public final class CreateBucketRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.CreateBucketRequest) + CreateBucketRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use CreateBucketRequest.newBuilder() to construct. + private CreateBucketRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateBucketRequest() { + parent_ = ""; + bucketId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateBucketRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_CreateBucketRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_CreateBucketRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.CreateBucketRequest.class, + com.google.logging.v2.CreateBucketRequest.Builder.class); + } + + private int bitField0_; + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
+   * Required. The resource in which to create the log bucket:
+   *
+   *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]"
+   *
+   * For example:
+   *
+   *   `"projects/my-project/locations/global"`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The resource in which to create the log bucket:
+   *
+   *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]"
+   *
+   * For example:
+   *
+   *   `"projects/my-project/locations/global"`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BUCKET_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object bucketId_ = ""; + + /** + * + * + *
+   * Required. A client-assigned identifier such as `"my-bucket"`. Identifiers
+   * are limited to 100 characters and can include only letters, digits,
+   * underscores, hyphens, and periods.
+   * 
+ * + * string bucket_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bucketId. + */ + @java.lang.Override + public java.lang.String getBucketId() { + java.lang.Object ref = bucketId_; + 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(); + bucketId_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. A client-assigned identifier such as `"my-bucket"`. Identifiers
+   * are limited to 100 characters and can include only letters, digits,
+   * underscores, hyphens, and periods.
+   * 
+ * + * string bucket_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for bucketId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBucketIdBytes() { + java.lang.Object ref = bucketId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + bucketId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BUCKET_FIELD_NUMBER = 3; + private com.google.logging.v2.LogBucket bucket_; + + /** + * + * + *
+   * Required. The new bucket. The region specified in the new bucket must be
+   * compliant with any Location Restriction Org Policy. The name field in the
+   * bucket is ignored.
+   * 
+ * + * .google.logging.v2.LogBucket bucket = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the bucket field is set. + */ + @java.lang.Override + public boolean hasBucket() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Required. The new bucket. The region specified in the new bucket must be
+   * compliant with any Location Restriction Org Policy. The name field in the
+   * bucket is ignored.
+   * 
+ * + * .google.logging.v2.LogBucket bucket = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bucket. + */ + @java.lang.Override + public com.google.logging.v2.LogBucket getBucket() { + return bucket_ == null ? com.google.logging.v2.LogBucket.getDefaultInstance() : bucket_; + } + + /** + * + * + *
+   * Required. The new bucket. The region specified in the new bucket must be
+   * compliant with any Location Restriction Org Policy. The name field in the
+   * bucket is ignored.
+   * 
+ * + * .google.logging.v2.LogBucket bucket = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + @java.lang.Override + public com.google.logging.v2.LogBucketOrBuilder getBucketOrBuilder() { + return bucket_ == null ? com.google.logging.v2.LogBucket.getDefaultInstance() : bucket_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(bucketId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, bucketId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getBucket()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(bucketId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, bucketId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getBucket()); + } + size += getUnknownFields().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.logging.v2.CreateBucketRequest)) { + return super.equals(obj); + } + com.google.logging.v2.CreateBucketRequest other = + (com.google.logging.v2.CreateBucketRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getBucketId().equals(other.getBucketId())) return false; + if (hasBucket() != other.hasBucket()) return false; + if (hasBucket()) { + if (!getBucket().equals(other.getBucket())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + BUCKET_ID_FIELD_NUMBER; + hash = (53 * hash) + getBucketId().hashCode(); + if (hasBucket()) { + hash = (37 * hash) + BUCKET_FIELD_NUMBER; + hash = (53 * hash) + getBucket().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.CreateBucketRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.CreateBucketRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.CreateBucketRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.CreateBucketRequest 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.logging.v2.CreateBucketRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.CreateBucketRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.CreateBucketRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.CreateBucketRequest 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.logging.v2.CreateBucketRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.CreateBucketRequest 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.logging.v2.CreateBucketRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.CreateBucketRequest 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.logging.v2.CreateBucketRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The parameters to `CreateBucket`.
+   * 
+ * + * Protobuf type {@code google.logging.v2.CreateBucketRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.CreateBucketRequest) + com.google.logging.v2.CreateBucketRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_CreateBucketRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_CreateBucketRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.CreateBucketRequest.class, + com.google.logging.v2.CreateBucketRequest.Builder.class); + } + + // Construct using com.google.logging.v2.CreateBucketRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getBucketFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + bucketId_ = ""; + bucket_ = null; + if (bucketBuilder_ != null) { + bucketBuilder_.dispose(); + bucketBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_CreateBucketRequest_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.CreateBucketRequest getDefaultInstanceForType() { + return com.google.logging.v2.CreateBucketRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.CreateBucketRequest build() { + com.google.logging.v2.CreateBucketRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.CreateBucketRequest buildPartial() { + com.google.logging.v2.CreateBucketRequest result = + new com.google.logging.v2.CreateBucketRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.logging.v2.CreateBucketRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.bucketId_ = bucketId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.bucket_ = bucketBuilder_ == null ? bucket_ : bucketBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @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.logging.v2.CreateBucketRequest) { + return mergeFrom((com.google.logging.v2.CreateBucketRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.CreateBucketRequest other) { + if (other == com.google.logging.v2.CreateBucketRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getBucketId().isEmpty()) { + bucketId_ = other.bucketId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasBucket()) { + mergeBucket(other.getBucket()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + bucketId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getBucketFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + + /** + * + * + *
+     * Required. The resource in which to create the log bucket:
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/locations/global"`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The resource in which to create the log bucket:
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/locations/global"`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The resource in which to create the log bucket:
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/locations/global"`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The resource in which to create the log bucket:
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/locations/global"`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The resource in which to create the log bucket:
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/locations/global"`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object bucketId_ = ""; + + /** + * + * + *
+     * Required. A client-assigned identifier such as `"my-bucket"`. Identifiers
+     * are limited to 100 characters and can include only letters, digits,
+     * underscores, hyphens, and periods.
+     * 
+ * + * string bucket_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bucketId. + */ + public java.lang.String getBucketId() { + java.lang.Object ref = bucketId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + bucketId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. A client-assigned identifier such as `"my-bucket"`. Identifiers
+     * are limited to 100 characters and can include only letters, digits,
+     * underscores, hyphens, and periods.
+     * 
+ * + * string bucket_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for bucketId. + */ + public com.google.protobuf.ByteString getBucketIdBytes() { + java.lang.Object ref = bucketId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + bucketId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. A client-assigned identifier such as `"my-bucket"`. Identifiers
+     * are limited to 100 characters and can include only letters, digits,
+     * underscores, hyphens, and periods.
+     * 
+ * + * string bucket_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bucketId to set. + * @return This builder for chaining. + */ + public Builder setBucketId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bucketId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. A client-assigned identifier such as `"my-bucket"`. Identifiers
+     * are limited to 100 characters and can include only letters, digits,
+     * underscores, hyphens, and periods.
+     * 
+ * + * string bucket_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearBucketId() { + bucketId_ = getDefaultInstance().getBucketId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. A client-assigned identifier such as `"my-bucket"`. Identifiers
+     * are limited to 100 characters and can include only letters, digits,
+     * underscores, hyphens, and periods.
+     * 
+ * + * string bucket_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for bucketId to set. + * @return This builder for chaining. + */ + public Builder setBucketIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + bucketId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.logging.v2.LogBucket bucket_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogBucket, + com.google.logging.v2.LogBucket.Builder, + com.google.logging.v2.LogBucketOrBuilder> + bucketBuilder_; + + /** + * + * + *
+     * Required. The new bucket. The region specified in the new bucket must be
+     * compliant with any Location Restriction Org Policy. The name field in the
+     * bucket is ignored.
+     * 
+ * + * .google.logging.v2.LogBucket bucket = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the bucket field is set. + */ + public boolean hasBucket() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Required. The new bucket. The region specified in the new bucket must be
+     * compliant with any Location Restriction Org Policy. The name field in the
+     * bucket is ignored.
+     * 
+ * + * .google.logging.v2.LogBucket bucket = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The bucket. + */ + public com.google.logging.v2.LogBucket getBucket() { + if (bucketBuilder_ == null) { + return bucket_ == null ? com.google.logging.v2.LogBucket.getDefaultInstance() : bucket_; + } else { + return bucketBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. The new bucket. The region specified in the new bucket must be
+     * compliant with any Location Restriction Org Policy. The name field in the
+     * bucket is ignored.
+     * 
+ * + * .google.logging.v2.LogBucket bucket = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBucket(com.google.logging.v2.LogBucket value) { + if (bucketBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + bucket_ = value; + } else { + bucketBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The new bucket. The region specified in the new bucket must be
+     * compliant with any Location Restriction Org Policy. The name field in the
+     * bucket is ignored.
+     * 
+ * + * .google.logging.v2.LogBucket bucket = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBucket(com.google.logging.v2.LogBucket.Builder builderForValue) { + if (bucketBuilder_ == null) { + bucket_ = builderForValue.build(); + } else { + bucketBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The new bucket. The region specified in the new bucket must be
+     * compliant with any Location Restriction Org Policy. The name field in the
+     * bucket is ignored.
+     * 
+ * + * .google.logging.v2.LogBucket bucket = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeBucket(com.google.logging.v2.LogBucket value) { + if (bucketBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && bucket_ != null + && bucket_ != com.google.logging.v2.LogBucket.getDefaultInstance()) { + getBucketBuilder().mergeFrom(value); + } else { + bucket_ = value; + } + } else { + bucketBuilder_.mergeFrom(value); + } + if (bucket_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. The new bucket. The region specified in the new bucket must be
+     * compliant with any Location Restriction Org Policy. The name field in the
+     * bucket is ignored.
+     * 
+ * + * .google.logging.v2.LogBucket bucket = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearBucket() { + bitField0_ = (bitField0_ & ~0x00000004); + bucket_ = null; + if (bucketBuilder_ != null) { + bucketBuilder_.dispose(); + bucketBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The new bucket. The region specified in the new bucket must be
+     * compliant with any Location Restriction Org Policy. The name field in the
+     * bucket is ignored.
+     * 
+ * + * .google.logging.v2.LogBucket bucket = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.logging.v2.LogBucket.Builder getBucketBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getBucketFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. The new bucket. The region specified in the new bucket must be
+     * compliant with any Location Restriction Org Policy. The name field in the
+     * bucket is ignored.
+     * 
+ * + * .google.logging.v2.LogBucket bucket = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.logging.v2.LogBucketOrBuilder getBucketOrBuilder() { + if (bucketBuilder_ != null) { + return bucketBuilder_.getMessageOrBuilder(); + } else { + return bucket_ == null ? com.google.logging.v2.LogBucket.getDefaultInstance() : bucket_; + } + } + + /** + * + * + *
+     * Required. The new bucket. The region specified in the new bucket must be
+     * compliant with any Location Restriction Org Policy. The name field in the
+     * bucket is ignored.
+     * 
+ * + * .google.logging.v2.LogBucket bucket = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogBucket, + com.google.logging.v2.LogBucket.Builder, + com.google.logging.v2.LogBucketOrBuilder> + getBucketFieldBuilder() { + if (bucketBuilder_ == null) { + bucketBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogBucket, + com.google.logging.v2.LogBucket.Builder, + com.google.logging.v2.LogBucketOrBuilder>( + getBucket(), getParentForChildren(), isClean()); + bucket_ = null; + } + return bucketBuilder_; + } + + @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.logging.v2.CreateBucketRequest) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.CreateBucketRequest) + private static final com.google.logging.v2.CreateBucketRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.CreateBucketRequest(); + } + + public static com.google.logging.v2.CreateBucketRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateBucketRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.CreateBucketRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateBucketRequestOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateBucketRequestOrBuilder.java new file mode 100644 index 000000000000..09a07f8afb13 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateBucketRequestOrBuilder.java @@ -0,0 +1,141 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface CreateBucketRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.CreateBucketRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource in which to create the log bucket:
+   *
+   *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]"
+   *
+   * For example:
+   *
+   *   `"projects/my-project/locations/global"`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
+   * Required. The resource in which to create the log bucket:
+   *
+   *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]"
+   *
+   * For example:
+   *
+   *   `"projects/my-project/locations/global"`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. A client-assigned identifier such as `"my-bucket"`. Identifiers
+   * are limited to 100 characters and can include only letters, digits,
+   * underscores, hyphens, and periods.
+   * 
+ * + * string bucket_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bucketId. + */ + java.lang.String getBucketId(); + + /** + * + * + *
+   * Required. A client-assigned identifier such as `"my-bucket"`. Identifiers
+   * are limited to 100 characters and can include only letters, digits,
+   * underscores, hyphens, and periods.
+   * 
+ * + * string bucket_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for bucketId. + */ + com.google.protobuf.ByteString getBucketIdBytes(); + + /** + * + * + *
+   * Required. The new bucket. The region specified in the new bucket must be
+   * compliant with any Location Restriction Org Policy. The name field in the
+   * bucket is ignored.
+   * 
+ * + * .google.logging.v2.LogBucket bucket = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the bucket field is set. + */ + boolean hasBucket(); + + /** + * + * + *
+   * Required. The new bucket. The region specified in the new bucket must be
+   * compliant with any Location Restriction Org Policy. The name field in the
+   * bucket is ignored.
+   * 
+ * + * .google.logging.v2.LogBucket bucket = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bucket. + */ + com.google.logging.v2.LogBucket getBucket(); + + /** + * + * + *
+   * Required. The new bucket. The region specified in the new bucket must be
+   * compliant with any Location Restriction Org Policy. The name field in the
+   * bucket is ignored.
+   * 
+ * + * .google.logging.v2.LogBucket bucket = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + com.google.logging.v2.LogBucketOrBuilder getBucketOrBuilder(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateExclusionRequest.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateExclusionRequest.java new file mode 100644 index 000000000000..b5cfe176cb68 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateExclusionRequest.java @@ -0,0 +1,1041 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * The parameters to `CreateExclusion`.
+ * 
+ * + * Protobuf type {@code google.logging.v2.CreateExclusionRequest} + */ +public final class CreateExclusionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.CreateExclusionRequest) + CreateExclusionRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use CreateExclusionRequest.newBuilder() to construct. + private CreateExclusionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateExclusionRequest() { + parent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateExclusionRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_CreateExclusionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_CreateExclusionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.CreateExclusionRequest.class, + com.google.logging.v2.CreateExclusionRequest.Builder.class); + } + + private int bitField0_; + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
+   * Required. The parent resource in which to create the exclusion:
+   *
+   *     "projects/[PROJECT_ID]"
+   *     "organizations/[ORGANIZATION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+   *     "folders/[FOLDER_ID]"
+   *
+   * For examples:
+   *
+   *   `"projects/my-logging-project"`
+   *   `"organizations/123456789"`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The parent resource in which to create the exclusion:
+   *
+   *     "projects/[PROJECT_ID]"
+   *     "organizations/[ORGANIZATION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+   *     "folders/[FOLDER_ID]"
+   *
+   * For examples:
+   *
+   *   `"projects/my-logging-project"`
+   *   `"organizations/123456789"`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EXCLUSION_FIELD_NUMBER = 2; + private com.google.logging.v2.LogExclusion exclusion_; + + /** + * + * + *
+   * Required. The new exclusion, whose `name` parameter is an exclusion name
+   * that is not already used in the parent resource.
+   * 
+ * + * .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the exclusion field is set. + */ + @java.lang.Override + public boolean hasExclusion() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Required. The new exclusion, whose `name` parameter is an exclusion name
+   * that is not already used in the parent resource.
+   * 
+ * + * .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The exclusion. + */ + @java.lang.Override + public com.google.logging.v2.LogExclusion getExclusion() { + return exclusion_ == null + ? com.google.logging.v2.LogExclusion.getDefaultInstance() + : exclusion_; + } + + /** + * + * + *
+   * Required. The new exclusion, whose `name` parameter is an exclusion name
+   * that is not already used in the parent resource.
+   * 
+ * + * .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.logging.v2.LogExclusionOrBuilder getExclusionOrBuilder() { + return exclusion_ == null + ? com.google.logging.v2.LogExclusion.getDefaultInstance() + : exclusion_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getExclusion()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getExclusion()); + } + size += getUnknownFields().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.logging.v2.CreateExclusionRequest)) { + return super.equals(obj); + } + com.google.logging.v2.CreateExclusionRequest other = + (com.google.logging.v2.CreateExclusionRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasExclusion() != other.hasExclusion()) return false; + if (hasExclusion()) { + if (!getExclusion().equals(other.getExclusion())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasExclusion()) { + hash = (37 * hash) + EXCLUSION_FIELD_NUMBER; + hash = (53 * hash) + getExclusion().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.CreateExclusionRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.CreateExclusionRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.CreateExclusionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.CreateExclusionRequest 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.logging.v2.CreateExclusionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.CreateExclusionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.CreateExclusionRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.CreateExclusionRequest 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.logging.v2.CreateExclusionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.CreateExclusionRequest 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.logging.v2.CreateExclusionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.CreateExclusionRequest 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.logging.v2.CreateExclusionRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The parameters to `CreateExclusion`.
+   * 
+ * + * Protobuf type {@code google.logging.v2.CreateExclusionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.CreateExclusionRequest) + com.google.logging.v2.CreateExclusionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_CreateExclusionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_CreateExclusionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.CreateExclusionRequest.class, + com.google.logging.v2.CreateExclusionRequest.Builder.class); + } + + // Construct using com.google.logging.v2.CreateExclusionRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getExclusionFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + exclusion_ = null; + if (exclusionBuilder_ != null) { + exclusionBuilder_.dispose(); + exclusionBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_CreateExclusionRequest_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.CreateExclusionRequest getDefaultInstanceForType() { + return com.google.logging.v2.CreateExclusionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.CreateExclusionRequest build() { + com.google.logging.v2.CreateExclusionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.CreateExclusionRequest buildPartial() { + com.google.logging.v2.CreateExclusionRequest result = + new com.google.logging.v2.CreateExclusionRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.logging.v2.CreateExclusionRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.exclusion_ = exclusionBuilder_ == null ? exclusion_ : exclusionBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @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.logging.v2.CreateExclusionRequest) { + return mergeFrom((com.google.logging.v2.CreateExclusionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.CreateExclusionRequest other) { + if (other == com.google.logging.v2.CreateExclusionRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasExclusion()) { + mergeExclusion(other.getExclusion()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getExclusionFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + + /** + * + * + *
+     * Required. The parent resource in which to create the exclusion:
+     *
+     *     "projects/[PROJECT_ID]"
+     *     "organizations/[ORGANIZATION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+     *     "folders/[FOLDER_ID]"
+     *
+     * For examples:
+     *
+     *   `"projects/my-logging-project"`
+     *   `"organizations/123456789"`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The parent resource in which to create the exclusion:
+     *
+     *     "projects/[PROJECT_ID]"
+     *     "organizations/[ORGANIZATION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+     *     "folders/[FOLDER_ID]"
+     *
+     * For examples:
+     *
+     *   `"projects/my-logging-project"`
+     *   `"organizations/123456789"`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The parent resource in which to create the exclusion:
+     *
+     *     "projects/[PROJECT_ID]"
+     *     "organizations/[ORGANIZATION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+     *     "folders/[FOLDER_ID]"
+     *
+     * For examples:
+     *
+     *   `"projects/my-logging-project"`
+     *   `"organizations/123456789"`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The parent resource in which to create the exclusion:
+     *
+     *     "projects/[PROJECT_ID]"
+     *     "organizations/[ORGANIZATION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+     *     "folders/[FOLDER_ID]"
+     *
+     * For examples:
+     *
+     *   `"projects/my-logging-project"`
+     *   `"organizations/123456789"`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The parent resource in which to create the exclusion:
+     *
+     *     "projects/[PROJECT_ID]"
+     *     "organizations/[ORGANIZATION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+     *     "folders/[FOLDER_ID]"
+     *
+     * For examples:
+     *
+     *   `"projects/my-logging-project"`
+     *   `"organizations/123456789"`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.logging.v2.LogExclusion exclusion_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogExclusion, + com.google.logging.v2.LogExclusion.Builder, + com.google.logging.v2.LogExclusionOrBuilder> + exclusionBuilder_; + + /** + * + * + *
+     * Required. The new exclusion, whose `name` parameter is an exclusion name
+     * that is not already used in the parent resource.
+     * 
+ * + * + * .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the exclusion field is set. + */ + public boolean hasExclusion() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Required. The new exclusion, whose `name` parameter is an exclusion name
+     * that is not already used in the parent resource.
+     * 
+ * + * + * .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The exclusion. + */ + public com.google.logging.v2.LogExclusion getExclusion() { + if (exclusionBuilder_ == null) { + return exclusion_ == null + ? com.google.logging.v2.LogExclusion.getDefaultInstance() + : exclusion_; + } else { + return exclusionBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. The new exclusion, whose `name` parameter is an exclusion name
+     * that is not already used in the parent resource.
+     * 
+ * + * + * .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setExclusion(com.google.logging.v2.LogExclusion value) { + if (exclusionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + exclusion_ = value; + } else { + exclusionBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The new exclusion, whose `name` parameter is an exclusion name
+     * that is not already used in the parent resource.
+     * 
+ * + * + * .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setExclusion(com.google.logging.v2.LogExclusion.Builder builderForValue) { + if (exclusionBuilder_ == null) { + exclusion_ = builderForValue.build(); + } else { + exclusionBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The new exclusion, whose `name` parameter is an exclusion name
+     * that is not already used in the parent resource.
+     * 
+ * + * + * .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeExclusion(com.google.logging.v2.LogExclusion value) { + if (exclusionBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && exclusion_ != null + && exclusion_ != com.google.logging.v2.LogExclusion.getDefaultInstance()) { + getExclusionBuilder().mergeFrom(value); + } else { + exclusion_ = value; + } + } else { + exclusionBuilder_.mergeFrom(value); + } + if (exclusion_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. The new exclusion, whose `name` parameter is an exclusion name
+     * that is not already used in the parent resource.
+     * 
+ * + * + * .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearExclusion() { + bitField0_ = (bitField0_ & ~0x00000002); + exclusion_ = null; + if (exclusionBuilder_ != null) { + exclusionBuilder_.dispose(); + exclusionBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The new exclusion, whose `name` parameter is an exclusion name
+     * that is not already used in the parent resource.
+     * 
+ * + * + * .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.logging.v2.LogExclusion.Builder getExclusionBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getExclusionFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. The new exclusion, whose `name` parameter is an exclusion name
+     * that is not already used in the parent resource.
+     * 
+ * + * + * .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.logging.v2.LogExclusionOrBuilder getExclusionOrBuilder() { + if (exclusionBuilder_ != null) { + return exclusionBuilder_.getMessageOrBuilder(); + } else { + return exclusion_ == null + ? com.google.logging.v2.LogExclusion.getDefaultInstance() + : exclusion_; + } + } + + /** + * + * + *
+     * Required. The new exclusion, whose `name` parameter is an exclusion name
+     * that is not already used in the parent resource.
+     * 
+ * + * + * .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogExclusion, + com.google.logging.v2.LogExclusion.Builder, + com.google.logging.v2.LogExclusionOrBuilder> + getExclusionFieldBuilder() { + if (exclusionBuilder_ == null) { + exclusionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogExclusion, + com.google.logging.v2.LogExclusion.Builder, + com.google.logging.v2.LogExclusionOrBuilder>( + getExclusion(), getParentForChildren(), isClean()); + exclusion_ = null; + } + return exclusionBuilder_; + } + + @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.logging.v2.CreateExclusionRequest) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.CreateExclusionRequest) + private static final com.google.logging.v2.CreateExclusionRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.CreateExclusionRequest(); + } + + public static com.google.logging.v2.CreateExclusionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateExclusionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.CreateExclusionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateExclusionRequestOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateExclusionRequestOrBuilder.java new file mode 100644 index 000000000000..5eb0271063f9 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateExclusionRequestOrBuilder.java @@ -0,0 +1,119 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface CreateExclusionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.CreateExclusionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource in which to create the exclusion:
+   *
+   *     "projects/[PROJECT_ID]"
+   *     "organizations/[ORGANIZATION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+   *     "folders/[FOLDER_ID]"
+   *
+   * For examples:
+   *
+   *   `"projects/my-logging-project"`
+   *   `"organizations/123456789"`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
+   * Required. The parent resource in which to create the exclusion:
+   *
+   *     "projects/[PROJECT_ID]"
+   *     "organizations/[ORGANIZATION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+   *     "folders/[FOLDER_ID]"
+   *
+   * For examples:
+   *
+   *   `"projects/my-logging-project"`
+   *   `"organizations/123456789"`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The new exclusion, whose `name` parameter is an exclusion name
+   * that is not already used in the parent resource.
+   * 
+ * + * .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the exclusion field is set. + */ + boolean hasExclusion(); + + /** + * + * + *
+   * Required. The new exclusion, whose `name` parameter is an exclusion name
+   * that is not already used in the parent resource.
+   * 
+ * + * .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The exclusion. + */ + com.google.logging.v2.LogExclusion getExclusion(); + + /** + * + * + *
+   * Required. The new exclusion, whose `name` parameter is an exclusion name
+   * that is not already used in the parent resource.
+   * 
+ * + * .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.logging.v2.LogExclusionOrBuilder getExclusionOrBuilder(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateLinkRequest.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateLinkRequest.java new file mode 100644 index 000000000000..54a71afd5c6b --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateLinkRequest.java @@ -0,0 +1,1166 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * The parameters to CreateLink.
+ * 
+ * + * Protobuf type {@code google.logging.v2.CreateLinkRequest} + */ +public final class CreateLinkRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.CreateLinkRequest) + CreateLinkRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use CreateLinkRequest.newBuilder() to construct. + private CreateLinkRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateLinkRequest() { + parent_ = ""; + linkId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateLinkRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_CreateLinkRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_CreateLinkRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.CreateLinkRequest.class, + com.google.logging.v2.CreateLinkRequest.Builder.class); + } + + private int bitField0_; + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
+   * Required. The full resource name of the bucket to create a link for.
+   *
+   *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The full resource name of the bucket to create a link for.
+   *
+   *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LINK_FIELD_NUMBER = 2; + private com.google.logging.v2.Link link_; + + /** + * + * + *
+   * Required. The new link.
+   * 
+ * + * .google.logging.v2.Link link = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the link field is set. + */ + @java.lang.Override + public boolean hasLink() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Required. The new link.
+   * 
+ * + * .google.logging.v2.Link link = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The link. + */ + @java.lang.Override + public com.google.logging.v2.Link getLink() { + return link_ == null ? com.google.logging.v2.Link.getDefaultInstance() : link_; + } + + /** + * + * + *
+   * Required. The new link.
+   * 
+ * + * .google.logging.v2.Link link = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + @java.lang.Override + public com.google.logging.v2.LinkOrBuilder getLinkOrBuilder() { + return link_ == null ? com.google.logging.v2.Link.getDefaultInstance() : link_; + } + + public static final int LINK_ID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object linkId_ = ""; + + /** + * + * + *
+   * Required. The ID to use for the link. The link_id can have up to 100
+   * characters. A valid link_id must only have alphanumeric characters and
+   * underscores within it.
+   * 
+ * + * string link_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The linkId. + */ + @java.lang.Override + public java.lang.String getLinkId() { + java.lang.Object ref = linkId_; + 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(); + linkId_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The ID to use for the link. The link_id can have up to 100
+   * characters. A valid link_id must only have alphanumeric characters and
+   * underscores within it.
+   * 
+ * + * string link_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for linkId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLinkIdBytes() { + java.lang.Object ref = linkId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + linkId_ = 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getLink()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(linkId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, linkId_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getLink()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(linkId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, linkId_); + } + size += getUnknownFields().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.logging.v2.CreateLinkRequest)) { + return super.equals(obj); + } + com.google.logging.v2.CreateLinkRequest other = (com.google.logging.v2.CreateLinkRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasLink() != other.hasLink()) return false; + if (hasLink()) { + if (!getLink().equals(other.getLink())) return false; + } + if (!getLinkId().equals(other.getLinkId())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasLink()) { + hash = (37 * hash) + LINK_FIELD_NUMBER; + hash = (53 * hash) + getLink().hashCode(); + } + hash = (37 * hash) + LINK_ID_FIELD_NUMBER; + hash = (53 * hash) + getLinkId().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.CreateLinkRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.CreateLinkRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.CreateLinkRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.CreateLinkRequest 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.logging.v2.CreateLinkRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.CreateLinkRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.CreateLinkRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.CreateLinkRequest 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.logging.v2.CreateLinkRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.CreateLinkRequest 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.logging.v2.CreateLinkRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.CreateLinkRequest 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.logging.v2.CreateLinkRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The parameters to CreateLink.
+   * 
+ * + * Protobuf type {@code google.logging.v2.CreateLinkRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.CreateLinkRequest) + com.google.logging.v2.CreateLinkRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_CreateLinkRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_CreateLinkRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.CreateLinkRequest.class, + com.google.logging.v2.CreateLinkRequest.Builder.class); + } + + // Construct using com.google.logging.v2.CreateLinkRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getLinkFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + link_ = null; + if (linkBuilder_ != null) { + linkBuilder_.dispose(); + linkBuilder_ = null; + } + linkId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_CreateLinkRequest_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.CreateLinkRequest getDefaultInstanceForType() { + return com.google.logging.v2.CreateLinkRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.CreateLinkRequest build() { + com.google.logging.v2.CreateLinkRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.CreateLinkRequest buildPartial() { + com.google.logging.v2.CreateLinkRequest result = + new com.google.logging.v2.CreateLinkRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.logging.v2.CreateLinkRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.link_ = linkBuilder_ == null ? link_ : linkBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.linkId_ = linkId_; + } + result.bitField0_ |= to_bitField0_; + } + + @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.logging.v2.CreateLinkRequest) { + return mergeFrom((com.google.logging.v2.CreateLinkRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.CreateLinkRequest other) { + if (other == com.google.logging.v2.CreateLinkRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasLink()) { + mergeLink(other.getLink()); + } + if (!other.getLinkId().isEmpty()) { + linkId_ = other.linkId_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getLinkFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + linkId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + + /** + * + * + *
+     * Required. The full resource name of the bucket to create a link for.
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The full resource name of the bucket to create a link for.
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The full resource name of the bucket to create a link for.
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The full resource name of the bucket to create a link for.
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The full resource name of the bucket to create a link for.
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.logging.v2.Link link_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.Link, + com.google.logging.v2.Link.Builder, + com.google.logging.v2.LinkOrBuilder> + linkBuilder_; + + /** + * + * + *
+     * Required. The new link.
+     * 
+ * + * .google.logging.v2.Link link = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the link field is set. + */ + public boolean hasLink() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Required. The new link.
+     * 
+ * + * .google.logging.v2.Link link = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The link. + */ + public com.google.logging.v2.Link getLink() { + if (linkBuilder_ == null) { + return link_ == null ? com.google.logging.v2.Link.getDefaultInstance() : link_; + } else { + return linkBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. The new link.
+     * 
+ * + * .google.logging.v2.Link link = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setLink(com.google.logging.v2.Link value) { + if (linkBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + link_ = value; + } else { + linkBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The new link.
+     * 
+ * + * .google.logging.v2.Link link = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setLink(com.google.logging.v2.Link.Builder builderForValue) { + if (linkBuilder_ == null) { + link_ = builderForValue.build(); + } else { + linkBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The new link.
+     * 
+ * + * .google.logging.v2.Link link = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder mergeLink(com.google.logging.v2.Link value) { + if (linkBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && link_ != null + && link_ != com.google.logging.v2.Link.getDefaultInstance()) { + getLinkBuilder().mergeFrom(value); + } else { + link_ = value; + } + } else { + linkBuilder_.mergeFrom(value); + } + if (link_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. The new link.
+     * 
+ * + * .google.logging.v2.Link link = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder clearLink() { + bitField0_ = (bitField0_ & ~0x00000002); + link_ = null; + if (linkBuilder_ != null) { + linkBuilder_.dispose(); + linkBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The new link.
+     * 
+ * + * .google.logging.v2.Link link = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.logging.v2.Link.Builder getLinkBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getLinkFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. The new link.
+     * 
+ * + * .google.logging.v2.Link link = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.logging.v2.LinkOrBuilder getLinkOrBuilder() { + if (linkBuilder_ != null) { + return linkBuilder_.getMessageOrBuilder(); + } else { + return link_ == null ? com.google.logging.v2.Link.getDefaultInstance() : link_; + } + } + + /** + * + * + *
+     * Required. The new link.
+     * 
+ * + * .google.logging.v2.Link link = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.Link, + com.google.logging.v2.Link.Builder, + com.google.logging.v2.LinkOrBuilder> + getLinkFieldBuilder() { + if (linkBuilder_ == null) { + linkBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.Link, + com.google.logging.v2.Link.Builder, + com.google.logging.v2.LinkOrBuilder>(getLink(), getParentForChildren(), isClean()); + link_ = null; + } + return linkBuilder_; + } + + private java.lang.Object linkId_ = ""; + + /** + * + * + *
+     * Required. The ID to use for the link. The link_id can have up to 100
+     * characters. A valid link_id must only have alphanumeric characters and
+     * underscores within it.
+     * 
+ * + * string link_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The linkId. + */ + public java.lang.String getLinkId() { + java.lang.Object ref = linkId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + linkId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The ID to use for the link. The link_id can have up to 100
+     * characters. A valid link_id must only have alphanumeric characters and
+     * underscores within it.
+     * 
+ * + * string link_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for linkId. + */ + public com.google.protobuf.ByteString getLinkIdBytes() { + java.lang.Object ref = linkId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + linkId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The ID to use for the link. The link_id can have up to 100
+     * characters. A valid link_id must only have alphanumeric characters and
+     * underscores within it.
+     * 
+ * + * string link_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The linkId to set. + * @return This builder for chaining. + */ + public Builder setLinkId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + linkId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The ID to use for the link. The link_id can have up to 100
+     * characters. A valid link_id must only have alphanumeric characters and
+     * underscores within it.
+     * 
+ * + * string link_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearLinkId() { + linkId_ = getDefaultInstance().getLinkId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The ID to use for the link. The link_id can have up to 100
+     * characters. A valid link_id must only have alphanumeric characters and
+     * underscores within it.
+     * 
+ * + * string link_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for linkId to set. + * @return This builder for chaining. + */ + public Builder setLinkIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + linkId_ = value; + bitField0_ |= 0x00000004; + 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.logging.v2.CreateLinkRequest) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.CreateLinkRequest) + private static final com.google.logging.v2.CreateLinkRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.CreateLinkRequest(); + } + + public static com.google.logging.v2.CreateLinkRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateLinkRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.CreateLinkRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateLinkRequestOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateLinkRequestOrBuilder.java new file mode 100644 index 000000000000..d5d33ea52362 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateLinkRequestOrBuilder.java @@ -0,0 +1,133 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface CreateLinkRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.CreateLinkRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The full resource name of the bucket to create a link for.
+   *
+   *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
+   * Required. The full resource name of the bucket to create a link for.
+   *
+   *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The new link.
+   * 
+ * + * .google.logging.v2.Link link = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the link field is set. + */ + boolean hasLink(); + + /** + * + * + *
+   * Required. The new link.
+   * 
+ * + * .google.logging.v2.Link link = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The link. + */ + com.google.logging.v2.Link getLink(); + + /** + * + * + *
+   * Required. The new link.
+   * 
+ * + * .google.logging.v2.Link link = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + com.google.logging.v2.LinkOrBuilder getLinkOrBuilder(); + + /** + * + * + *
+   * Required. The ID to use for the link. The link_id can have up to 100
+   * characters. A valid link_id must only have alphanumeric characters and
+   * underscores within it.
+   * 
+ * + * string link_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The linkId. + */ + java.lang.String getLinkId(); + + /** + * + * + *
+   * Required. The ID to use for the link. The link_id can have up to 100
+   * characters. A valid link_id must only have alphanumeric characters and
+   * underscores within it.
+   * 
+ * + * string link_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for linkId. + */ + com.google.protobuf.ByteString getLinkIdBytes(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateLogMetricRequest.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateLogMetricRequest.java new file mode 100644 index 000000000000..74c7bcbae06c --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateLogMetricRequest.java @@ -0,0 +1,979 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_metrics.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * The parameters to CreateLogMetric.
+ * 
+ * + * Protobuf type {@code google.logging.v2.CreateLogMetricRequest} + */ +public final class CreateLogMetricRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.CreateLogMetricRequest) + CreateLogMetricRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use CreateLogMetricRequest.newBuilder() to construct. + private CreateLogMetricRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateLogMetricRequest() { + parent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateLogMetricRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingMetricsProto + .internal_static_google_logging_v2_CreateLogMetricRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingMetricsProto + .internal_static_google_logging_v2_CreateLogMetricRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.CreateLogMetricRequest.class, + com.google.logging.v2.CreateLogMetricRequest.Builder.class); + } + + private int bitField0_; + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
+   * Required. The resource name of the project in which to create the metric:
+   *
+   *     "projects/[PROJECT_ID]"
+   *
+   * The new metric must be provided in the request.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The resource name of the project in which to create the metric:
+   *
+   *     "projects/[PROJECT_ID]"
+   *
+   * The new metric must be provided in the request.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int METRIC_FIELD_NUMBER = 2; + private com.google.logging.v2.LogMetric metric_; + + /** + * + * + *
+   * Required. The new logs-based metric, which must not have an identifier that
+   * already exists.
+   * 
+ * + * .google.logging.v2.LogMetric metric = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the metric field is set. + */ + @java.lang.Override + public boolean hasMetric() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Required. The new logs-based metric, which must not have an identifier that
+   * already exists.
+   * 
+ * + * .google.logging.v2.LogMetric metric = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The metric. + */ + @java.lang.Override + public com.google.logging.v2.LogMetric getMetric() { + return metric_ == null ? com.google.logging.v2.LogMetric.getDefaultInstance() : metric_; + } + + /** + * + * + *
+   * Required. The new logs-based metric, which must not have an identifier that
+   * already exists.
+   * 
+ * + * .google.logging.v2.LogMetric metric = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + @java.lang.Override + public com.google.logging.v2.LogMetricOrBuilder getMetricOrBuilder() { + return metric_ == null ? com.google.logging.v2.LogMetric.getDefaultInstance() : metric_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getMetric()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getMetric()); + } + size += getUnknownFields().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.logging.v2.CreateLogMetricRequest)) { + return super.equals(obj); + } + com.google.logging.v2.CreateLogMetricRequest other = + (com.google.logging.v2.CreateLogMetricRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasMetric() != other.hasMetric()) return false; + if (hasMetric()) { + if (!getMetric().equals(other.getMetric())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasMetric()) { + hash = (37 * hash) + METRIC_FIELD_NUMBER; + hash = (53 * hash) + getMetric().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.CreateLogMetricRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.CreateLogMetricRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.CreateLogMetricRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.CreateLogMetricRequest 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.logging.v2.CreateLogMetricRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.CreateLogMetricRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.CreateLogMetricRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.CreateLogMetricRequest 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.logging.v2.CreateLogMetricRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.CreateLogMetricRequest 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.logging.v2.CreateLogMetricRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.CreateLogMetricRequest 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.logging.v2.CreateLogMetricRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The parameters to CreateLogMetric.
+   * 
+ * + * Protobuf type {@code google.logging.v2.CreateLogMetricRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.CreateLogMetricRequest) + com.google.logging.v2.CreateLogMetricRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingMetricsProto + .internal_static_google_logging_v2_CreateLogMetricRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingMetricsProto + .internal_static_google_logging_v2_CreateLogMetricRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.CreateLogMetricRequest.class, + com.google.logging.v2.CreateLogMetricRequest.Builder.class); + } + + // Construct using com.google.logging.v2.CreateLogMetricRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getMetricFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + metric_ = null; + if (metricBuilder_ != null) { + metricBuilder_.dispose(); + metricBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingMetricsProto + .internal_static_google_logging_v2_CreateLogMetricRequest_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.CreateLogMetricRequest getDefaultInstanceForType() { + return com.google.logging.v2.CreateLogMetricRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.CreateLogMetricRequest build() { + com.google.logging.v2.CreateLogMetricRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.CreateLogMetricRequest buildPartial() { + com.google.logging.v2.CreateLogMetricRequest result = + new com.google.logging.v2.CreateLogMetricRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.logging.v2.CreateLogMetricRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.metric_ = metricBuilder_ == null ? metric_ : metricBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @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.logging.v2.CreateLogMetricRequest) { + return mergeFrom((com.google.logging.v2.CreateLogMetricRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.CreateLogMetricRequest other) { + if (other == com.google.logging.v2.CreateLogMetricRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasMetric()) { + mergeMetric(other.getMetric()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getMetricFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + + /** + * + * + *
+     * Required. The resource name of the project in which to create the metric:
+     *
+     *     "projects/[PROJECT_ID]"
+     *
+     * The new metric must be provided in the request.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The resource name of the project in which to create the metric:
+     *
+     *     "projects/[PROJECT_ID]"
+     *
+     * The new metric must be provided in the request.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The resource name of the project in which to create the metric:
+     *
+     *     "projects/[PROJECT_ID]"
+     *
+     * The new metric must be provided in the request.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The resource name of the project in which to create the metric:
+     *
+     *     "projects/[PROJECT_ID]"
+     *
+     * The new metric must be provided in the request.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The resource name of the project in which to create the metric:
+     *
+     *     "projects/[PROJECT_ID]"
+     *
+     * The new metric must be provided in the request.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.logging.v2.LogMetric metric_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogMetric, + com.google.logging.v2.LogMetric.Builder, + com.google.logging.v2.LogMetricOrBuilder> + metricBuilder_; + + /** + * + * + *
+     * Required. The new logs-based metric, which must not have an identifier that
+     * already exists.
+     * 
+ * + * .google.logging.v2.LogMetric metric = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the metric field is set. + */ + public boolean hasMetric() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Required. The new logs-based metric, which must not have an identifier that
+     * already exists.
+     * 
+ * + * .google.logging.v2.LogMetric metric = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The metric. + */ + public com.google.logging.v2.LogMetric getMetric() { + if (metricBuilder_ == null) { + return metric_ == null ? com.google.logging.v2.LogMetric.getDefaultInstance() : metric_; + } else { + return metricBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. The new logs-based metric, which must not have an identifier that
+     * already exists.
+     * 
+ * + * .google.logging.v2.LogMetric metric = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setMetric(com.google.logging.v2.LogMetric value) { + if (metricBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + metric_ = value; + } else { + metricBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The new logs-based metric, which must not have an identifier that
+     * already exists.
+     * 
+ * + * .google.logging.v2.LogMetric metric = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setMetric(com.google.logging.v2.LogMetric.Builder builderForValue) { + if (metricBuilder_ == null) { + metric_ = builderForValue.build(); + } else { + metricBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The new logs-based metric, which must not have an identifier that
+     * already exists.
+     * 
+ * + * .google.logging.v2.LogMetric metric = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeMetric(com.google.logging.v2.LogMetric value) { + if (metricBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && metric_ != null + && metric_ != com.google.logging.v2.LogMetric.getDefaultInstance()) { + getMetricBuilder().mergeFrom(value); + } else { + metric_ = value; + } + } else { + metricBuilder_.mergeFrom(value); + } + if (metric_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. The new logs-based metric, which must not have an identifier that
+     * already exists.
+     * 
+ * + * .google.logging.v2.LogMetric metric = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearMetric() { + bitField0_ = (bitField0_ & ~0x00000002); + metric_ = null; + if (metricBuilder_ != null) { + metricBuilder_.dispose(); + metricBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The new logs-based metric, which must not have an identifier that
+     * already exists.
+     * 
+ * + * .google.logging.v2.LogMetric metric = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.logging.v2.LogMetric.Builder getMetricBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getMetricFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. The new logs-based metric, which must not have an identifier that
+     * already exists.
+     * 
+ * + * .google.logging.v2.LogMetric metric = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.logging.v2.LogMetricOrBuilder getMetricOrBuilder() { + if (metricBuilder_ != null) { + return metricBuilder_.getMessageOrBuilder(); + } else { + return metric_ == null ? com.google.logging.v2.LogMetric.getDefaultInstance() : metric_; + } + } + + /** + * + * + *
+     * Required. The new logs-based metric, which must not have an identifier that
+     * already exists.
+     * 
+ * + * .google.logging.v2.LogMetric metric = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogMetric, + com.google.logging.v2.LogMetric.Builder, + com.google.logging.v2.LogMetricOrBuilder> + getMetricFieldBuilder() { + if (metricBuilder_ == null) { + metricBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogMetric, + com.google.logging.v2.LogMetric.Builder, + com.google.logging.v2.LogMetricOrBuilder>( + getMetric(), getParentForChildren(), isClean()); + metric_ = null; + } + return metricBuilder_; + } + + @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.logging.v2.CreateLogMetricRequest) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.CreateLogMetricRequest) + private static final com.google.logging.v2.CreateLogMetricRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.CreateLogMetricRequest(); + } + + public static com.google.logging.v2.CreateLogMetricRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateLogMetricRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.CreateLogMetricRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateLogMetricRequestOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateLogMetricRequestOrBuilder.java new file mode 100644 index 000000000000..9ced49128e3e --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateLogMetricRequestOrBuilder.java @@ -0,0 +1,104 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_metrics.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface CreateLogMetricRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.CreateLogMetricRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the project in which to create the metric:
+   *
+   *     "projects/[PROJECT_ID]"
+   *
+   * The new metric must be provided in the request.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
+   * Required. The resource name of the project in which to create the metric:
+   *
+   *     "projects/[PROJECT_ID]"
+   *
+   * The new metric must be provided in the request.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The new logs-based metric, which must not have an identifier that
+   * already exists.
+   * 
+ * + * .google.logging.v2.LogMetric metric = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the metric field is set. + */ + boolean hasMetric(); + + /** + * + * + *
+   * Required. The new logs-based metric, which must not have an identifier that
+   * already exists.
+   * 
+ * + * .google.logging.v2.LogMetric metric = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The metric. + */ + com.google.logging.v2.LogMetric getMetric(); + + /** + * + * + *
+   * Required. The new logs-based metric, which must not have an identifier that
+   * already exists.
+   * 
+ * + * .google.logging.v2.LogMetric metric = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + com.google.logging.v2.LogMetricOrBuilder getMetricOrBuilder(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateSinkRequest.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateSinkRequest.java new file mode 100644 index 000000000000..4903408e04ec --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateSinkRequest.java @@ -0,0 +1,1152 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * The parameters to `CreateSink`.
+ * 
+ * + * Protobuf type {@code google.logging.v2.CreateSinkRequest} + */ +public final class CreateSinkRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.CreateSinkRequest) + CreateSinkRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use CreateSinkRequest.newBuilder() to construct. + private CreateSinkRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateSinkRequest() { + parent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateSinkRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_CreateSinkRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_CreateSinkRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.CreateSinkRequest.class, + com.google.logging.v2.CreateSinkRequest.Builder.class); + } + + private int bitField0_; + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
+   * Required. The resource in which to create the sink:
+   *
+   *     "projects/[PROJECT_ID]"
+   *     "organizations/[ORGANIZATION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+   *     "folders/[FOLDER_ID]"
+   *
+   * For examples:
+   *
+   *   `"projects/my-project"`
+   *   `"organizations/123456789"`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The resource in which to create the sink:
+   *
+   *     "projects/[PROJECT_ID]"
+   *     "organizations/[ORGANIZATION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+   *     "folders/[FOLDER_ID]"
+   *
+   * For examples:
+   *
+   *   `"projects/my-project"`
+   *   `"organizations/123456789"`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SINK_FIELD_NUMBER = 2; + private com.google.logging.v2.LogSink sink_; + + /** + * + * + *
+   * Required. The new sink, whose `name` parameter is a sink identifier that
+   * is not already in use.
+   * 
+ * + * .google.logging.v2.LogSink sink = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the sink field is set. + */ + @java.lang.Override + public boolean hasSink() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Required. The new sink, whose `name` parameter is a sink identifier that
+   * is not already in use.
+   * 
+ * + * .google.logging.v2.LogSink sink = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The sink. + */ + @java.lang.Override + public com.google.logging.v2.LogSink getSink() { + return sink_ == null ? com.google.logging.v2.LogSink.getDefaultInstance() : sink_; + } + + /** + * + * + *
+   * Required. The new sink, whose `name` parameter is a sink identifier that
+   * is not already in use.
+   * 
+ * + * .google.logging.v2.LogSink sink = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + @java.lang.Override + public com.google.logging.v2.LogSinkOrBuilder getSinkOrBuilder() { + return sink_ == null ? com.google.logging.v2.LogSink.getDefaultInstance() : sink_; + } + + public static final int UNIQUE_WRITER_IDENTITY_FIELD_NUMBER = 3; + private boolean uniqueWriterIdentity_ = false; + + /** + * + * + *
+   * Optional. Determines the kind of IAM identity returned as `writer_identity`
+   * in the new sink. If this value is omitted or set to false, and if the
+   * sink's parent is a project, then the value returned as `writer_identity` is
+   * the same group or service account used by Cloud Logging before the addition
+   * of writer identities to this API. The sink's destination must be in the
+   * same project as the sink itself.
+   *
+   * If this field is set to true, or if the sink is owned by a non-project
+   * resource such as an organization, then the value of `writer_identity` will
+   * be a unique service account used only for exports from the new sink. For
+   * more information, see `writer_identity` in
+   * [LogSink][google.logging.v2.LogSink].
+   * 
+ * + * bool unique_writer_identity = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The uniqueWriterIdentity. + */ + @java.lang.Override + public boolean getUniqueWriterIdentity() { + return uniqueWriterIdentity_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getSink()); + } + if (uniqueWriterIdentity_ != false) { + output.writeBool(3, uniqueWriterIdentity_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getSink()); + } + if (uniqueWriterIdentity_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, uniqueWriterIdentity_); + } + size += getUnknownFields().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.logging.v2.CreateSinkRequest)) { + return super.equals(obj); + } + com.google.logging.v2.CreateSinkRequest other = (com.google.logging.v2.CreateSinkRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasSink() != other.hasSink()) return false; + if (hasSink()) { + if (!getSink().equals(other.getSink())) return false; + } + if (getUniqueWriterIdentity() != other.getUniqueWriterIdentity()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasSink()) { + hash = (37 * hash) + SINK_FIELD_NUMBER; + hash = (53 * hash) + getSink().hashCode(); + } + hash = (37 * hash) + UNIQUE_WRITER_IDENTITY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getUniqueWriterIdentity()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.CreateSinkRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.CreateSinkRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.CreateSinkRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.CreateSinkRequest 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.logging.v2.CreateSinkRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.CreateSinkRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.CreateSinkRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.CreateSinkRequest 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.logging.v2.CreateSinkRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.CreateSinkRequest 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.logging.v2.CreateSinkRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.CreateSinkRequest 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.logging.v2.CreateSinkRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The parameters to `CreateSink`.
+   * 
+ * + * Protobuf type {@code google.logging.v2.CreateSinkRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.CreateSinkRequest) + com.google.logging.v2.CreateSinkRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_CreateSinkRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_CreateSinkRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.CreateSinkRequest.class, + com.google.logging.v2.CreateSinkRequest.Builder.class); + } + + // Construct using com.google.logging.v2.CreateSinkRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getSinkFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + sink_ = null; + if (sinkBuilder_ != null) { + sinkBuilder_.dispose(); + sinkBuilder_ = null; + } + uniqueWriterIdentity_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_CreateSinkRequest_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.CreateSinkRequest getDefaultInstanceForType() { + return com.google.logging.v2.CreateSinkRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.CreateSinkRequest build() { + com.google.logging.v2.CreateSinkRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.CreateSinkRequest buildPartial() { + com.google.logging.v2.CreateSinkRequest result = + new com.google.logging.v2.CreateSinkRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.logging.v2.CreateSinkRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.sink_ = sinkBuilder_ == null ? sink_ : sinkBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.uniqueWriterIdentity_ = uniqueWriterIdentity_; + } + result.bitField0_ |= to_bitField0_; + } + + @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.logging.v2.CreateSinkRequest) { + return mergeFrom((com.google.logging.v2.CreateSinkRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.CreateSinkRequest other) { + if (other == com.google.logging.v2.CreateSinkRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasSink()) { + mergeSink(other.getSink()); + } + if (other.getUniqueWriterIdentity() != false) { + setUniqueWriterIdentity(other.getUniqueWriterIdentity()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getSinkFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + uniqueWriterIdentity_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + + /** + * + * + *
+     * Required. The resource in which to create the sink:
+     *
+     *     "projects/[PROJECT_ID]"
+     *     "organizations/[ORGANIZATION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+     *     "folders/[FOLDER_ID]"
+     *
+     * For examples:
+     *
+     *   `"projects/my-project"`
+     *   `"organizations/123456789"`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The resource in which to create the sink:
+     *
+     *     "projects/[PROJECT_ID]"
+     *     "organizations/[ORGANIZATION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+     *     "folders/[FOLDER_ID]"
+     *
+     * For examples:
+     *
+     *   `"projects/my-project"`
+     *   `"organizations/123456789"`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The resource in which to create the sink:
+     *
+     *     "projects/[PROJECT_ID]"
+     *     "organizations/[ORGANIZATION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+     *     "folders/[FOLDER_ID]"
+     *
+     * For examples:
+     *
+     *   `"projects/my-project"`
+     *   `"organizations/123456789"`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The resource in which to create the sink:
+     *
+     *     "projects/[PROJECT_ID]"
+     *     "organizations/[ORGANIZATION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+     *     "folders/[FOLDER_ID]"
+     *
+     * For examples:
+     *
+     *   `"projects/my-project"`
+     *   `"organizations/123456789"`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The resource in which to create the sink:
+     *
+     *     "projects/[PROJECT_ID]"
+     *     "organizations/[ORGANIZATION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+     *     "folders/[FOLDER_ID]"
+     *
+     * For examples:
+     *
+     *   `"projects/my-project"`
+     *   `"organizations/123456789"`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.logging.v2.LogSink sink_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogSink, + com.google.logging.v2.LogSink.Builder, + com.google.logging.v2.LogSinkOrBuilder> + sinkBuilder_; + + /** + * + * + *
+     * Required. The new sink, whose `name` parameter is a sink identifier that
+     * is not already in use.
+     * 
+ * + * .google.logging.v2.LogSink sink = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the sink field is set. + */ + public boolean hasSink() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Required. The new sink, whose `name` parameter is a sink identifier that
+     * is not already in use.
+     * 
+ * + * .google.logging.v2.LogSink sink = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The sink. + */ + public com.google.logging.v2.LogSink getSink() { + if (sinkBuilder_ == null) { + return sink_ == null ? com.google.logging.v2.LogSink.getDefaultInstance() : sink_; + } else { + return sinkBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. The new sink, whose `name` parameter is a sink identifier that
+     * is not already in use.
+     * 
+ * + * .google.logging.v2.LogSink sink = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setSink(com.google.logging.v2.LogSink value) { + if (sinkBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sink_ = value; + } else { + sinkBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The new sink, whose `name` parameter is a sink identifier that
+     * is not already in use.
+     * 
+ * + * .google.logging.v2.LogSink sink = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setSink(com.google.logging.v2.LogSink.Builder builderForValue) { + if (sinkBuilder_ == null) { + sink_ = builderForValue.build(); + } else { + sinkBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The new sink, whose `name` parameter is a sink identifier that
+     * is not already in use.
+     * 
+ * + * .google.logging.v2.LogSink sink = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder mergeSink(com.google.logging.v2.LogSink value) { + if (sinkBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && sink_ != null + && sink_ != com.google.logging.v2.LogSink.getDefaultInstance()) { + getSinkBuilder().mergeFrom(value); + } else { + sink_ = value; + } + } else { + sinkBuilder_.mergeFrom(value); + } + if (sink_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. The new sink, whose `name` parameter is a sink identifier that
+     * is not already in use.
+     * 
+ * + * .google.logging.v2.LogSink sink = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder clearSink() { + bitField0_ = (bitField0_ & ~0x00000002); + sink_ = null; + if (sinkBuilder_ != null) { + sinkBuilder_.dispose(); + sinkBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The new sink, whose `name` parameter is a sink identifier that
+     * is not already in use.
+     * 
+ * + * .google.logging.v2.LogSink sink = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.logging.v2.LogSink.Builder getSinkBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getSinkFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. The new sink, whose `name` parameter is a sink identifier that
+     * is not already in use.
+     * 
+ * + * .google.logging.v2.LogSink sink = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.logging.v2.LogSinkOrBuilder getSinkOrBuilder() { + if (sinkBuilder_ != null) { + return sinkBuilder_.getMessageOrBuilder(); + } else { + return sink_ == null ? com.google.logging.v2.LogSink.getDefaultInstance() : sink_; + } + } + + /** + * + * + *
+     * Required. The new sink, whose `name` parameter is a sink identifier that
+     * is not already in use.
+     * 
+ * + * .google.logging.v2.LogSink sink = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogSink, + com.google.logging.v2.LogSink.Builder, + com.google.logging.v2.LogSinkOrBuilder> + getSinkFieldBuilder() { + if (sinkBuilder_ == null) { + sinkBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogSink, + com.google.logging.v2.LogSink.Builder, + com.google.logging.v2.LogSinkOrBuilder>( + getSink(), getParentForChildren(), isClean()); + sink_ = null; + } + return sinkBuilder_; + } + + private boolean uniqueWriterIdentity_; + + /** + * + * + *
+     * Optional. Determines the kind of IAM identity returned as `writer_identity`
+     * in the new sink. If this value is omitted or set to false, and if the
+     * sink's parent is a project, then the value returned as `writer_identity` is
+     * the same group or service account used by Cloud Logging before the addition
+     * of writer identities to this API. The sink's destination must be in the
+     * same project as the sink itself.
+     *
+     * If this field is set to true, or if the sink is owned by a non-project
+     * resource such as an organization, then the value of `writer_identity` will
+     * be a unique service account used only for exports from the new sink. For
+     * more information, see `writer_identity` in
+     * [LogSink][google.logging.v2.LogSink].
+     * 
+ * + * bool unique_writer_identity = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The uniqueWriterIdentity. + */ + @java.lang.Override + public boolean getUniqueWriterIdentity() { + return uniqueWriterIdentity_; + } + + /** + * + * + *
+     * Optional. Determines the kind of IAM identity returned as `writer_identity`
+     * in the new sink. If this value is omitted or set to false, and if the
+     * sink's parent is a project, then the value returned as `writer_identity` is
+     * the same group or service account used by Cloud Logging before the addition
+     * of writer identities to this API. The sink's destination must be in the
+     * same project as the sink itself.
+     *
+     * If this field is set to true, or if the sink is owned by a non-project
+     * resource such as an organization, then the value of `writer_identity` will
+     * be a unique service account used only for exports from the new sink. For
+     * more information, see `writer_identity` in
+     * [LogSink][google.logging.v2.LogSink].
+     * 
+ * + * bool unique_writer_identity = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The uniqueWriterIdentity to set. + * @return This builder for chaining. + */ + public Builder setUniqueWriterIdentity(boolean value) { + + uniqueWriterIdentity_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Determines the kind of IAM identity returned as `writer_identity`
+     * in the new sink. If this value is omitted or set to false, and if the
+     * sink's parent is a project, then the value returned as `writer_identity` is
+     * the same group or service account used by Cloud Logging before the addition
+     * of writer identities to this API. The sink's destination must be in the
+     * same project as the sink itself.
+     *
+     * If this field is set to true, or if the sink is owned by a non-project
+     * resource such as an organization, then the value of `writer_identity` will
+     * be a unique service account used only for exports from the new sink. For
+     * more information, see `writer_identity` in
+     * [LogSink][google.logging.v2.LogSink].
+     * 
+ * + * bool unique_writer_identity = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearUniqueWriterIdentity() { + bitField0_ = (bitField0_ & ~0x00000004); + uniqueWriterIdentity_ = 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.logging.v2.CreateSinkRequest) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.CreateSinkRequest) + private static final com.google.logging.v2.CreateSinkRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.CreateSinkRequest(); + } + + public static com.google.logging.v2.CreateSinkRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateSinkRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.CreateSinkRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateSinkRequestOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateSinkRequestOrBuilder.java new file mode 100644 index 000000000000..0b2040e31961 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateSinkRequestOrBuilder.java @@ -0,0 +1,140 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface CreateSinkRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.CreateSinkRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource in which to create the sink:
+   *
+   *     "projects/[PROJECT_ID]"
+   *     "organizations/[ORGANIZATION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+   *     "folders/[FOLDER_ID]"
+   *
+   * For examples:
+   *
+   *   `"projects/my-project"`
+   *   `"organizations/123456789"`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
+   * Required. The resource in which to create the sink:
+   *
+   *     "projects/[PROJECT_ID]"
+   *     "organizations/[ORGANIZATION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+   *     "folders/[FOLDER_ID]"
+   *
+   * For examples:
+   *
+   *   `"projects/my-project"`
+   *   `"organizations/123456789"`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The new sink, whose `name` parameter is a sink identifier that
+   * is not already in use.
+   * 
+ * + * .google.logging.v2.LogSink sink = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the sink field is set. + */ + boolean hasSink(); + + /** + * + * + *
+   * Required. The new sink, whose `name` parameter is a sink identifier that
+   * is not already in use.
+   * 
+ * + * .google.logging.v2.LogSink sink = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The sink. + */ + com.google.logging.v2.LogSink getSink(); + + /** + * + * + *
+   * Required. The new sink, whose `name` parameter is a sink identifier that
+   * is not already in use.
+   * 
+ * + * .google.logging.v2.LogSink sink = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + com.google.logging.v2.LogSinkOrBuilder getSinkOrBuilder(); + + /** + * + * + *
+   * Optional. Determines the kind of IAM identity returned as `writer_identity`
+   * in the new sink. If this value is omitted or set to false, and if the
+   * sink's parent is a project, then the value returned as `writer_identity` is
+   * the same group or service account used by Cloud Logging before the addition
+   * of writer identities to this API. The sink's destination must be in the
+   * same project as the sink itself.
+   *
+   * If this field is set to true, or if the sink is owned by a non-project
+   * resource such as an organization, then the value of `writer_identity` will
+   * be a unique service account used only for exports from the new sink. For
+   * more information, see `writer_identity` in
+   * [LogSink][google.logging.v2.LogSink].
+   * 
+ * + * bool unique_writer_identity = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The uniqueWriterIdentity. + */ + boolean getUniqueWriterIdentity(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateViewRequest.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateViewRequest.java new file mode 100644 index 000000000000..db5c577f077d --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateViewRequest.java @@ -0,0 +1,1160 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * The parameters to `CreateView`.
+ * 
+ * + * Protobuf type {@code google.logging.v2.CreateViewRequest} + */ +public final class CreateViewRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.CreateViewRequest) + CreateViewRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use CreateViewRequest.newBuilder() to construct. + private CreateViewRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateViewRequest() { + parent_ = ""; + viewId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateViewRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_CreateViewRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_CreateViewRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.CreateViewRequest.class, + com.google.logging.v2.CreateViewRequest.Builder.class); + } + + private int bitField0_; + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
+   * Required. The bucket in which to create the view
+   *
+   *     `"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"`
+   *
+   * For example:
+   *
+   *   `"projects/my-project/locations/global/buckets/my-bucket"`
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The bucket in which to create the view
+   *
+   *     `"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"`
+   *
+   * For example:
+   *
+   *   `"projects/my-project/locations/global/buckets/my-bucket"`
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VIEW_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object viewId_ = ""; + + /** + * + * + *
+   * Required. A client-assigned identifier such as `"my-view"`. Identifiers are
+   * limited to 100 characters and can include only letters, digits,
+   * underscores, hyphens, and periods.
+   * 
+ * + * string view_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The viewId. + */ + @java.lang.Override + public java.lang.String getViewId() { + java.lang.Object ref = viewId_; + 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(); + viewId_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. A client-assigned identifier such as `"my-view"`. Identifiers are
+   * limited to 100 characters and can include only letters, digits,
+   * underscores, hyphens, and periods.
+   * 
+ * + * string view_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for viewId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getViewIdBytes() { + java.lang.Object ref = viewId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + viewId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VIEW_FIELD_NUMBER = 3; + private com.google.logging.v2.LogView view_; + + /** + * + * + *
+   * Required. The new view.
+   * 
+ * + * .google.logging.v2.LogView view = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the view field is set. + */ + @java.lang.Override + public boolean hasView() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Required. The new view.
+   * 
+ * + * .google.logging.v2.LogView view = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The view. + */ + @java.lang.Override + public com.google.logging.v2.LogView getView() { + return view_ == null ? com.google.logging.v2.LogView.getDefaultInstance() : view_; + } + + /** + * + * + *
+   * Required. The new view.
+   * 
+ * + * .google.logging.v2.LogView view = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + @java.lang.Override + public com.google.logging.v2.LogViewOrBuilder getViewOrBuilder() { + return view_ == null ? com.google.logging.v2.LogView.getDefaultInstance() : view_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(viewId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, viewId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getView()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(viewId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, viewId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getView()); + } + size += getUnknownFields().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.logging.v2.CreateViewRequest)) { + return super.equals(obj); + } + com.google.logging.v2.CreateViewRequest other = (com.google.logging.v2.CreateViewRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getViewId().equals(other.getViewId())) return false; + if (hasView() != other.hasView()) return false; + if (hasView()) { + if (!getView().equals(other.getView())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + VIEW_ID_FIELD_NUMBER; + hash = (53 * hash) + getViewId().hashCode(); + if (hasView()) { + hash = (37 * hash) + VIEW_FIELD_NUMBER; + hash = (53 * hash) + getView().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.CreateViewRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.CreateViewRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.CreateViewRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.CreateViewRequest 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.logging.v2.CreateViewRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.CreateViewRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.CreateViewRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.CreateViewRequest 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.logging.v2.CreateViewRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.CreateViewRequest 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.logging.v2.CreateViewRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.CreateViewRequest 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.logging.v2.CreateViewRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The parameters to `CreateView`.
+   * 
+ * + * Protobuf type {@code google.logging.v2.CreateViewRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.CreateViewRequest) + com.google.logging.v2.CreateViewRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_CreateViewRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_CreateViewRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.CreateViewRequest.class, + com.google.logging.v2.CreateViewRequest.Builder.class); + } + + // Construct using com.google.logging.v2.CreateViewRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getViewFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + viewId_ = ""; + view_ = null; + if (viewBuilder_ != null) { + viewBuilder_.dispose(); + viewBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_CreateViewRequest_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.CreateViewRequest getDefaultInstanceForType() { + return com.google.logging.v2.CreateViewRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.CreateViewRequest build() { + com.google.logging.v2.CreateViewRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.CreateViewRequest buildPartial() { + com.google.logging.v2.CreateViewRequest result = + new com.google.logging.v2.CreateViewRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.logging.v2.CreateViewRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.viewId_ = viewId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.view_ = viewBuilder_ == null ? view_ : viewBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @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.logging.v2.CreateViewRequest) { + return mergeFrom((com.google.logging.v2.CreateViewRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.CreateViewRequest other) { + if (other == com.google.logging.v2.CreateViewRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getViewId().isEmpty()) { + viewId_ = other.viewId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasView()) { + mergeView(other.getView()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + viewId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getViewFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + + /** + * + * + *
+     * Required. The bucket in which to create the view
+     *
+     *     `"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"`
+     *
+     * For example:
+     *
+     *   `"projects/my-project/locations/global/buckets/my-bucket"`
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The bucket in which to create the view
+     *
+     *     `"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"`
+     *
+     * For example:
+     *
+     *   `"projects/my-project/locations/global/buckets/my-bucket"`
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The bucket in which to create the view
+     *
+     *     `"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"`
+     *
+     * For example:
+     *
+     *   `"projects/my-project/locations/global/buckets/my-bucket"`
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The bucket in which to create the view
+     *
+     *     `"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"`
+     *
+     * For example:
+     *
+     *   `"projects/my-project/locations/global/buckets/my-bucket"`
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The bucket in which to create the view
+     *
+     *     `"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"`
+     *
+     * For example:
+     *
+     *   `"projects/my-project/locations/global/buckets/my-bucket"`
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object viewId_ = ""; + + /** + * + * + *
+     * Required. A client-assigned identifier such as `"my-view"`. Identifiers are
+     * limited to 100 characters and can include only letters, digits,
+     * underscores, hyphens, and periods.
+     * 
+ * + * string view_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The viewId. + */ + public java.lang.String getViewId() { + java.lang.Object ref = viewId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + viewId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. A client-assigned identifier such as `"my-view"`. Identifiers are
+     * limited to 100 characters and can include only letters, digits,
+     * underscores, hyphens, and periods.
+     * 
+ * + * string view_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for viewId. + */ + public com.google.protobuf.ByteString getViewIdBytes() { + java.lang.Object ref = viewId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + viewId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. A client-assigned identifier such as `"my-view"`. Identifiers are
+     * limited to 100 characters and can include only letters, digits,
+     * underscores, hyphens, and periods.
+     * 
+ * + * string view_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The viewId to set. + * @return This builder for chaining. + */ + public Builder setViewId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + viewId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. A client-assigned identifier such as `"my-view"`. Identifiers are
+     * limited to 100 characters and can include only letters, digits,
+     * underscores, hyphens, and periods.
+     * 
+ * + * string view_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearViewId() { + viewId_ = getDefaultInstance().getViewId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. A client-assigned identifier such as `"my-view"`. Identifiers are
+     * limited to 100 characters and can include only letters, digits,
+     * underscores, hyphens, and periods.
+     * 
+ * + * string view_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for viewId to set. + * @return This builder for chaining. + */ + public Builder setViewIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + viewId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.logging.v2.LogView view_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogView, + com.google.logging.v2.LogView.Builder, + com.google.logging.v2.LogViewOrBuilder> + viewBuilder_; + + /** + * + * + *
+     * Required. The new view.
+     * 
+ * + * .google.logging.v2.LogView view = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the view field is set. + */ + public boolean hasView() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Required. The new view.
+     * 
+ * + * .google.logging.v2.LogView view = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The view. + */ + public com.google.logging.v2.LogView getView() { + if (viewBuilder_ == null) { + return view_ == null ? com.google.logging.v2.LogView.getDefaultInstance() : view_; + } else { + return viewBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. The new view.
+     * 
+ * + * .google.logging.v2.LogView view = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setView(com.google.logging.v2.LogView value) { + if (viewBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + view_ = value; + } else { + viewBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The new view.
+     * 
+ * + * .google.logging.v2.LogView view = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setView(com.google.logging.v2.LogView.Builder builderForValue) { + if (viewBuilder_ == null) { + view_ = builderForValue.build(); + } else { + viewBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The new view.
+     * 
+ * + * .google.logging.v2.LogView view = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder mergeView(com.google.logging.v2.LogView value) { + if (viewBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && view_ != null + && view_ != com.google.logging.v2.LogView.getDefaultInstance()) { + getViewBuilder().mergeFrom(value); + } else { + view_ = value; + } + } else { + viewBuilder_.mergeFrom(value); + } + if (view_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. The new view.
+     * 
+ * + * .google.logging.v2.LogView view = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder clearView() { + bitField0_ = (bitField0_ & ~0x00000004); + view_ = null; + if (viewBuilder_ != null) { + viewBuilder_.dispose(); + viewBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The new view.
+     * 
+ * + * .google.logging.v2.LogView view = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.logging.v2.LogView.Builder getViewBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getViewFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. The new view.
+     * 
+ * + * .google.logging.v2.LogView view = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.logging.v2.LogViewOrBuilder getViewOrBuilder() { + if (viewBuilder_ != null) { + return viewBuilder_.getMessageOrBuilder(); + } else { + return view_ == null ? com.google.logging.v2.LogView.getDefaultInstance() : view_; + } + } + + /** + * + * + *
+     * Required. The new view.
+     * 
+ * + * .google.logging.v2.LogView view = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogView, + com.google.logging.v2.LogView.Builder, + com.google.logging.v2.LogViewOrBuilder> + getViewFieldBuilder() { + if (viewBuilder_ == null) { + viewBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogView, + com.google.logging.v2.LogView.Builder, + com.google.logging.v2.LogViewOrBuilder>( + getView(), getParentForChildren(), isClean()); + view_ = null; + } + return viewBuilder_; + } + + @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.logging.v2.CreateViewRequest) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.CreateViewRequest) + private static final com.google.logging.v2.CreateViewRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.CreateViewRequest(); + } + + public static com.google.logging.v2.CreateViewRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateViewRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.CreateViewRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateViewRequestOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateViewRequestOrBuilder.java new file mode 100644 index 000000000000..29e256c86eeb --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateViewRequestOrBuilder.java @@ -0,0 +1,131 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface CreateViewRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.CreateViewRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The bucket in which to create the view
+   *
+   *     `"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"`
+   *
+   * For example:
+   *
+   *   `"projects/my-project/locations/global/buckets/my-bucket"`
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
+   * Required. The bucket in which to create the view
+   *
+   *     `"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"`
+   *
+   * For example:
+   *
+   *   `"projects/my-project/locations/global/buckets/my-bucket"`
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. A client-assigned identifier such as `"my-view"`. Identifiers are
+   * limited to 100 characters and can include only letters, digits,
+   * underscores, hyphens, and periods.
+   * 
+ * + * string view_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The viewId. + */ + java.lang.String getViewId(); + + /** + * + * + *
+   * Required. A client-assigned identifier such as `"my-view"`. Identifiers are
+   * limited to 100 characters and can include only letters, digits,
+   * underscores, hyphens, and periods.
+   * 
+ * + * string view_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for viewId. + */ + com.google.protobuf.ByteString getViewIdBytes(); + + /** + * + * + *
+   * Required. The new view.
+   * 
+ * + * .google.logging.v2.LogView view = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the view field is set. + */ + boolean hasView(); + + /** + * + * + *
+   * Required. The new view.
+   * 
+ * + * .google.logging.v2.LogView view = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The view. + */ + com.google.logging.v2.LogView getView(); + + /** + * + * + *
+   * Required. The new view.
+   * 
+ * + * .google.logging.v2.LogView view = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + com.google.logging.v2.LogViewOrBuilder getViewOrBuilder(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteBucketRequest.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteBucketRequest.java new file mode 100644 index 000000000000..a4de92e84389 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteBucketRequest.java @@ -0,0 +1,710 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * The parameters to `DeleteBucket`.
+ * 
+ * + * Protobuf type {@code google.logging.v2.DeleteBucketRequest} + */ +public final class DeleteBucketRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.DeleteBucketRequest) + DeleteBucketRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use DeleteBucketRequest.newBuilder() to construct. + private DeleteBucketRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteBucketRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteBucketRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_DeleteBucketRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_DeleteBucketRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.DeleteBucketRequest.class, + com.google.logging.v2.DeleteBucketRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. The full resource name of the bucket to delete.
+   *
+   *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *
+   * For example:
+   *
+   *   `"projects/my-project/locations/global/buckets/my-bucket"`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The full resource name of the bucket to delete.
+   *
+   *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *
+   * For example:
+   *
+   *   `"projects/my-project/locations/global/buckets/my-bucket"`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().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.logging.v2.DeleteBucketRequest)) { + return super.equals(obj); + } + com.google.logging.v2.DeleteBucketRequest other = + (com.google.logging.v2.DeleteBucketRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.DeleteBucketRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.DeleteBucketRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.DeleteBucketRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.DeleteBucketRequest 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.logging.v2.DeleteBucketRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.DeleteBucketRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.DeleteBucketRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.DeleteBucketRequest 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.logging.v2.DeleteBucketRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.DeleteBucketRequest 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.logging.v2.DeleteBucketRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.DeleteBucketRequest 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.logging.v2.DeleteBucketRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The parameters to `DeleteBucket`.
+   * 
+ * + * Protobuf type {@code google.logging.v2.DeleteBucketRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.DeleteBucketRequest) + com.google.logging.v2.DeleteBucketRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_DeleteBucketRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_DeleteBucketRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.DeleteBucketRequest.class, + com.google.logging.v2.DeleteBucketRequest.Builder.class); + } + + // Construct using com.google.logging.v2.DeleteBucketRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_DeleteBucketRequest_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.DeleteBucketRequest getDefaultInstanceForType() { + return com.google.logging.v2.DeleteBucketRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.DeleteBucketRequest build() { + com.google.logging.v2.DeleteBucketRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.DeleteBucketRequest buildPartial() { + com.google.logging.v2.DeleteBucketRequest result = + new com.google.logging.v2.DeleteBucketRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.logging.v2.DeleteBucketRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @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.logging.v2.DeleteBucketRequest) { + return mergeFrom((com.google.logging.v2.DeleteBucketRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.DeleteBucketRequest other) { + if (other == com.google.logging.v2.DeleteBucketRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. The full resource name of the bucket to delete.
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/locations/global/buckets/my-bucket"`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The full resource name of the bucket to delete.
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/locations/global/buckets/my-bucket"`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The full resource name of the bucket to delete.
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/locations/global/buckets/my-bucket"`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The full resource name of the bucket to delete.
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/locations/global/buckets/my-bucket"`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The full resource name of the bucket to delete.
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/locations/global/buckets/my-bucket"`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + 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.logging.v2.DeleteBucketRequest) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.DeleteBucketRequest) + private static final com.google.logging.v2.DeleteBucketRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.DeleteBucketRequest(); + } + + public static com.google.logging.v2.DeleteBucketRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteBucketRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.DeleteBucketRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteBucketRequestOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteBucketRequestOrBuilder.java new file mode 100644 index 000000000000..333833e1c4ea --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteBucketRequestOrBuilder.java @@ -0,0 +1,74 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface DeleteBucketRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.DeleteBucketRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The full resource name of the bucket to delete.
+   *
+   *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *
+   * For example:
+   *
+   *   `"projects/my-project/locations/global/buckets/my-bucket"`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Required. The full resource name of the bucket to delete.
+   *
+   *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *
+   * For example:
+   *
+   *   `"projects/my-project/locations/global/buckets/my-bucket"`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteExclusionRequest.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteExclusionRequest.java new file mode 100644 index 000000000000..5b9241fda27a --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteExclusionRequest.java @@ -0,0 +1,710 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * The parameters to `DeleteExclusion`.
+ * 
+ * + * Protobuf type {@code google.logging.v2.DeleteExclusionRequest} + */ +public final class DeleteExclusionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.DeleteExclusionRequest) + DeleteExclusionRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use DeleteExclusionRequest.newBuilder() to construct. + private DeleteExclusionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteExclusionRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteExclusionRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_DeleteExclusionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_DeleteExclusionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.DeleteExclusionRequest.class, + com.google.logging.v2.DeleteExclusionRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. The resource name of an existing exclusion to delete:
+   *
+   *     "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
+   *     "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
+   *     "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
+   *
+   * For example:
+   *
+   *   `"projects/my-project/exclusions/my-exclusion"`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The resource name of an existing exclusion to delete:
+   *
+   *     "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
+   *     "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
+   *     "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
+   *
+   * For example:
+   *
+   *   `"projects/my-project/exclusions/my-exclusion"`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().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.logging.v2.DeleteExclusionRequest)) { + return super.equals(obj); + } + com.google.logging.v2.DeleteExclusionRequest other = + (com.google.logging.v2.DeleteExclusionRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.DeleteExclusionRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.DeleteExclusionRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.DeleteExclusionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.DeleteExclusionRequest 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.logging.v2.DeleteExclusionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.DeleteExclusionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.DeleteExclusionRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.DeleteExclusionRequest 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.logging.v2.DeleteExclusionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.DeleteExclusionRequest 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.logging.v2.DeleteExclusionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.DeleteExclusionRequest 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.logging.v2.DeleteExclusionRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The parameters to `DeleteExclusion`.
+   * 
+ * + * Protobuf type {@code google.logging.v2.DeleteExclusionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.DeleteExclusionRequest) + com.google.logging.v2.DeleteExclusionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_DeleteExclusionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_DeleteExclusionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.DeleteExclusionRequest.class, + com.google.logging.v2.DeleteExclusionRequest.Builder.class); + } + + // Construct using com.google.logging.v2.DeleteExclusionRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_DeleteExclusionRequest_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.DeleteExclusionRequest getDefaultInstanceForType() { + return com.google.logging.v2.DeleteExclusionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.DeleteExclusionRequest build() { + com.google.logging.v2.DeleteExclusionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.DeleteExclusionRequest buildPartial() { + com.google.logging.v2.DeleteExclusionRequest result = + new com.google.logging.v2.DeleteExclusionRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.logging.v2.DeleteExclusionRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @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.logging.v2.DeleteExclusionRequest) { + return mergeFrom((com.google.logging.v2.DeleteExclusionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.DeleteExclusionRequest other) { + if (other == com.google.logging.v2.DeleteExclusionRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. The resource name of an existing exclusion to delete:
+     *
+     *     "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
+     *     "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
+     *     "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/exclusions/my-exclusion"`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The resource name of an existing exclusion to delete:
+     *
+     *     "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
+     *     "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
+     *     "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/exclusions/my-exclusion"`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The resource name of an existing exclusion to delete:
+     *
+     *     "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
+     *     "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
+     *     "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/exclusions/my-exclusion"`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The resource name of an existing exclusion to delete:
+     *
+     *     "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
+     *     "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
+     *     "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/exclusions/my-exclusion"`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The resource name of an existing exclusion to delete:
+     *
+     *     "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
+     *     "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
+     *     "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/exclusions/my-exclusion"`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + 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.logging.v2.DeleteExclusionRequest) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.DeleteExclusionRequest) + private static final com.google.logging.v2.DeleteExclusionRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.DeleteExclusionRequest(); + } + + public static com.google.logging.v2.DeleteExclusionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteExclusionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.DeleteExclusionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteExclusionRequestOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteExclusionRequestOrBuilder.java new file mode 100644 index 000000000000..085aec5738b4 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteExclusionRequestOrBuilder.java @@ -0,0 +1,74 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface DeleteExclusionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.DeleteExclusionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of an existing exclusion to delete:
+   *
+   *     "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
+   *     "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
+   *     "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
+   *
+   * For example:
+   *
+   *   `"projects/my-project/exclusions/my-exclusion"`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Required. The resource name of an existing exclusion to delete:
+   *
+   *     "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
+   *     "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
+   *     "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
+   *
+   * For example:
+   *
+   *   `"projects/my-project/exclusions/my-exclusion"`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteLinkRequest.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteLinkRequest.java new file mode 100644 index 000000000000..24bf2d23569d --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteLinkRequest.java @@ -0,0 +1,681 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * The parameters to DeleteLink.
+ * 
+ * + * Protobuf type {@code google.logging.v2.DeleteLinkRequest} + */ +public final class DeleteLinkRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.DeleteLinkRequest) + DeleteLinkRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use DeleteLinkRequest.newBuilder() to construct. + private DeleteLinkRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteLinkRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteLinkRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_DeleteLinkRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_DeleteLinkRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.DeleteLinkRequest.class, + com.google.logging.v2.DeleteLinkRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. The full resource name of the link to delete.
+   *
+   *  "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+   *   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+   *   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+   *   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The full resource name of the link to delete.
+   *
+   *  "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+   *   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+   *   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+   *   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().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.logging.v2.DeleteLinkRequest)) { + return super.equals(obj); + } + com.google.logging.v2.DeleteLinkRequest other = (com.google.logging.v2.DeleteLinkRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.DeleteLinkRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.DeleteLinkRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.DeleteLinkRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.DeleteLinkRequest 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.logging.v2.DeleteLinkRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.DeleteLinkRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.DeleteLinkRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.DeleteLinkRequest 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.logging.v2.DeleteLinkRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.DeleteLinkRequest 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.logging.v2.DeleteLinkRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.DeleteLinkRequest 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.logging.v2.DeleteLinkRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The parameters to DeleteLink.
+   * 
+ * + * Protobuf type {@code google.logging.v2.DeleteLinkRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.DeleteLinkRequest) + com.google.logging.v2.DeleteLinkRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_DeleteLinkRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_DeleteLinkRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.DeleteLinkRequest.class, + com.google.logging.v2.DeleteLinkRequest.Builder.class); + } + + // Construct using com.google.logging.v2.DeleteLinkRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_DeleteLinkRequest_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.DeleteLinkRequest getDefaultInstanceForType() { + return com.google.logging.v2.DeleteLinkRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.DeleteLinkRequest build() { + com.google.logging.v2.DeleteLinkRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.DeleteLinkRequest buildPartial() { + com.google.logging.v2.DeleteLinkRequest result = + new com.google.logging.v2.DeleteLinkRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.logging.v2.DeleteLinkRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @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.logging.v2.DeleteLinkRequest) { + return mergeFrom((com.google.logging.v2.DeleteLinkRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.DeleteLinkRequest other) { + if (other == com.google.logging.v2.DeleteLinkRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. The full resource name of the link to delete.
+     *
+     *  "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+     *   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+     *   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+     *   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The full resource name of the link to delete.
+     *
+     *  "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+     *   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+     *   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+     *   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The full resource name of the link to delete.
+     *
+     *  "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+     *   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+     *   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+     *   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The full resource name of the link to delete.
+     *
+     *  "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+     *   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+     *   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+     *   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The full resource name of the link to delete.
+     *
+     *  "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+     *   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+     *   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+     *   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + 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.logging.v2.DeleteLinkRequest) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.DeleteLinkRequest) + private static final com.google.logging.v2.DeleteLinkRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.DeleteLinkRequest(); + } + + public static com.google.logging.v2.DeleteLinkRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteLinkRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.DeleteLinkRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteLinkRequestOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteLinkRequestOrBuilder.java new file mode 100644 index 000000000000..a02c7192016d --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteLinkRequestOrBuilder.java @@ -0,0 +1,66 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface DeleteLinkRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.DeleteLinkRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The full resource name of the link to delete.
+   *
+   *  "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+   *   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+   *   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+   *   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Required. The full resource name of the link to delete.
+   *
+   *  "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+   *   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+   *   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+   *   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteLogMetricRequest.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteLogMetricRequest.java new file mode 100644 index 000000000000..a41c0add53ec --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteLogMetricRequest.java @@ -0,0 +1,661 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_metrics.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * The parameters to DeleteLogMetric.
+ * 
+ * + * Protobuf type {@code google.logging.v2.DeleteLogMetricRequest} + */ +public final class DeleteLogMetricRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.DeleteLogMetricRequest) + DeleteLogMetricRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use DeleteLogMetricRequest.newBuilder() to construct. + private DeleteLogMetricRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteLogMetricRequest() { + metricName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteLogMetricRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingMetricsProto + .internal_static_google_logging_v2_DeleteLogMetricRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingMetricsProto + .internal_static_google_logging_v2_DeleteLogMetricRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.DeleteLogMetricRequest.class, + com.google.logging.v2.DeleteLogMetricRequest.Builder.class); + } + + public static final int METRIC_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object metricName_ = ""; + + /** + * + * + *
+   * Required. The resource name of the metric to delete:
+   *
+   *     "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
+   * 
+ * + * + * string metric_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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; + } + } + + /** + * + * + *
+   * Required. The resource name of the metric to delete:
+   *
+   *     "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
+   * 
+ * + * + * string metric_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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; + } + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(metricName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, metricName_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(metricName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, metricName_); + } + size += getUnknownFields().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.logging.v2.DeleteLogMetricRequest)) { + return super.equals(obj); + } + com.google.logging.v2.DeleteLogMetricRequest other = + (com.google.logging.v2.DeleteLogMetricRequest) obj; + + if (!getMetricName().equals(other.getMetricName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.DeleteLogMetricRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.DeleteLogMetricRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.DeleteLogMetricRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.DeleteLogMetricRequest 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.logging.v2.DeleteLogMetricRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.DeleteLogMetricRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.DeleteLogMetricRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.DeleteLogMetricRequest 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.logging.v2.DeleteLogMetricRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.DeleteLogMetricRequest 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.logging.v2.DeleteLogMetricRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.DeleteLogMetricRequest 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.logging.v2.DeleteLogMetricRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The parameters to DeleteLogMetric.
+   * 
+ * + * Protobuf type {@code google.logging.v2.DeleteLogMetricRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.DeleteLogMetricRequest) + com.google.logging.v2.DeleteLogMetricRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingMetricsProto + .internal_static_google_logging_v2_DeleteLogMetricRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingMetricsProto + .internal_static_google_logging_v2_DeleteLogMetricRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.DeleteLogMetricRequest.class, + com.google.logging.v2.DeleteLogMetricRequest.Builder.class); + } + + // Construct using com.google.logging.v2.DeleteLogMetricRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + metricName_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingMetricsProto + .internal_static_google_logging_v2_DeleteLogMetricRequest_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.DeleteLogMetricRequest getDefaultInstanceForType() { + return com.google.logging.v2.DeleteLogMetricRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.DeleteLogMetricRequest build() { + com.google.logging.v2.DeleteLogMetricRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.DeleteLogMetricRequest buildPartial() { + com.google.logging.v2.DeleteLogMetricRequest result = + new com.google.logging.v2.DeleteLogMetricRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.logging.v2.DeleteLogMetricRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.metricName_ = metricName_; + } + } + + @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.logging.v2.DeleteLogMetricRequest) { + return mergeFrom((com.google.logging.v2.DeleteLogMetricRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.DeleteLogMetricRequest other) { + if (other == com.google.logging.v2.DeleteLogMetricRequest.getDefaultInstance()) return this; + if (!other.getMetricName().isEmpty()) { + metricName_ = other.metricName_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + metricName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object metricName_ = ""; + + /** + * + * + *
+     * Required. The resource name of the metric to delete:
+     *
+     *     "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
+     * 
+ * + * + * string metric_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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; + } + } + + /** + * + * + *
+     * Required. The resource name of the metric to delete:
+     *
+     *     "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
+     * 
+ * + * + * string metric_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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; + } + } + + /** + * + * + *
+     * Required. The resource name of the metric to delete:
+     *
+     *     "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
+     * 
+ * + * + * string metric_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The resource name of the metric to delete:
+     *
+     *     "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
+     * 
+ * + * + * string metric_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearMetricName() { + metricName_ = getDefaultInstance().getMetricName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The resource name of the metric to delete:
+     *
+     *     "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
+     * 
+ * + * + * string metric_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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; + 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.logging.v2.DeleteLogMetricRequest) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.DeleteLogMetricRequest) + private static final com.google.logging.v2.DeleteLogMetricRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.DeleteLogMetricRequest(); + } + + public static com.google.logging.v2.DeleteLogMetricRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteLogMetricRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.DeleteLogMetricRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteLogMetricRequestOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteLogMetricRequestOrBuilder.java new file mode 100644 index 000000000000..b32fe1a65dc6 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteLogMetricRequestOrBuilder.java @@ -0,0 +1,60 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_metrics.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface DeleteLogMetricRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.DeleteLogMetricRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the metric to delete:
+   *
+   *     "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
+   * 
+ * + * + * string metric_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The metricName. + */ + java.lang.String getMetricName(); + + /** + * + * + *
+   * Required. The resource name of the metric to delete:
+   *
+   *     "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
+   * 
+ * + * + * string metric_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for metricName. + */ + com.google.protobuf.ByteString getMetricNameBytes(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteLogRequest.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteLogRequest.java new file mode 100644 index 000000000000..88218d316724 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteLogRequest.java @@ -0,0 +1,730 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * The parameters to DeleteLog.
+ * 
+ * + * Protobuf type {@code google.logging.v2.DeleteLogRequest} + */ +public final class DeleteLogRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.DeleteLogRequest) + DeleteLogRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use DeleteLogRequest.newBuilder() to construct. + private DeleteLogRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteLogRequest() { + logName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteLogRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_DeleteLogRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_DeleteLogRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.DeleteLogRequest.class, + com.google.logging.v2.DeleteLogRequest.Builder.class); + } + + public static final int LOG_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object logName_ = ""; + + /** + * + * + *
+   * Required. The resource name of the log to delete:
+   *
+   * * `projects/[PROJECT_ID]/logs/[LOG_ID]`
+   * * `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]`
+   * * `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]`
+   * * `folders/[FOLDER_ID]/logs/[LOG_ID]`
+   *
+   * `[LOG_ID]` must be URL-encoded. For example,
+   * `"projects/my-project-id/logs/syslog"`,
+   * `"organizations/123/logs/cloudaudit.googleapis.com%2Factivity"`.
+   *
+   * For more information about log names, see
+   * [LogEntry][google.logging.v2.LogEntry].
+   * 
+ * + * + * string log_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The logName. + */ + @java.lang.Override + public java.lang.String getLogName() { + java.lang.Object ref = logName_; + 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(); + logName_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The resource name of the log to delete:
+   *
+   * * `projects/[PROJECT_ID]/logs/[LOG_ID]`
+   * * `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]`
+   * * `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]`
+   * * `folders/[FOLDER_ID]/logs/[LOG_ID]`
+   *
+   * `[LOG_ID]` must be URL-encoded. For example,
+   * `"projects/my-project-id/logs/syslog"`,
+   * `"organizations/123/logs/cloudaudit.googleapis.com%2Factivity"`.
+   *
+   * For more information about log names, see
+   * [LogEntry][google.logging.v2.LogEntry].
+   * 
+ * + * + * string log_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for logName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLogNameBytes() { + java.lang.Object ref = logName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + logName_ = 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(logName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, logName_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(logName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, logName_); + } + size += getUnknownFields().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.logging.v2.DeleteLogRequest)) { + return super.equals(obj); + } + com.google.logging.v2.DeleteLogRequest other = (com.google.logging.v2.DeleteLogRequest) obj; + + if (!getLogName().equals(other.getLogName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + LOG_NAME_FIELD_NUMBER; + hash = (53 * hash) + getLogName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.DeleteLogRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.DeleteLogRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.DeleteLogRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.DeleteLogRequest 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.logging.v2.DeleteLogRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.DeleteLogRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.DeleteLogRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.DeleteLogRequest 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.logging.v2.DeleteLogRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.DeleteLogRequest 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.logging.v2.DeleteLogRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.DeleteLogRequest 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.logging.v2.DeleteLogRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The parameters to DeleteLog.
+   * 
+ * + * Protobuf type {@code google.logging.v2.DeleteLogRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.DeleteLogRequest) + com.google.logging.v2.DeleteLogRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_DeleteLogRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_DeleteLogRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.DeleteLogRequest.class, + com.google.logging.v2.DeleteLogRequest.Builder.class); + } + + // Construct using com.google.logging.v2.DeleteLogRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + logName_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_DeleteLogRequest_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.DeleteLogRequest getDefaultInstanceForType() { + return com.google.logging.v2.DeleteLogRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.DeleteLogRequest build() { + com.google.logging.v2.DeleteLogRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.DeleteLogRequest buildPartial() { + com.google.logging.v2.DeleteLogRequest result = + new com.google.logging.v2.DeleteLogRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.logging.v2.DeleteLogRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.logName_ = logName_; + } + } + + @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.logging.v2.DeleteLogRequest) { + return mergeFrom((com.google.logging.v2.DeleteLogRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.DeleteLogRequest other) { + if (other == com.google.logging.v2.DeleteLogRequest.getDefaultInstance()) return this; + if (!other.getLogName().isEmpty()) { + logName_ = other.logName_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + logName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object logName_ = ""; + + /** + * + * + *
+     * Required. The resource name of the log to delete:
+     *
+     * * `projects/[PROJECT_ID]/logs/[LOG_ID]`
+     * * `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]`
+     * * `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]`
+     * * `folders/[FOLDER_ID]/logs/[LOG_ID]`
+     *
+     * `[LOG_ID]` must be URL-encoded. For example,
+     * `"projects/my-project-id/logs/syslog"`,
+     * `"organizations/123/logs/cloudaudit.googleapis.com%2Factivity"`.
+     *
+     * For more information about log names, see
+     * [LogEntry][google.logging.v2.LogEntry].
+     * 
+ * + * + * string log_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The logName. + */ + public java.lang.String getLogName() { + java.lang.Object ref = logName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + logName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The resource name of the log to delete:
+     *
+     * * `projects/[PROJECT_ID]/logs/[LOG_ID]`
+     * * `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]`
+     * * `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]`
+     * * `folders/[FOLDER_ID]/logs/[LOG_ID]`
+     *
+     * `[LOG_ID]` must be URL-encoded. For example,
+     * `"projects/my-project-id/logs/syslog"`,
+     * `"organizations/123/logs/cloudaudit.googleapis.com%2Factivity"`.
+     *
+     * For more information about log names, see
+     * [LogEntry][google.logging.v2.LogEntry].
+     * 
+ * + * + * string log_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for logName. + */ + public com.google.protobuf.ByteString getLogNameBytes() { + java.lang.Object ref = logName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + logName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The resource name of the log to delete:
+     *
+     * * `projects/[PROJECT_ID]/logs/[LOG_ID]`
+     * * `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]`
+     * * `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]`
+     * * `folders/[FOLDER_ID]/logs/[LOG_ID]`
+     *
+     * `[LOG_ID]` must be URL-encoded. For example,
+     * `"projects/my-project-id/logs/syslog"`,
+     * `"organizations/123/logs/cloudaudit.googleapis.com%2Factivity"`.
+     *
+     * For more information about log names, see
+     * [LogEntry][google.logging.v2.LogEntry].
+     * 
+ * + * + * string log_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The logName to set. + * @return This builder for chaining. + */ + public Builder setLogName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + logName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The resource name of the log to delete:
+     *
+     * * `projects/[PROJECT_ID]/logs/[LOG_ID]`
+     * * `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]`
+     * * `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]`
+     * * `folders/[FOLDER_ID]/logs/[LOG_ID]`
+     *
+     * `[LOG_ID]` must be URL-encoded. For example,
+     * `"projects/my-project-id/logs/syslog"`,
+     * `"organizations/123/logs/cloudaudit.googleapis.com%2Factivity"`.
+     *
+     * For more information about log names, see
+     * [LogEntry][google.logging.v2.LogEntry].
+     * 
+ * + * + * string log_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearLogName() { + logName_ = getDefaultInstance().getLogName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The resource name of the log to delete:
+     *
+     * * `projects/[PROJECT_ID]/logs/[LOG_ID]`
+     * * `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]`
+     * * `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]`
+     * * `folders/[FOLDER_ID]/logs/[LOG_ID]`
+     *
+     * `[LOG_ID]` must be URL-encoded. For example,
+     * `"projects/my-project-id/logs/syslog"`,
+     * `"organizations/123/logs/cloudaudit.googleapis.com%2Factivity"`.
+     *
+     * For more information about log names, see
+     * [LogEntry][google.logging.v2.LogEntry].
+     * 
+ * + * + * string log_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for logName to set. + * @return This builder for chaining. + */ + public Builder setLogNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + logName_ = value; + 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.logging.v2.DeleteLogRequest) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.DeleteLogRequest) + private static final com.google.logging.v2.DeleteLogRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.DeleteLogRequest(); + } + + public static com.google.logging.v2.DeleteLogRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteLogRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.DeleteLogRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteLogRequestOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteLogRequestOrBuilder.java new file mode 100644 index 000000000000..4bb411c68a48 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteLogRequestOrBuilder.java @@ -0,0 +1,80 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface DeleteLogRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.DeleteLogRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the log to delete:
+   *
+   * * `projects/[PROJECT_ID]/logs/[LOG_ID]`
+   * * `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]`
+   * * `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]`
+   * * `folders/[FOLDER_ID]/logs/[LOG_ID]`
+   *
+   * `[LOG_ID]` must be URL-encoded. For example,
+   * `"projects/my-project-id/logs/syslog"`,
+   * `"organizations/123/logs/cloudaudit.googleapis.com%2Factivity"`.
+   *
+   * For more information about log names, see
+   * [LogEntry][google.logging.v2.LogEntry].
+   * 
+ * + * + * string log_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The logName. + */ + java.lang.String getLogName(); + + /** + * + * + *
+   * Required. The resource name of the log to delete:
+   *
+   * * `projects/[PROJECT_ID]/logs/[LOG_ID]`
+   * * `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]`
+   * * `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]`
+   * * `folders/[FOLDER_ID]/logs/[LOG_ID]`
+   *
+   * `[LOG_ID]` must be URL-encoded. For example,
+   * `"projects/my-project-id/logs/syslog"`,
+   * `"organizations/123/logs/cloudaudit.googleapis.com%2Factivity"`.
+   *
+   * For more information about log names, see
+   * [LogEntry][google.logging.v2.LogEntry].
+   * 
+ * + * + * string log_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for logName. + */ + com.google.protobuf.ByteString getLogNameBytes(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteSinkRequest.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteSinkRequest.java new file mode 100644 index 000000000000..617b8332569c --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteSinkRequest.java @@ -0,0 +1,716 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * The parameters to `DeleteSink`.
+ * 
+ * + * Protobuf type {@code google.logging.v2.DeleteSinkRequest} + */ +public final class DeleteSinkRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.DeleteSinkRequest) + DeleteSinkRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use DeleteSinkRequest.newBuilder() to construct. + private DeleteSinkRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteSinkRequest() { + sinkName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteSinkRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_DeleteSinkRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_DeleteSinkRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.DeleteSinkRequest.class, + com.google.logging.v2.DeleteSinkRequest.Builder.class); + } + + public static final int SINK_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object sinkName_ = ""; + + /** + * + * + *
+   * Required. The full resource name of the sink to delete, including the
+   * parent resource and the sink identifier:
+   *
+   *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
+   *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
+   *     "folders/[FOLDER_ID]/sinks/[SINK_ID]"
+   *
+   * For example:
+   *
+   *   `"projects/my-project/sinks/my-sink"`
+   * 
+ * + * + * string sink_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The sinkName. + */ + @java.lang.Override + public java.lang.String getSinkName() { + java.lang.Object ref = sinkName_; + 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(); + sinkName_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The full resource name of the sink to delete, including the
+   * parent resource and the sink identifier:
+   *
+   *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
+   *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
+   *     "folders/[FOLDER_ID]/sinks/[SINK_ID]"
+   *
+   * For example:
+   *
+   *   `"projects/my-project/sinks/my-sink"`
+   * 
+ * + * + * string sink_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for sinkName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSinkNameBytes() { + java.lang.Object ref = sinkName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sinkName_ = 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sinkName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, sinkName_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sinkName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, sinkName_); + } + size += getUnknownFields().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.logging.v2.DeleteSinkRequest)) { + return super.equals(obj); + } + com.google.logging.v2.DeleteSinkRequest other = (com.google.logging.v2.DeleteSinkRequest) obj; + + if (!getSinkName().equals(other.getSinkName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + SINK_NAME_FIELD_NUMBER; + hash = (53 * hash) + getSinkName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.DeleteSinkRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.DeleteSinkRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.DeleteSinkRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.DeleteSinkRequest 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.logging.v2.DeleteSinkRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.DeleteSinkRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.DeleteSinkRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.DeleteSinkRequest 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.logging.v2.DeleteSinkRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.DeleteSinkRequest 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.logging.v2.DeleteSinkRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.DeleteSinkRequest 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.logging.v2.DeleteSinkRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The parameters to `DeleteSink`.
+   * 
+ * + * Protobuf type {@code google.logging.v2.DeleteSinkRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.DeleteSinkRequest) + com.google.logging.v2.DeleteSinkRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_DeleteSinkRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_DeleteSinkRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.DeleteSinkRequest.class, + com.google.logging.v2.DeleteSinkRequest.Builder.class); + } + + // Construct using com.google.logging.v2.DeleteSinkRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + sinkName_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_DeleteSinkRequest_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.DeleteSinkRequest getDefaultInstanceForType() { + return com.google.logging.v2.DeleteSinkRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.DeleteSinkRequest build() { + com.google.logging.v2.DeleteSinkRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.DeleteSinkRequest buildPartial() { + com.google.logging.v2.DeleteSinkRequest result = + new com.google.logging.v2.DeleteSinkRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.logging.v2.DeleteSinkRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.sinkName_ = sinkName_; + } + } + + @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.logging.v2.DeleteSinkRequest) { + return mergeFrom((com.google.logging.v2.DeleteSinkRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.DeleteSinkRequest other) { + if (other == com.google.logging.v2.DeleteSinkRequest.getDefaultInstance()) return this; + if (!other.getSinkName().isEmpty()) { + sinkName_ = other.sinkName_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + sinkName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object sinkName_ = ""; + + /** + * + * + *
+     * Required. The full resource name of the sink to delete, including the
+     * parent resource and the sink identifier:
+     *
+     *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
+     *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
+     *     "folders/[FOLDER_ID]/sinks/[SINK_ID]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/sinks/my-sink"`
+     * 
+ * + * + * string sink_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The sinkName. + */ + public java.lang.String getSinkName() { + java.lang.Object ref = sinkName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sinkName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The full resource name of the sink to delete, including the
+     * parent resource and the sink identifier:
+     *
+     *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
+     *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
+     *     "folders/[FOLDER_ID]/sinks/[SINK_ID]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/sinks/my-sink"`
+     * 
+ * + * + * string sink_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for sinkName. + */ + public com.google.protobuf.ByteString getSinkNameBytes() { + java.lang.Object ref = sinkName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sinkName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The full resource name of the sink to delete, including the
+     * parent resource and the sink identifier:
+     *
+     *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
+     *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
+     *     "folders/[FOLDER_ID]/sinks/[SINK_ID]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/sinks/my-sink"`
+     * 
+ * + * + * string sink_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The sinkName to set. + * @return This builder for chaining. + */ + public Builder setSinkName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + sinkName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The full resource name of the sink to delete, including the
+     * parent resource and the sink identifier:
+     *
+     *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
+     *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
+     *     "folders/[FOLDER_ID]/sinks/[SINK_ID]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/sinks/my-sink"`
+     * 
+ * + * + * string sink_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearSinkName() { + sinkName_ = getDefaultInstance().getSinkName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The full resource name of the sink to delete, including the
+     * parent resource and the sink identifier:
+     *
+     *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
+     *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
+     *     "folders/[FOLDER_ID]/sinks/[SINK_ID]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/sinks/my-sink"`
+     * 
+ * + * + * string sink_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for sinkName to set. + * @return This builder for chaining. + */ + public Builder setSinkNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + sinkName_ = value; + 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.logging.v2.DeleteSinkRequest) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.DeleteSinkRequest) + private static final com.google.logging.v2.DeleteSinkRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.DeleteSinkRequest(); + } + + public static com.google.logging.v2.DeleteSinkRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteSinkRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.DeleteSinkRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteSinkRequestOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteSinkRequestOrBuilder.java new file mode 100644 index 000000000000..b31bcf1e8579 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteSinkRequestOrBuilder.java @@ -0,0 +1,76 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface DeleteSinkRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.DeleteSinkRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The full resource name of the sink to delete, including the
+   * parent resource and the sink identifier:
+   *
+   *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
+   *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
+   *     "folders/[FOLDER_ID]/sinks/[SINK_ID]"
+   *
+   * For example:
+   *
+   *   `"projects/my-project/sinks/my-sink"`
+   * 
+ * + * + * string sink_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The sinkName. + */ + java.lang.String getSinkName(); + + /** + * + * + *
+   * Required. The full resource name of the sink to delete, including the
+   * parent resource and the sink identifier:
+   *
+   *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
+   *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
+   *     "folders/[FOLDER_ID]/sinks/[SINK_ID]"
+   *
+   * For example:
+   *
+   *   `"projects/my-project/sinks/my-sink"`
+   * 
+ * + * + * string sink_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for sinkName. + */ + com.google.protobuf.ByteString getSinkNameBytes(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteViewRequest.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteViewRequest.java new file mode 100644 index 000000000000..f87c02b24a17 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteViewRequest.java @@ -0,0 +1,688 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * The parameters to `DeleteView`.
+ * 
+ * + * Protobuf type {@code google.logging.v2.DeleteViewRequest} + */ +public final class DeleteViewRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.DeleteViewRequest) + DeleteViewRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use DeleteViewRequest.newBuilder() to construct. + private DeleteViewRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteViewRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteViewRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_DeleteViewRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_DeleteViewRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.DeleteViewRequest.class, + com.google.logging.v2.DeleteViewRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. The full resource name of the view to delete:
+   *
+   *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]"
+   *
+   * For example:
+   *
+   *    `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The full resource name of the view to delete:
+   *
+   *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]"
+   *
+   * For example:
+   *
+   *    `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().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.logging.v2.DeleteViewRequest)) { + return super.equals(obj); + } + com.google.logging.v2.DeleteViewRequest other = (com.google.logging.v2.DeleteViewRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.DeleteViewRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.DeleteViewRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.DeleteViewRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.DeleteViewRequest 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.logging.v2.DeleteViewRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.DeleteViewRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.DeleteViewRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.DeleteViewRequest 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.logging.v2.DeleteViewRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.DeleteViewRequest 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.logging.v2.DeleteViewRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.DeleteViewRequest 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.logging.v2.DeleteViewRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The parameters to `DeleteView`.
+   * 
+ * + * Protobuf type {@code google.logging.v2.DeleteViewRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.DeleteViewRequest) + com.google.logging.v2.DeleteViewRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_DeleteViewRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_DeleteViewRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.DeleteViewRequest.class, + com.google.logging.v2.DeleteViewRequest.Builder.class); + } + + // Construct using com.google.logging.v2.DeleteViewRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_DeleteViewRequest_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.DeleteViewRequest getDefaultInstanceForType() { + return com.google.logging.v2.DeleteViewRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.DeleteViewRequest build() { + com.google.logging.v2.DeleteViewRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.DeleteViewRequest buildPartial() { + com.google.logging.v2.DeleteViewRequest result = + new com.google.logging.v2.DeleteViewRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.logging.v2.DeleteViewRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @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.logging.v2.DeleteViewRequest) { + return mergeFrom((com.google.logging.v2.DeleteViewRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.DeleteViewRequest other) { + if (other == com.google.logging.v2.DeleteViewRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. The full resource name of the view to delete:
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]"
+     *
+     * For example:
+     *
+     *    `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The full resource name of the view to delete:
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]"
+     *
+     * For example:
+     *
+     *    `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The full resource name of the view to delete:
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]"
+     *
+     * For example:
+     *
+     *    `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The full resource name of the view to delete:
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]"
+     *
+     * For example:
+     *
+     *    `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The full resource name of the view to delete:
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]"
+     *
+     * For example:
+     *
+     *    `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + 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.logging.v2.DeleteViewRequest) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.DeleteViewRequest) + private static final com.google.logging.v2.DeleteViewRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.DeleteViewRequest(); + } + + public static com.google.logging.v2.DeleteViewRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteViewRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.DeleteViewRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteViewRequestOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteViewRequestOrBuilder.java new file mode 100644 index 000000000000..f69f397ca401 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteViewRequestOrBuilder.java @@ -0,0 +1,68 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface DeleteViewRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.DeleteViewRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The full resource name of the view to delete:
+   *
+   *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]"
+   *
+   * For example:
+   *
+   *    `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Required. The full resource name of the view to delete:
+   *
+   *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]"
+   *
+   * For example:
+   *
+   *    `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/FolderLocationName.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/FolderLocationName.java new file mode 100644 index 000000000000..74e72ff9a5bc --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/FolderLocationName.java @@ -0,0 +1,192 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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.logging.v2; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class FolderLocationName implements ResourceName { + private static final PathTemplate FOLDER_LOCATION = + PathTemplate.createWithoutUrlEncoding("folders/{folder}/locations/{location}"); + private volatile Map fieldValuesMap; + private final String folder; + private final String location; + + @Deprecated + protected FolderLocationName() { + folder = null; + location = null; + } + + private FolderLocationName(Builder builder) { + folder = Preconditions.checkNotNull(builder.getFolder()); + location = Preconditions.checkNotNull(builder.getLocation()); + } + + public String getFolder() { + return folder; + } + + public String getLocation() { + return location; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static FolderLocationName of(String folder, String location) { + return newBuilder().setFolder(folder).setLocation(location).build(); + } + + public static String format(String folder, String location) { + return newBuilder().setFolder(folder).setLocation(location).build().toString(); + } + + public static FolderLocationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + FOLDER_LOCATION.validatedMatch( + formattedString, "FolderLocationName.parse: formattedString not in valid format"); + return of(matchMap.get("folder"), matchMap.get("location")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (FolderLocationName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return FOLDER_LOCATION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (folder != null) { + fieldMapBuilder.put("folder", folder); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return FOLDER_LOCATION.instantiate("folder", folder, "location", location); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + FolderLocationName that = ((FolderLocationName) o); + return Objects.equals(this.folder, that.folder) + && Objects.equals(this.location, that.location); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(folder); + h *= 1000003; + h ^= Objects.hashCode(location); + return h; + } + + /** Builder for folders/{folder}/locations/{location}. */ + public static class Builder { + private String folder; + private String location; + + protected Builder() {} + + public String getFolder() { + return folder; + } + + public String getLocation() { + return location; + } + + public Builder setFolder(String folder) { + this.folder = folder; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + private Builder(FolderLocationName folderLocationName) { + this.folder = folderLocationName.folder; + this.location = folderLocationName.location; + } + + public FolderLocationName build() { + return new FolderLocationName(this); + } + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/FolderName.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/FolderName.java new file mode 100644 index 000000000000..06b243aa076f --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/FolderName.java @@ -0,0 +1,168 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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.logging.v2; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class FolderName implements ResourceName { + private static final PathTemplate FOLDER = + PathTemplate.createWithoutUrlEncoding("folders/{folder}"); + private volatile Map fieldValuesMap; + private final String folder; + + @Deprecated + protected FolderName() { + folder = null; + } + + private FolderName(Builder builder) { + folder = Preconditions.checkNotNull(builder.getFolder()); + } + + public String getFolder() { + return folder; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static FolderName of(String folder) { + return newBuilder().setFolder(folder).build(); + } + + public static String format(String folder) { + return newBuilder().setFolder(folder).build().toString(); + } + + public static FolderName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + FOLDER.validatedMatch( + formattedString, "FolderName.parse: formattedString not in valid format"); + return of(matchMap.get("folder")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (FolderName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return FOLDER.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (folder != null) { + fieldMapBuilder.put("folder", folder); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return FOLDER.instantiate("folder", folder); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + FolderName that = ((FolderName) o); + return Objects.equals(this.folder, that.folder); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(folder); + return h; + } + + /** Builder for folders/{folder}. */ + public static class Builder { + private String folder; + + protected Builder() {} + + public String getFolder() { + return folder; + } + + public Builder setFolder(String folder) { + this.folder = folder; + return this; + } + + private Builder(FolderName folderName) { + this.folder = folderName.folder; + } + + public FolderName build() { + return new FolderName(this); + } + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetBucketRequest.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetBucketRequest.java new file mode 100644 index 000000000000..24d0a62e2b36 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetBucketRequest.java @@ -0,0 +1,709 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * The parameters to `GetBucket`.
+ * 
+ * + * Protobuf type {@code google.logging.v2.GetBucketRequest} + */ +public final class GetBucketRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.GetBucketRequest) + GetBucketRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use GetBucketRequest.newBuilder() to construct. + private GetBucketRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetBucketRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetBucketRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_GetBucketRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_GetBucketRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.GetBucketRequest.class, + com.google.logging.v2.GetBucketRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. The resource name of the bucket:
+   *
+   *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *
+   * For example:
+   *
+   *   `"projects/my-project/locations/global/buckets/my-bucket"`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The resource name of the bucket:
+   *
+   *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *
+   * For example:
+   *
+   *   `"projects/my-project/locations/global/buckets/my-bucket"`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().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.logging.v2.GetBucketRequest)) { + return super.equals(obj); + } + com.google.logging.v2.GetBucketRequest other = (com.google.logging.v2.GetBucketRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.GetBucketRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.GetBucketRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.GetBucketRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.GetBucketRequest 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.logging.v2.GetBucketRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.GetBucketRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.GetBucketRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.GetBucketRequest 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.logging.v2.GetBucketRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.GetBucketRequest 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.logging.v2.GetBucketRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.GetBucketRequest 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.logging.v2.GetBucketRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The parameters to `GetBucket`.
+   * 
+ * + * Protobuf type {@code google.logging.v2.GetBucketRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.GetBucketRequest) + com.google.logging.v2.GetBucketRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_GetBucketRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_GetBucketRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.GetBucketRequest.class, + com.google.logging.v2.GetBucketRequest.Builder.class); + } + + // Construct using com.google.logging.v2.GetBucketRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_GetBucketRequest_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.GetBucketRequest getDefaultInstanceForType() { + return com.google.logging.v2.GetBucketRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.GetBucketRequest build() { + com.google.logging.v2.GetBucketRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.GetBucketRequest buildPartial() { + com.google.logging.v2.GetBucketRequest result = + new com.google.logging.v2.GetBucketRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.logging.v2.GetBucketRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @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.logging.v2.GetBucketRequest) { + return mergeFrom((com.google.logging.v2.GetBucketRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.GetBucketRequest other) { + if (other == com.google.logging.v2.GetBucketRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. The resource name of the bucket:
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/locations/global/buckets/my-bucket"`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The resource name of the bucket:
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/locations/global/buckets/my-bucket"`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The resource name of the bucket:
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/locations/global/buckets/my-bucket"`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The resource name of the bucket:
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/locations/global/buckets/my-bucket"`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The resource name of the bucket:
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/locations/global/buckets/my-bucket"`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + 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.logging.v2.GetBucketRequest) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.GetBucketRequest) + private static final com.google.logging.v2.GetBucketRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.GetBucketRequest(); + } + + public static com.google.logging.v2.GetBucketRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetBucketRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.GetBucketRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetBucketRequestOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetBucketRequestOrBuilder.java new file mode 100644 index 000000000000..37af71550fb3 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetBucketRequestOrBuilder.java @@ -0,0 +1,74 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface GetBucketRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.GetBucketRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the bucket:
+   *
+   *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *
+   * For example:
+   *
+   *   `"projects/my-project/locations/global/buckets/my-bucket"`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Required. The resource name of the bucket:
+   *
+   *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *
+   * For example:
+   *
+   *   `"projects/my-project/locations/global/buckets/my-bucket"`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetCmekSettingsRequest.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetCmekSettingsRequest.java new file mode 100644 index 000000000000..07ad21cb161e --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetCmekSettingsRequest.java @@ -0,0 +1,755 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * The parameters to
+ * [GetCmekSettings][google.logging.v2.ConfigServiceV2.GetCmekSettings].
+ *
+ * See [Enabling CMEK for Log
+ * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for
+ * more information.
+ * 
+ * + * Protobuf type {@code google.logging.v2.GetCmekSettingsRequest} + */ +public final class GetCmekSettingsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.GetCmekSettingsRequest) + GetCmekSettingsRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use GetCmekSettingsRequest.newBuilder() to construct. + private GetCmekSettingsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetCmekSettingsRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetCmekSettingsRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_GetCmekSettingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_GetCmekSettingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.GetCmekSettingsRequest.class, + com.google.logging.v2.GetCmekSettingsRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. The resource for which to retrieve CMEK settings.
+   *
+   *     "projects/[PROJECT_ID]/cmekSettings"
+   *     "organizations/[ORGANIZATION_ID]/cmekSettings"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings"
+   *     "folders/[FOLDER_ID]/cmekSettings"
+   *
+   * For example:
+   *
+   *   `"organizations/12345/cmekSettings"`
+   *
+   * Note: CMEK for the Log Router can be configured for Google Cloud projects,
+   * folders, organizations and billing accounts. Once configured for an
+   * organization, it applies to all projects and folders in the Google Cloud
+   * organization.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The resource for which to retrieve CMEK settings.
+   *
+   *     "projects/[PROJECT_ID]/cmekSettings"
+   *     "organizations/[ORGANIZATION_ID]/cmekSettings"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings"
+   *     "folders/[FOLDER_ID]/cmekSettings"
+   *
+   * For example:
+   *
+   *   `"organizations/12345/cmekSettings"`
+   *
+   * Note: CMEK for the Log Router can be configured for Google Cloud projects,
+   * folders, organizations and billing accounts. Once configured for an
+   * organization, it applies to all projects and folders in the Google Cloud
+   * organization.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().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.logging.v2.GetCmekSettingsRequest)) { + return super.equals(obj); + } + com.google.logging.v2.GetCmekSettingsRequest other = + (com.google.logging.v2.GetCmekSettingsRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.GetCmekSettingsRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.GetCmekSettingsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.GetCmekSettingsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.GetCmekSettingsRequest 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.logging.v2.GetCmekSettingsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.GetCmekSettingsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.GetCmekSettingsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.GetCmekSettingsRequest 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.logging.v2.GetCmekSettingsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.GetCmekSettingsRequest 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.logging.v2.GetCmekSettingsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.GetCmekSettingsRequest 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.logging.v2.GetCmekSettingsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The parameters to
+   * [GetCmekSettings][google.logging.v2.ConfigServiceV2.GetCmekSettings].
+   *
+   * See [Enabling CMEK for Log
+   * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for
+   * more information.
+   * 
+ * + * Protobuf type {@code google.logging.v2.GetCmekSettingsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.GetCmekSettingsRequest) + com.google.logging.v2.GetCmekSettingsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_GetCmekSettingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_GetCmekSettingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.GetCmekSettingsRequest.class, + com.google.logging.v2.GetCmekSettingsRequest.Builder.class); + } + + // Construct using com.google.logging.v2.GetCmekSettingsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_GetCmekSettingsRequest_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.GetCmekSettingsRequest getDefaultInstanceForType() { + return com.google.logging.v2.GetCmekSettingsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.GetCmekSettingsRequest build() { + com.google.logging.v2.GetCmekSettingsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.GetCmekSettingsRequest buildPartial() { + com.google.logging.v2.GetCmekSettingsRequest result = + new com.google.logging.v2.GetCmekSettingsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.logging.v2.GetCmekSettingsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @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.logging.v2.GetCmekSettingsRequest) { + return mergeFrom((com.google.logging.v2.GetCmekSettingsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.GetCmekSettingsRequest other) { + if (other == com.google.logging.v2.GetCmekSettingsRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. The resource for which to retrieve CMEK settings.
+     *
+     *     "projects/[PROJECT_ID]/cmekSettings"
+     *     "organizations/[ORGANIZATION_ID]/cmekSettings"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings"
+     *     "folders/[FOLDER_ID]/cmekSettings"
+     *
+     * For example:
+     *
+     *   `"organizations/12345/cmekSettings"`
+     *
+     * Note: CMEK for the Log Router can be configured for Google Cloud projects,
+     * folders, organizations and billing accounts. Once configured for an
+     * organization, it applies to all projects and folders in the Google Cloud
+     * organization.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The resource for which to retrieve CMEK settings.
+     *
+     *     "projects/[PROJECT_ID]/cmekSettings"
+     *     "organizations/[ORGANIZATION_ID]/cmekSettings"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings"
+     *     "folders/[FOLDER_ID]/cmekSettings"
+     *
+     * For example:
+     *
+     *   `"organizations/12345/cmekSettings"`
+     *
+     * Note: CMEK for the Log Router can be configured for Google Cloud projects,
+     * folders, organizations and billing accounts. Once configured for an
+     * organization, it applies to all projects and folders in the Google Cloud
+     * organization.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The resource for which to retrieve CMEK settings.
+     *
+     *     "projects/[PROJECT_ID]/cmekSettings"
+     *     "organizations/[ORGANIZATION_ID]/cmekSettings"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings"
+     *     "folders/[FOLDER_ID]/cmekSettings"
+     *
+     * For example:
+     *
+     *   `"organizations/12345/cmekSettings"`
+     *
+     * Note: CMEK for the Log Router can be configured for Google Cloud projects,
+     * folders, organizations and billing accounts. Once configured for an
+     * organization, it applies to all projects and folders in the Google Cloud
+     * organization.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The resource for which to retrieve CMEK settings.
+     *
+     *     "projects/[PROJECT_ID]/cmekSettings"
+     *     "organizations/[ORGANIZATION_ID]/cmekSettings"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings"
+     *     "folders/[FOLDER_ID]/cmekSettings"
+     *
+     * For example:
+     *
+     *   `"organizations/12345/cmekSettings"`
+     *
+     * Note: CMEK for the Log Router can be configured for Google Cloud projects,
+     * folders, organizations and billing accounts. Once configured for an
+     * organization, it applies to all projects and folders in the Google Cloud
+     * organization.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The resource for which to retrieve CMEK settings.
+     *
+     *     "projects/[PROJECT_ID]/cmekSettings"
+     *     "organizations/[ORGANIZATION_ID]/cmekSettings"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings"
+     *     "folders/[FOLDER_ID]/cmekSettings"
+     *
+     * For example:
+     *
+     *   `"organizations/12345/cmekSettings"`
+     *
+     * Note: CMEK for the Log Router can be configured for Google Cloud projects,
+     * folders, organizations and billing accounts. Once configured for an
+     * organization, it applies to all projects and folders in the Google Cloud
+     * organization.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + 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.logging.v2.GetCmekSettingsRequest) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.GetCmekSettingsRequest) + private static final com.google.logging.v2.GetCmekSettingsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.GetCmekSettingsRequest(); + } + + public static com.google.logging.v2.GetCmekSettingsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetCmekSettingsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.GetCmekSettingsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetCmekSettingsRequestOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetCmekSettingsRequestOrBuilder.java new file mode 100644 index 000000000000..fe52162193db --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetCmekSettingsRequestOrBuilder.java @@ -0,0 +1,84 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface GetCmekSettingsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.GetCmekSettingsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource for which to retrieve CMEK settings.
+   *
+   *     "projects/[PROJECT_ID]/cmekSettings"
+   *     "organizations/[ORGANIZATION_ID]/cmekSettings"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings"
+   *     "folders/[FOLDER_ID]/cmekSettings"
+   *
+   * For example:
+   *
+   *   `"organizations/12345/cmekSettings"`
+   *
+   * Note: CMEK for the Log Router can be configured for Google Cloud projects,
+   * folders, organizations and billing accounts. Once configured for an
+   * organization, it applies to all projects and folders in the Google Cloud
+   * organization.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Required. The resource for which to retrieve CMEK settings.
+   *
+   *     "projects/[PROJECT_ID]/cmekSettings"
+   *     "organizations/[ORGANIZATION_ID]/cmekSettings"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings"
+   *     "folders/[FOLDER_ID]/cmekSettings"
+   *
+   * For example:
+   *
+   *   `"organizations/12345/cmekSettings"`
+   *
+   * Note: CMEK for the Log Router can be configured for Google Cloud projects,
+   * folders, organizations and billing accounts. Once configured for an
+   * organization, it applies to all projects and folders in the Google Cloud
+   * organization.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetExclusionRequest.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetExclusionRequest.java new file mode 100644 index 000000000000..1438cf90dab8 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetExclusionRequest.java @@ -0,0 +1,710 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * The parameters to `GetExclusion`.
+ * 
+ * + * Protobuf type {@code google.logging.v2.GetExclusionRequest} + */ +public final class GetExclusionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.GetExclusionRequest) + GetExclusionRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use GetExclusionRequest.newBuilder() to construct. + private GetExclusionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetExclusionRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetExclusionRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_GetExclusionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_GetExclusionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.GetExclusionRequest.class, + com.google.logging.v2.GetExclusionRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. The resource name of an existing exclusion:
+   *
+   *     "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
+   *     "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
+   *     "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
+   *
+   * For example:
+   *
+   *   `"projects/my-project/exclusions/my-exclusion"`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The resource name of an existing exclusion:
+   *
+   *     "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
+   *     "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
+   *     "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
+   *
+   * For example:
+   *
+   *   `"projects/my-project/exclusions/my-exclusion"`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().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.logging.v2.GetExclusionRequest)) { + return super.equals(obj); + } + com.google.logging.v2.GetExclusionRequest other = + (com.google.logging.v2.GetExclusionRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.GetExclusionRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.GetExclusionRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.GetExclusionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.GetExclusionRequest 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.logging.v2.GetExclusionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.GetExclusionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.GetExclusionRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.GetExclusionRequest 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.logging.v2.GetExclusionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.GetExclusionRequest 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.logging.v2.GetExclusionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.GetExclusionRequest 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.logging.v2.GetExclusionRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The parameters to `GetExclusion`.
+   * 
+ * + * Protobuf type {@code google.logging.v2.GetExclusionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.GetExclusionRequest) + com.google.logging.v2.GetExclusionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_GetExclusionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_GetExclusionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.GetExclusionRequest.class, + com.google.logging.v2.GetExclusionRequest.Builder.class); + } + + // Construct using com.google.logging.v2.GetExclusionRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_GetExclusionRequest_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.GetExclusionRequest getDefaultInstanceForType() { + return com.google.logging.v2.GetExclusionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.GetExclusionRequest build() { + com.google.logging.v2.GetExclusionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.GetExclusionRequest buildPartial() { + com.google.logging.v2.GetExclusionRequest result = + new com.google.logging.v2.GetExclusionRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.logging.v2.GetExclusionRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @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.logging.v2.GetExclusionRequest) { + return mergeFrom((com.google.logging.v2.GetExclusionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.GetExclusionRequest other) { + if (other == com.google.logging.v2.GetExclusionRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. The resource name of an existing exclusion:
+     *
+     *     "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
+     *     "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
+     *     "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/exclusions/my-exclusion"`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The resource name of an existing exclusion:
+     *
+     *     "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
+     *     "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
+     *     "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/exclusions/my-exclusion"`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The resource name of an existing exclusion:
+     *
+     *     "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
+     *     "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
+     *     "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/exclusions/my-exclusion"`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The resource name of an existing exclusion:
+     *
+     *     "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
+     *     "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
+     *     "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/exclusions/my-exclusion"`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The resource name of an existing exclusion:
+     *
+     *     "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
+     *     "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
+     *     "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/exclusions/my-exclusion"`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + 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.logging.v2.GetExclusionRequest) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.GetExclusionRequest) + private static final com.google.logging.v2.GetExclusionRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.GetExclusionRequest(); + } + + public static com.google.logging.v2.GetExclusionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetExclusionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.GetExclusionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetExclusionRequestOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetExclusionRequestOrBuilder.java new file mode 100644 index 000000000000..9f2c1ee27d33 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetExclusionRequestOrBuilder.java @@ -0,0 +1,74 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface GetExclusionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.GetExclusionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of an existing exclusion:
+   *
+   *     "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
+   *     "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
+   *     "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
+   *
+   * For example:
+   *
+   *   `"projects/my-project/exclusions/my-exclusion"`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Required. The resource name of an existing exclusion:
+   *
+   *     "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
+   *     "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
+   *     "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
+   *
+   * For example:
+   *
+   *   `"projects/my-project/exclusions/my-exclusion"`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetLinkRequest.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetLinkRequest.java new file mode 100644 index 000000000000..e9a590bb2dd5 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetLinkRequest.java @@ -0,0 +1,679 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * The parameters to GetLink.
+ * 
+ * + * Protobuf type {@code google.logging.v2.GetLinkRequest} + */ +public final class GetLinkRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.GetLinkRequest) + GetLinkRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use GetLinkRequest.newBuilder() to construct. + private GetLinkRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetLinkRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetLinkRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_GetLinkRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_GetLinkRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.GetLinkRequest.class, + com.google.logging.v2.GetLinkRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. The resource name of the link:
+   *
+   *   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+   *   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+   *   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+   *   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The resource name of the link:
+   *
+   *   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+   *   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+   *   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+   *   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().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.logging.v2.GetLinkRequest)) { + return super.equals(obj); + } + com.google.logging.v2.GetLinkRequest other = (com.google.logging.v2.GetLinkRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.GetLinkRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.GetLinkRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.GetLinkRequest parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.GetLinkRequest 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.logging.v2.GetLinkRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.GetLinkRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.GetLinkRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.GetLinkRequest 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.logging.v2.GetLinkRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.GetLinkRequest 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.logging.v2.GetLinkRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.GetLinkRequest 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.logging.v2.GetLinkRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The parameters to GetLink.
+   * 
+ * + * Protobuf type {@code google.logging.v2.GetLinkRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.GetLinkRequest) + com.google.logging.v2.GetLinkRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_GetLinkRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_GetLinkRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.GetLinkRequest.class, + com.google.logging.v2.GetLinkRequest.Builder.class); + } + + // Construct using com.google.logging.v2.GetLinkRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_GetLinkRequest_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.GetLinkRequest getDefaultInstanceForType() { + return com.google.logging.v2.GetLinkRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.GetLinkRequest build() { + com.google.logging.v2.GetLinkRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.GetLinkRequest buildPartial() { + com.google.logging.v2.GetLinkRequest result = new com.google.logging.v2.GetLinkRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.logging.v2.GetLinkRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @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.logging.v2.GetLinkRequest) { + return mergeFrom((com.google.logging.v2.GetLinkRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.GetLinkRequest other) { + if (other == com.google.logging.v2.GetLinkRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. The resource name of the link:
+     *
+     *   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+     *   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+     *   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+     *   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The resource name of the link:
+     *
+     *   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+     *   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+     *   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+     *   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The resource name of the link:
+     *
+     *   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+     *   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+     *   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+     *   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The resource name of the link:
+     *
+     *   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+     *   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+     *   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+     *   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The resource name of the link:
+     *
+     *   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+     *   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+     *   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+     *   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + 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.logging.v2.GetLinkRequest) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.GetLinkRequest) + private static final com.google.logging.v2.GetLinkRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.GetLinkRequest(); + } + + public static com.google.logging.v2.GetLinkRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetLinkRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.GetLinkRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetLinkRequestOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetLinkRequestOrBuilder.java new file mode 100644 index 000000000000..3a9cfe915536 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetLinkRequestOrBuilder.java @@ -0,0 +1,66 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface GetLinkRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.GetLinkRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the link:
+   *
+   *   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+   *   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+   *   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+   *   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Required. The resource name of the link:
+   *
+   *   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+   *   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+   *   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+   *   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetLogMetricRequest.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetLogMetricRequest.java new file mode 100644 index 000000000000..2f30ffde9d80 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetLogMetricRequest.java @@ -0,0 +1,661 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_metrics.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * The parameters to GetLogMetric.
+ * 
+ * + * Protobuf type {@code google.logging.v2.GetLogMetricRequest} + */ +public final class GetLogMetricRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.GetLogMetricRequest) + GetLogMetricRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use GetLogMetricRequest.newBuilder() to construct. + private GetLogMetricRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetLogMetricRequest() { + metricName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetLogMetricRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingMetricsProto + .internal_static_google_logging_v2_GetLogMetricRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingMetricsProto + .internal_static_google_logging_v2_GetLogMetricRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.GetLogMetricRequest.class, + com.google.logging.v2.GetLogMetricRequest.Builder.class); + } + + public static final int METRIC_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object metricName_ = ""; + + /** + * + * + *
+   * Required. The resource name of the desired metric:
+   *
+   *     "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
+   * 
+ * + * + * string metric_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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; + } + } + + /** + * + * + *
+   * Required. The resource name of the desired metric:
+   *
+   *     "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
+   * 
+ * + * + * string metric_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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; + } + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(metricName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, metricName_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(metricName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, metricName_); + } + size += getUnknownFields().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.logging.v2.GetLogMetricRequest)) { + return super.equals(obj); + } + com.google.logging.v2.GetLogMetricRequest other = + (com.google.logging.v2.GetLogMetricRequest) obj; + + if (!getMetricName().equals(other.getMetricName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.GetLogMetricRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.GetLogMetricRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.GetLogMetricRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.GetLogMetricRequest 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.logging.v2.GetLogMetricRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.GetLogMetricRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.GetLogMetricRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.GetLogMetricRequest 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.logging.v2.GetLogMetricRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.GetLogMetricRequest 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.logging.v2.GetLogMetricRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.GetLogMetricRequest 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.logging.v2.GetLogMetricRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The parameters to GetLogMetric.
+   * 
+ * + * Protobuf type {@code google.logging.v2.GetLogMetricRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.GetLogMetricRequest) + com.google.logging.v2.GetLogMetricRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingMetricsProto + .internal_static_google_logging_v2_GetLogMetricRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingMetricsProto + .internal_static_google_logging_v2_GetLogMetricRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.GetLogMetricRequest.class, + com.google.logging.v2.GetLogMetricRequest.Builder.class); + } + + // Construct using com.google.logging.v2.GetLogMetricRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + metricName_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingMetricsProto + .internal_static_google_logging_v2_GetLogMetricRequest_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.GetLogMetricRequest getDefaultInstanceForType() { + return com.google.logging.v2.GetLogMetricRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.GetLogMetricRequest build() { + com.google.logging.v2.GetLogMetricRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.GetLogMetricRequest buildPartial() { + com.google.logging.v2.GetLogMetricRequest result = + new com.google.logging.v2.GetLogMetricRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.logging.v2.GetLogMetricRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.metricName_ = metricName_; + } + } + + @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.logging.v2.GetLogMetricRequest) { + return mergeFrom((com.google.logging.v2.GetLogMetricRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.GetLogMetricRequest other) { + if (other == com.google.logging.v2.GetLogMetricRequest.getDefaultInstance()) return this; + if (!other.getMetricName().isEmpty()) { + metricName_ = other.metricName_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + metricName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object metricName_ = ""; + + /** + * + * + *
+     * Required. The resource name of the desired metric:
+     *
+     *     "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
+     * 
+ * + * + * string metric_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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; + } + } + + /** + * + * + *
+     * Required. The resource name of the desired metric:
+     *
+     *     "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
+     * 
+ * + * + * string metric_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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; + } + } + + /** + * + * + *
+     * Required. The resource name of the desired metric:
+     *
+     *     "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
+     * 
+ * + * + * string metric_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The resource name of the desired metric:
+     *
+     *     "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
+     * 
+ * + * + * string metric_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearMetricName() { + metricName_ = getDefaultInstance().getMetricName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The resource name of the desired metric:
+     *
+     *     "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
+     * 
+ * + * + * string metric_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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; + 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.logging.v2.GetLogMetricRequest) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.GetLogMetricRequest) + private static final com.google.logging.v2.GetLogMetricRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.GetLogMetricRequest(); + } + + public static com.google.logging.v2.GetLogMetricRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetLogMetricRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.GetLogMetricRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetLogMetricRequestOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetLogMetricRequestOrBuilder.java new file mode 100644 index 000000000000..a1f5f400069e --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetLogMetricRequestOrBuilder.java @@ -0,0 +1,60 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_metrics.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface GetLogMetricRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.GetLogMetricRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the desired metric:
+   *
+   *     "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
+   * 
+ * + * + * string metric_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The metricName. + */ + java.lang.String getMetricName(); + + /** + * + * + *
+   * Required. The resource name of the desired metric:
+   *
+   *     "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
+   * 
+ * + * + * string metric_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for metricName. + */ + com.google.protobuf.ByteString getMetricNameBytes(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetSettingsRequest.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetSettingsRequest.java new file mode 100644 index 000000000000..b7b2edbbfc3f --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetSettingsRequest.java @@ -0,0 +1,754 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * The parameters to
+ * [GetSettings][google.logging.v2.ConfigServiceV2.GetSettings].
+ *
+ * See [Enabling CMEK for Log
+ * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for
+ * more information.
+ * 
+ * + * Protobuf type {@code google.logging.v2.GetSettingsRequest} + */ +public final class GetSettingsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.GetSettingsRequest) + GetSettingsRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use GetSettingsRequest.newBuilder() to construct. + private GetSettingsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetSettingsRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetSettingsRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_GetSettingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_GetSettingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.GetSettingsRequest.class, + com.google.logging.v2.GetSettingsRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. The resource for which to retrieve settings.
+   *
+   *     "projects/[PROJECT_ID]/settings"
+   *     "organizations/[ORGANIZATION_ID]/settings"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/settings"
+   *     "folders/[FOLDER_ID]/settings"
+   *
+   * For example:
+   *
+   *   `"organizations/12345/settings"`
+   *
+   * Note: Settings for the Log Router can be get for Google Cloud projects,
+   * folders, organizations and billing accounts. Currently it can only be
+   * configured for organizations. Once configured for an organization, it
+   * applies to all projects and folders in the Google Cloud organization.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The resource for which to retrieve settings.
+   *
+   *     "projects/[PROJECT_ID]/settings"
+   *     "organizations/[ORGANIZATION_ID]/settings"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/settings"
+   *     "folders/[FOLDER_ID]/settings"
+   *
+   * For example:
+   *
+   *   `"organizations/12345/settings"`
+   *
+   * Note: Settings for the Log Router can be get for Google Cloud projects,
+   * folders, organizations and billing accounts. Currently it can only be
+   * configured for organizations. Once configured for an organization, it
+   * applies to all projects and folders in the Google Cloud organization.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().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.logging.v2.GetSettingsRequest)) { + return super.equals(obj); + } + com.google.logging.v2.GetSettingsRequest other = (com.google.logging.v2.GetSettingsRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.GetSettingsRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.GetSettingsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.GetSettingsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.GetSettingsRequest 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.logging.v2.GetSettingsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.GetSettingsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.GetSettingsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.GetSettingsRequest 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.logging.v2.GetSettingsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.GetSettingsRequest 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.logging.v2.GetSettingsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.GetSettingsRequest 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.logging.v2.GetSettingsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The parameters to
+   * [GetSettings][google.logging.v2.ConfigServiceV2.GetSettings].
+   *
+   * See [Enabling CMEK for Log
+   * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for
+   * more information.
+   * 
+ * + * Protobuf type {@code google.logging.v2.GetSettingsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.GetSettingsRequest) + com.google.logging.v2.GetSettingsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_GetSettingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_GetSettingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.GetSettingsRequest.class, + com.google.logging.v2.GetSettingsRequest.Builder.class); + } + + // Construct using com.google.logging.v2.GetSettingsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_GetSettingsRequest_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.GetSettingsRequest getDefaultInstanceForType() { + return com.google.logging.v2.GetSettingsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.GetSettingsRequest build() { + com.google.logging.v2.GetSettingsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.GetSettingsRequest buildPartial() { + com.google.logging.v2.GetSettingsRequest result = + new com.google.logging.v2.GetSettingsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.logging.v2.GetSettingsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @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.logging.v2.GetSettingsRequest) { + return mergeFrom((com.google.logging.v2.GetSettingsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.GetSettingsRequest other) { + if (other == com.google.logging.v2.GetSettingsRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. The resource for which to retrieve settings.
+     *
+     *     "projects/[PROJECT_ID]/settings"
+     *     "organizations/[ORGANIZATION_ID]/settings"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/settings"
+     *     "folders/[FOLDER_ID]/settings"
+     *
+     * For example:
+     *
+     *   `"organizations/12345/settings"`
+     *
+     * Note: Settings for the Log Router can be get for Google Cloud projects,
+     * folders, organizations and billing accounts. Currently it can only be
+     * configured for organizations. Once configured for an organization, it
+     * applies to all projects and folders in the Google Cloud organization.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The resource for which to retrieve settings.
+     *
+     *     "projects/[PROJECT_ID]/settings"
+     *     "organizations/[ORGANIZATION_ID]/settings"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/settings"
+     *     "folders/[FOLDER_ID]/settings"
+     *
+     * For example:
+     *
+     *   `"organizations/12345/settings"`
+     *
+     * Note: Settings for the Log Router can be get for Google Cloud projects,
+     * folders, organizations and billing accounts. Currently it can only be
+     * configured for organizations. Once configured for an organization, it
+     * applies to all projects and folders in the Google Cloud organization.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The resource for which to retrieve settings.
+     *
+     *     "projects/[PROJECT_ID]/settings"
+     *     "organizations/[ORGANIZATION_ID]/settings"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/settings"
+     *     "folders/[FOLDER_ID]/settings"
+     *
+     * For example:
+     *
+     *   `"organizations/12345/settings"`
+     *
+     * Note: Settings for the Log Router can be get for Google Cloud projects,
+     * folders, organizations and billing accounts. Currently it can only be
+     * configured for organizations. Once configured for an organization, it
+     * applies to all projects and folders in the Google Cloud organization.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The resource for which to retrieve settings.
+     *
+     *     "projects/[PROJECT_ID]/settings"
+     *     "organizations/[ORGANIZATION_ID]/settings"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/settings"
+     *     "folders/[FOLDER_ID]/settings"
+     *
+     * For example:
+     *
+     *   `"organizations/12345/settings"`
+     *
+     * Note: Settings for the Log Router can be get for Google Cloud projects,
+     * folders, organizations and billing accounts. Currently it can only be
+     * configured for organizations. Once configured for an organization, it
+     * applies to all projects and folders in the Google Cloud organization.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The resource for which to retrieve settings.
+     *
+     *     "projects/[PROJECT_ID]/settings"
+     *     "organizations/[ORGANIZATION_ID]/settings"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/settings"
+     *     "folders/[FOLDER_ID]/settings"
+     *
+     * For example:
+     *
+     *   `"organizations/12345/settings"`
+     *
+     * Note: Settings for the Log Router can be get for Google Cloud projects,
+     * folders, organizations and billing accounts. Currently it can only be
+     * configured for organizations. Once configured for an organization, it
+     * applies to all projects and folders in the Google Cloud organization.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + 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.logging.v2.GetSettingsRequest) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.GetSettingsRequest) + private static final com.google.logging.v2.GetSettingsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.GetSettingsRequest(); + } + + public static com.google.logging.v2.GetSettingsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetSettingsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.GetSettingsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetSettingsRequestOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetSettingsRequestOrBuilder.java new file mode 100644 index 000000000000..e3d9bd7c1dbd --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetSettingsRequestOrBuilder.java @@ -0,0 +1,84 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface GetSettingsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.GetSettingsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource for which to retrieve settings.
+   *
+   *     "projects/[PROJECT_ID]/settings"
+   *     "organizations/[ORGANIZATION_ID]/settings"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/settings"
+   *     "folders/[FOLDER_ID]/settings"
+   *
+   * For example:
+   *
+   *   `"organizations/12345/settings"`
+   *
+   * Note: Settings for the Log Router can be get for Google Cloud projects,
+   * folders, organizations and billing accounts. Currently it can only be
+   * configured for organizations. Once configured for an organization, it
+   * applies to all projects and folders in the Google Cloud organization.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Required. The resource for which to retrieve settings.
+   *
+   *     "projects/[PROJECT_ID]/settings"
+   *     "organizations/[ORGANIZATION_ID]/settings"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/settings"
+   *     "folders/[FOLDER_ID]/settings"
+   *
+   * For example:
+   *
+   *   `"organizations/12345/settings"`
+   *
+   * Note: Settings for the Log Router can be get for Google Cloud projects,
+   * folders, organizations and billing accounts. Currently it can only be
+   * configured for organizations. Once configured for an organization, it
+   * applies to all projects and folders in the Google Cloud organization.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetSinkRequest.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetSinkRequest.java new file mode 100644 index 000000000000..2e4f967bcab2 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetSinkRequest.java @@ -0,0 +1,707 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * The parameters to `GetSink`.
+ * 
+ * + * Protobuf type {@code google.logging.v2.GetSinkRequest} + */ +public final class GetSinkRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.GetSinkRequest) + GetSinkRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use GetSinkRequest.newBuilder() to construct. + private GetSinkRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetSinkRequest() { + sinkName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetSinkRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_GetSinkRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_GetSinkRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.GetSinkRequest.class, + com.google.logging.v2.GetSinkRequest.Builder.class); + } + + public static final int SINK_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object sinkName_ = ""; + + /** + * + * + *
+   * Required. The resource name of the sink:
+   *
+   *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
+   *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
+   *     "folders/[FOLDER_ID]/sinks/[SINK_ID]"
+   *
+   * For example:
+   *
+   *   `"projects/my-project/sinks/my-sink"`
+   * 
+ * + * + * string sink_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The sinkName. + */ + @java.lang.Override + public java.lang.String getSinkName() { + java.lang.Object ref = sinkName_; + 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(); + sinkName_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The resource name of the sink:
+   *
+   *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
+   *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
+   *     "folders/[FOLDER_ID]/sinks/[SINK_ID]"
+   *
+   * For example:
+   *
+   *   `"projects/my-project/sinks/my-sink"`
+   * 
+ * + * + * string sink_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for sinkName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSinkNameBytes() { + java.lang.Object ref = sinkName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sinkName_ = 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sinkName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, sinkName_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sinkName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, sinkName_); + } + size += getUnknownFields().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.logging.v2.GetSinkRequest)) { + return super.equals(obj); + } + com.google.logging.v2.GetSinkRequest other = (com.google.logging.v2.GetSinkRequest) obj; + + if (!getSinkName().equals(other.getSinkName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + SINK_NAME_FIELD_NUMBER; + hash = (53 * hash) + getSinkName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.GetSinkRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.GetSinkRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.GetSinkRequest parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.GetSinkRequest 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.logging.v2.GetSinkRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.GetSinkRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.GetSinkRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.GetSinkRequest 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.logging.v2.GetSinkRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.GetSinkRequest 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.logging.v2.GetSinkRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.GetSinkRequest 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.logging.v2.GetSinkRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The parameters to `GetSink`.
+   * 
+ * + * Protobuf type {@code google.logging.v2.GetSinkRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.GetSinkRequest) + com.google.logging.v2.GetSinkRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_GetSinkRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_GetSinkRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.GetSinkRequest.class, + com.google.logging.v2.GetSinkRequest.Builder.class); + } + + // Construct using com.google.logging.v2.GetSinkRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + sinkName_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_GetSinkRequest_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.GetSinkRequest getDefaultInstanceForType() { + return com.google.logging.v2.GetSinkRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.GetSinkRequest build() { + com.google.logging.v2.GetSinkRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.GetSinkRequest buildPartial() { + com.google.logging.v2.GetSinkRequest result = new com.google.logging.v2.GetSinkRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.logging.v2.GetSinkRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.sinkName_ = sinkName_; + } + } + + @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.logging.v2.GetSinkRequest) { + return mergeFrom((com.google.logging.v2.GetSinkRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.GetSinkRequest other) { + if (other == com.google.logging.v2.GetSinkRequest.getDefaultInstance()) return this; + if (!other.getSinkName().isEmpty()) { + sinkName_ = other.sinkName_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + sinkName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object sinkName_ = ""; + + /** + * + * + *
+     * Required. The resource name of the sink:
+     *
+     *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
+     *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
+     *     "folders/[FOLDER_ID]/sinks/[SINK_ID]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/sinks/my-sink"`
+     * 
+ * + * + * string sink_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The sinkName. + */ + public java.lang.String getSinkName() { + java.lang.Object ref = sinkName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sinkName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The resource name of the sink:
+     *
+     *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
+     *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
+     *     "folders/[FOLDER_ID]/sinks/[SINK_ID]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/sinks/my-sink"`
+     * 
+ * + * + * string sink_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for sinkName. + */ + public com.google.protobuf.ByteString getSinkNameBytes() { + java.lang.Object ref = sinkName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sinkName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The resource name of the sink:
+     *
+     *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
+     *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
+     *     "folders/[FOLDER_ID]/sinks/[SINK_ID]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/sinks/my-sink"`
+     * 
+ * + * + * string sink_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The sinkName to set. + * @return This builder for chaining. + */ + public Builder setSinkName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + sinkName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The resource name of the sink:
+     *
+     *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
+     *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
+     *     "folders/[FOLDER_ID]/sinks/[SINK_ID]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/sinks/my-sink"`
+     * 
+ * + * + * string sink_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearSinkName() { + sinkName_ = getDefaultInstance().getSinkName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The resource name of the sink:
+     *
+     *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
+     *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
+     *     "folders/[FOLDER_ID]/sinks/[SINK_ID]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/sinks/my-sink"`
+     * 
+ * + * + * string sink_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for sinkName to set. + * @return This builder for chaining. + */ + public Builder setSinkNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + sinkName_ = value; + 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.logging.v2.GetSinkRequest) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.GetSinkRequest) + private static final com.google.logging.v2.GetSinkRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.GetSinkRequest(); + } + + public static com.google.logging.v2.GetSinkRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetSinkRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.GetSinkRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetSinkRequestOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetSinkRequestOrBuilder.java new file mode 100644 index 000000000000..71ba33daa1a0 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetSinkRequestOrBuilder.java @@ -0,0 +1,74 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface GetSinkRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.GetSinkRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the sink:
+   *
+   *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
+   *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
+   *     "folders/[FOLDER_ID]/sinks/[SINK_ID]"
+   *
+   * For example:
+   *
+   *   `"projects/my-project/sinks/my-sink"`
+   * 
+ * + * + * string sink_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The sinkName. + */ + java.lang.String getSinkName(); + + /** + * + * + *
+   * Required. The resource name of the sink:
+   *
+   *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
+   *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
+   *     "folders/[FOLDER_ID]/sinks/[SINK_ID]"
+   *
+   * For example:
+   *
+   *   `"projects/my-project/sinks/my-sink"`
+   * 
+ * + * + * string sink_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for sinkName. + */ + com.google.protobuf.ByteString getSinkNameBytes(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetViewRequest.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetViewRequest.java new file mode 100644 index 000000000000..d148f2d7f4e9 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetViewRequest.java @@ -0,0 +1,686 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * The parameters to `GetView`.
+ * 
+ * + * Protobuf type {@code google.logging.v2.GetViewRequest} + */ +public final class GetViewRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.GetViewRequest) + GetViewRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use GetViewRequest.newBuilder() to construct. + private GetViewRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetViewRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetViewRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_GetViewRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_GetViewRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.GetViewRequest.class, + com.google.logging.v2.GetViewRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. The resource name of the policy:
+   *
+   *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]"
+   *
+   * For example:
+   *
+   *   `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The resource name of the policy:
+   *
+   *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]"
+   *
+   * For example:
+   *
+   *   `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().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.logging.v2.GetViewRequest)) { + return super.equals(obj); + } + com.google.logging.v2.GetViewRequest other = (com.google.logging.v2.GetViewRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.GetViewRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.GetViewRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.GetViewRequest parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.GetViewRequest 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.logging.v2.GetViewRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.GetViewRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.GetViewRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.GetViewRequest 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.logging.v2.GetViewRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.GetViewRequest 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.logging.v2.GetViewRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.GetViewRequest 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.logging.v2.GetViewRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The parameters to `GetView`.
+   * 
+ * + * Protobuf type {@code google.logging.v2.GetViewRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.GetViewRequest) + com.google.logging.v2.GetViewRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_GetViewRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_GetViewRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.GetViewRequest.class, + com.google.logging.v2.GetViewRequest.Builder.class); + } + + // Construct using com.google.logging.v2.GetViewRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_GetViewRequest_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.GetViewRequest getDefaultInstanceForType() { + return com.google.logging.v2.GetViewRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.GetViewRequest build() { + com.google.logging.v2.GetViewRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.GetViewRequest buildPartial() { + com.google.logging.v2.GetViewRequest result = new com.google.logging.v2.GetViewRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.logging.v2.GetViewRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @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.logging.v2.GetViewRequest) { + return mergeFrom((com.google.logging.v2.GetViewRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.GetViewRequest other) { + if (other == com.google.logging.v2.GetViewRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. The resource name of the policy:
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The resource name of the policy:
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The resource name of the policy:
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The resource name of the policy:
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The resource name of the policy:
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + 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.logging.v2.GetViewRequest) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.GetViewRequest) + private static final com.google.logging.v2.GetViewRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.GetViewRequest(); + } + + public static com.google.logging.v2.GetViewRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetViewRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.GetViewRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetViewRequestOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetViewRequestOrBuilder.java new file mode 100644 index 000000000000..d853366371be --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetViewRequestOrBuilder.java @@ -0,0 +1,68 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface GetViewRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.GetViewRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the policy:
+   *
+   *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]"
+   *
+   * For example:
+   *
+   *   `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Required. The resource name of the policy:
+   *
+   *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]"
+   *
+   * For example:
+   *
+   *   `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/IndexConfig.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/IndexConfig.java new file mode 100644 index 000000000000..1a6a51feff56 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/IndexConfig.java @@ -0,0 +1,1176 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * Configuration for an indexed field.
+ * 
+ * + * Protobuf type {@code google.logging.v2.IndexConfig} + */ +public final class IndexConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.IndexConfig) + IndexConfigOrBuilder { + private static final long serialVersionUID = 0L; + + // Use IndexConfig.newBuilder() to construct. + private IndexConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private IndexConfig() { + fieldPath_ = ""; + type_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new IndexConfig(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_IndexConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_IndexConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.IndexConfig.class, + com.google.logging.v2.IndexConfig.Builder.class); + } + + private int bitField0_; + public static final int FIELD_PATH_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object fieldPath_ = ""; + + /** + * + * + *
+   * Required. The LogEntry field path to index.
+   *
+   * Note that some paths are automatically indexed, and other paths are not
+   * eligible for indexing. See [indexing documentation](
+   * https://cloud.google.com/logging/docs/view/advanced-queries#indexed-fields)
+   * for details.
+   *
+   * For example: `jsonPayload.request.status`
+   * 
+ * + * string field_path = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The fieldPath. + */ + @java.lang.Override + public java.lang.String getFieldPath() { + java.lang.Object ref = fieldPath_; + 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(); + fieldPath_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The LogEntry field path to index.
+   *
+   * Note that some paths are automatically indexed, and other paths are not
+   * eligible for indexing. See [indexing documentation](
+   * https://cloud.google.com/logging/docs/view/advanced-queries#indexed-fields)
+   * for details.
+   *
+   * For example: `jsonPayload.request.status`
+   * 
+ * + * string field_path = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for fieldPath. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFieldPathBytes() { + java.lang.Object ref = fieldPath_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fieldPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TYPE_FIELD_NUMBER = 2; + private int type_ = 0; + + /** + * + * + *
+   * Required. The type of data in this index.
+   * 
+ * + * .google.logging.v2.IndexType type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + + /** + * + * + *
+   * Required. The type of data in this index.
+   * 
+ * + * .google.logging.v2.IndexType type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The type. + */ + @java.lang.Override + public com.google.logging.v2.IndexType getType() { + com.google.logging.v2.IndexType result = com.google.logging.v2.IndexType.forNumber(type_); + return result == null ? com.google.logging.v2.IndexType.UNRECOGNIZED : result; + } + + public static final int CREATE_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp createTime_; + + /** + * + * + *
+   * Output only. The timestamp when the index was last modified.
+   *
+   * This is used to return the timestamp, and will be ignored if supplied
+   * during update.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Output only. The timestamp when the index was last modified.
+   *
+   * This is used to return the timestamp, and will be ignored if supplied
+   * during update.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + /** + * + * + *
+   * Output only. The timestamp when the index was last modified.
+   *
+   * This is used to return the timestamp, and will be ignored if supplied
+   * during update.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(fieldPath_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, fieldPath_); + } + if (type_ != com.google.logging.v2.IndexType.INDEX_TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(2, type_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getCreateTime()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(fieldPath_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, fieldPath_); + } + if (type_ != com.google.logging.v2.IndexType.INDEX_TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, type_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getCreateTime()); + } + size += getUnknownFields().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.logging.v2.IndexConfig)) { + return super.equals(obj); + } + com.google.logging.v2.IndexConfig other = (com.google.logging.v2.IndexConfig) obj; + + if (!getFieldPath().equals(other.getFieldPath())) return false; + if (type_ != other.type_) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + FIELD_PATH_FIELD_NUMBER; + hash = (53 * hash) + getFieldPath().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.IndexConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.IndexConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.IndexConfig parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.IndexConfig 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.logging.v2.IndexConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.IndexConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.IndexConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.IndexConfig 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.logging.v2.IndexConfig parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.IndexConfig 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.logging.v2.IndexConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.IndexConfig 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.logging.v2.IndexConfig 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; + } + + /** + * + * + *
+   * Configuration for an indexed field.
+   * 
+ * + * Protobuf type {@code google.logging.v2.IndexConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.IndexConfig) + com.google.logging.v2.IndexConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_IndexConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_IndexConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.IndexConfig.class, + com.google.logging.v2.IndexConfig.Builder.class); + } + + // Construct using com.google.logging.v2.IndexConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getCreateTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + fieldPath_ = ""; + type_ = 0; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_IndexConfig_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.IndexConfig getDefaultInstanceForType() { + return com.google.logging.v2.IndexConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.IndexConfig build() { + com.google.logging.v2.IndexConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.IndexConfig buildPartial() { + com.google.logging.v2.IndexConfig result = new com.google.logging.v2.IndexConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.logging.v2.IndexConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.fieldPath_ = fieldPath_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.type_ = type_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @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.logging.v2.IndexConfig) { + return mergeFrom((com.google.logging.v2.IndexConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.IndexConfig other) { + if (other == com.google.logging.v2.IndexConfig.getDefaultInstance()) return this; + if (!other.getFieldPath().isEmpty()) { + fieldPath_ = other.fieldPath_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + fieldPath_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + type_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object fieldPath_ = ""; + + /** + * + * + *
+     * Required. The LogEntry field path to index.
+     *
+     * Note that some paths are automatically indexed, and other paths are not
+     * eligible for indexing. See [indexing documentation](
+     * https://cloud.google.com/logging/docs/view/advanced-queries#indexed-fields)
+     * for details.
+     *
+     * For example: `jsonPayload.request.status`
+     * 
+ * + * string field_path = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The fieldPath. + */ + public java.lang.String getFieldPath() { + java.lang.Object ref = fieldPath_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + fieldPath_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The LogEntry field path to index.
+     *
+     * Note that some paths are automatically indexed, and other paths are not
+     * eligible for indexing. See [indexing documentation](
+     * https://cloud.google.com/logging/docs/view/advanced-queries#indexed-fields)
+     * for details.
+     *
+     * For example: `jsonPayload.request.status`
+     * 
+ * + * string field_path = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for fieldPath. + */ + public com.google.protobuf.ByteString getFieldPathBytes() { + java.lang.Object ref = fieldPath_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fieldPath_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The LogEntry field path to index.
+     *
+     * Note that some paths are automatically indexed, and other paths are not
+     * eligible for indexing. See [indexing documentation](
+     * https://cloud.google.com/logging/docs/view/advanced-queries#indexed-fields)
+     * for details.
+     *
+     * For example: `jsonPayload.request.status`
+     * 
+ * + * string field_path = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The fieldPath to set. + * @return This builder for chaining. + */ + public Builder setFieldPath(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + fieldPath_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The LogEntry field path to index.
+     *
+     * Note that some paths are automatically indexed, and other paths are not
+     * eligible for indexing. See [indexing documentation](
+     * https://cloud.google.com/logging/docs/view/advanced-queries#indexed-fields)
+     * for details.
+     *
+     * For example: `jsonPayload.request.status`
+     * 
+ * + * string field_path = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearFieldPath() { + fieldPath_ = getDefaultInstance().getFieldPath(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The LogEntry field path to index.
+     *
+     * Note that some paths are automatically indexed, and other paths are not
+     * eligible for indexing. See [indexing documentation](
+     * https://cloud.google.com/logging/docs/view/advanced-queries#indexed-fields)
+     * for details.
+     *
+     * For example: `jsonPayload.request.status`
+     * 
+ * + * string field_path = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for fieldPath to set. + * @return This builder for chaining. + */ + public Builder setFieldPathBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + fieldPath_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int type_ = 0; + + /** + * + * + *
+     * Required. The type of data in this index.
+     * 
+ * + * .google.logging.v2.IndexType type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override + public int getTypeValue() { + return type_; + } + + /** + * + * + *
+     * Required. The type of data in this index.
+     * 
+ * + * .google.logging.v2.IndexType type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The type of data in this index.
+     * 
+ * + * .google.logging.v2.IndexType type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The type. + */ + @java.lang.Override + public com.google.logging.v2.IndexType getType() { + com.google.logging.v2.IndexType result = com.google.logging.v2.IndexType.forNumber(type_); + return result == null ? com.google.logging.v2.IndexType.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * Required. The type of data in this index.
+     * 
+ * + * .google.logging.v2.IndexType type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(com.google.logging.v2.IndexType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + type_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The type of data in this index.
+     * 
+ * + * .google.logging.v2.IndexType type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000002); + type_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + + /** + * + * + *
+     * Output only. The timestamp when the index was last modified.
+     *
+     * This is used to return the timestamp, and will be ignored if supplied
+     * during update.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Output only. The timestamp when the index was last modified.
+     *
+     * This is used to return the timestamp, and will be ignored if supplied
+     * during update.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Output only. The timestamp when the index was last modified.
+     *
+     * This is used to return the timestamp, and will be ignored if supplied
+     * during update.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The timestamp when the index was last modified.
+     *
+     * This is used to return the timestamp, and will be ignored if supplied
+     * during update.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The timestamp when the index was last modified.
+     *
+     * This is used to return the timestamp, and will be ignored if supplied
+     * during update.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + if (createTime_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Output only. The timestamp when the index was last modified.
+     *
+     * This is used to return the timestamp, and will be ignored if supplied
+     * during update.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000004); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The timestamp when the index was last modified.
+     *
+     * This is used to return the timestamp, and will be ignored if supplied
+     * during update.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Output only. The timestamp when the index was last modified.
+     *
+     * This is used to return the timestamp, and will be ignored if supplied
+     * during update.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + + /** + * + * + *
+     * Output only. The timestamp when the index was last modified.
+     *
+     * This is used to return the timestamp, and will be ignored if supplied
+     * during update.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + @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.logging.v2.IndexConfig) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.IndexConfig) + private static final com.google.logging.v2.IndexConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.IndexConfig(); + } + + public static com.google.logging.v2.IndexConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public IndexConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.IndexConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/IndexConfigOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/IndexConfigOrBuilder.java new file mode 100644 index 000000000000..008894ccb028 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/IndexConfigOrBuilder.java @@ -0,0 +1,141 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface IndexConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.IndexConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The LogEntry field path to index.
+   *
+   * Note that some paths are automatically indexed, and other paths are not
+   * eligible for indexing. See [indexing documentation](
+   * https://cloud.google.com/logging/docs/view/advanced-queries#indexed-fields)
+   * for details.
+   *
+   * For example: `jsonPayload.request.status`
+   * 
+ * + * string field_path = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The fieldPath. + */ + java.lang.String getFieldPath(); + + /** + * + * + *
+   * Required. The LogEntry field path to index.
+   *
+   * Note that some paths are automatically indexed, and other paths are not
+   * eligible for indexing. See [indexing documentation](
+   * https://cloud.google.com/logging/docs/view/advanced-queries#indexed-fields)
+   * for details.
+   *
+   * For example: `jsonPayload.request.status`
+   * 
+ * + * string field_path = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for fieldPath. + */ + com.google.protobuf.ByteString getFieldPathBytes(); + + /** + * + * + *
+   * Required. The type of data in this index.
+   * 
+ * + * .google.logging.v2.IndexType type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The enum numeric value on the wire for type. + */ + int getTypeValue(); + + /** + * + * + *
+   * Required. The type of data in this index.
+   * 
+ * + * .google.logging.v2.IndexType type = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The type. + */ + com.google.logging.v2.IndexType getType(); + + /** + * + * + *
+   * Output only. The timestamp when the index was last modified.
+   *
+   * This is used to return the timestamp, and will be ignored if supplied
+   * during update.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + + /** + * + * + *
+   * Output only. The timestamp when the index was last modified.
+   *
+   * This is used to return the timestamp, and will be ignored if supplied
+   * during update.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + + /** + * + * + *
+   * Output only. The timestamp when the index was last modified.
+   *
+   * This is used to return the timestamp, and will be ignored if supplied
+   * during update.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/IndexType.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/IndexType.java new file mode 100644 index 000000000000..8e8e9ba97ece --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/IndexType.java @@ -0,0 +1,180 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * IndexType is used for custom indexing. It describes the type of an indexed
+ * field.
+ * 
+ * + * Protobuf enum {@code google.logging.v2.IndexType} + */ +public enum IndexType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * The index's type is unspecified.
+   * 
+ * + * INDEX_TYPE_UNSPECIFIED = 0; + */ + INDEX_TYPE_UNSPECIFIED(0), + /** + * + * + *
+   * The index is a string-type index.
+   * 
+ * + * INDEX_TYPE_STRING = 1; + */ + INDEX_TYPE_STRING(1), + /** + * + * + *
+   * The index is a integer-type index.
+   * 
+ * + * INDEX_TYPE_INTEGER = 2; + */ + INDEX_TYPE_INTEGER(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * The index's type is unspecified.
+   * 
+ * + * INDEX_TYPE_UNSPECIFIED = 0; + */ + public static final int INDEX_TYPE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+   * The index is a string-type index.
+   * 
+ * + * INDEX_TYPE_STRING = 1; + */ + public static final int INDEX_TYPE_STRING_VALUE = 1; + + /** + * + * + *
+   * The index is a integer-type index.
+   * 
+ * + * INDEX_TYPE_INTEGER = 2; + */ + public static final int INDEX_TYPE_INTEGER_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static IndexType 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 IndexType forNumber(int value) { + switch (value) { + case 0: + return INDEX_TYPE_UNSPECIFIED; + case 1: + return INDEX_TYPE_STRING; + case 2: + return INDEX_TYPE_INTEGER; + 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 IndexType findValueByNumber(int number) { + return IndexType.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.logging.v2.LoggingConfigProto.getDescriptor().getEnumTypes().get(2); + } + + private static final IndexType[] VALUES = values(); + + public static IndexType 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 IndexType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.logging.v2.IndexType) +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LifecycleState.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LifecycleState.java new file mode 100644 index 000000000000..0d431e7f2bc2 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LifecycleState.java @@ -0,0 +1,256 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * LogBucket lifecycle states.
+ * 
+ * + * Protobuf enum {@code google.logging.v2.LifecycleState} + */ +public enum LifecycleState implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Unspecified state. This is only used/useful for distinguishing unset
+   * values.
+   * 
+ * + * LIFECYCLE_STATE_UNSPECIFIED = 0; + */ + LIFECYCLE_STATE_UNSPECIFIED(0), + /** + * + * + *
+   * The normal and active state.
+   * 
+ * + * ACTIVE = 1; + */ + ACTIVE(1), + /** + * + * + *
+   * The resource has been marked for deletion by the user. For some resources
+   * (e.g. buckets), this can be reversed by an un-delete operation.
+   * 
+ * + * DELETE_REQUESTED = 2; + */ + DELETE_REQUESTED(2), + /** + * + * + *
+   * The resource has been marked for an update by the user. It will remain in
+   * this state until the update is complete.
+   * 
+ * + * UPDATING = 3; + */ + UPDATING(3), + /** + * + * + *
+   * The resource has been marked for creation by the user. It will remain in
+   * this state until the creation is complete.
+   * 
+ * + * CREATING = 4; + */ + CREATING(4), + /** + * + * + *
+   * The resource is in an INTERNAL error state.
+   * 
+ * + * FAILED = 5; + */ + FAILED(5), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * Unspecified state. This is only used/useful for distinguishing unset
+   * values.
+   * 
+ * + * LIFECYCLE_STATE_UNSPECIFIED = 0; + */ + public static final int LIFECYCLE_STATE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+   * The normal and active state.
+   * 
+ * + * ACTIVE = 1; + */ + public static final int ACTIVE_VALUE = 1; + + /** + * + * + *
+   * The resource has been marked for deletion by the user. For some resources
+   * (e.g. buckets), this can be reversed by an un-delete operation.
+   * 
+ * + * DELETE_REQUESTED = 2; + */ + public static final int DELETE_REQUESTED_VALUE = 2; + + /** + * + * + *
+   * The resource has been marked for an update by the user. It will remain in
+   * this state until the update is complete.
+   * 
+ * + * UPDATING = 3; + */ + public static final int UPDATING_VALUE = 3; + + /** + * + * + *
+   * The resource has been marked for creation by the user. It will remain in
+   * this state until the creation is complete.
+   * 
+ * + * CREATING = 4; + */ + public static final int CREATING_VALUE = 4; + + /** + * + * + *
+   * The resource is in an INTERNAL error state.
+   * 
+ * + * FAILED = 5; + */ + public static final int FAILED_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 LifecycleState 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 LifecycleState forNumber(int value) { + switch (value) { + case 0: + return LIFECYCLE_STATE_UNSPECIFIED; + case 1: + return ACTIVE; + case 2: + return DELETE_REQUESTED; + case 3: + return UPDATING; + case 4: + return CREATING; + case 5: + return FAILED; + 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 LifecycleState findValueByNumber(int number) { + return LifecycleState.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.logging.v2.LoggingConfigProto.getDescriptor().getEnumTypes().get(1); + } + + private static final LifecycleState[] VALUES = values(); + + public static LifecycleState 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 LifecycleState(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.logging.v2.LifecycleState) +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/Link.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/Link.java new file mode 100644 index 000000000000..bef90bb06757 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/Link.java @@ -0,0 +1,1705 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * Describes a link connected to an analytics enabled bucket.
+ * 
+ * + * Protobuf type {@code google.logging.v2.Link} + */ +public final class Link extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.Link) + LinkOrBuilder { + private static final long serialVersionUID = 0L; + + // Use Link.newBuilder() to construct. + private Link(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Link() { + name_ = ""; + description_ = ""; + lifecycleState_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Link(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_Link_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_Link_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.Link.class, com.google.logging.v2.Link.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * The resource name of the link. The name can have up to 100 characters.
+   * A valid link id (at the end of the link name) must only have alphanumeric
+   * characters and underscores within it.
+   *
+   *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+   *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+   *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+   *
+   * For example:
+   *
+   *   `projects/my-project/locations/global/buckets/my-bucket/links/my_link
+   * 
+ * + * string name = 1; + * + * @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; + } + } + + /** + * + * + *
+   * The resource name of the link. The name can have up to 100 characters.
+   * A valid link id (at the end of the link name) must only have alphanumeric
+   * characters and underscores within it.
+   *
+   *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+   *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+   *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+   *
+   * For example:
+   *
+   *   `projects/my-project/locations/global/buckets/my-bucket/links/my_link
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + + /** + * + * + *
+   * Describes this link.
+   *
+   * The maximum length of the description is 8000 characters.
+   * 
+ * + * string description = 2; + * + * @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; + } + } + + /** + * + * + *
+   * Describes this link.
+   *
+   * The maximum length of the description is 8000 characters.
+   * 
+ * + * string description = 2; + * + * @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 CREATE_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp createTime_; + + /** + * + * + *
+   * Output only. The creation timestamp of the link.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Output only. The creation timestamp of the link.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + /** + * + * + *
+   * Output only. The creation timestamp of the link.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + public static final int LIFECYCLE_STATE_FIELD_NUMBER = 4; + private int lifecycleState_ = 0; + + /** + * + * + *
+   * Output only. The resource lifecycle state.
+   * 
+ * + * + * .google.logging.v2.LifecycleState lifecycle_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for lifecycleState. + */ + @java.lang.Override + public int getLifecycleStateValue() { + return lifecycleState_; + } + + /** + * + * + *
+   * Output only. The resource lifecycle state.
+   * 
+ * + * + * .google.logging.v2.LifecycleState lifecycle_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The lifecycleState. + */ + @java.lang.Override + public com.google.logging.v2.LifecycleState getLifecycleState() { + com.google.logging.v2.LifecycleState result = + com.google.logging.v2.LifecycleState.forNumber(lifecycleState_); + return result == null ? com.google.logging.v2.LifecycleState.UNRECOGNIZED : result; + } + + public static final int BIGQUERY_DATASET_FIELD_NUMBER = 5; + private com.google.logging.v2.BigQueryDataset bigqueryDataset_; + + /** + * + * + *
+   * The information of a BigQuery Dataset. When a link is created, a BigQuery
+   * dataset is created along with it, in the same project as the LogBucket it's
+   * linked to. This dataset will also have BigQuery Views corresponding to the
+   * LogViews in the bucket.
+   * 
+ * + * .google.logging.v2.BigQueryDataset bigquery_dataset = 5; + * + * @return Whether the bigqueryDataset field is set. + */ + @java.lang.Override + public boolean hasBigqueryDataset() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * The information of a BigQuery Dataset. When a link is created, a BigQuery
+   * dataset is created along with it, in the same project as the LogBucket it's
+   * linked to. This dataset will also have BigQuery Views corresponding to the
+   * LogViews in the bucket.
+   * 
+ * + * .google.logging.v2.BigQueryDataset bigquery_dataset = 5; + * + * @return The bigqueryDataset. + */ + @java.lang.Override + public com.google.logging.v2.BigQueryDataset getBigqueryDataset() { + return bigqueryDataset_ == null + ? com.google.logging.v2.BigQueryDataset.getDefaultInstance() + : bigqueryDataset_; + } + + /** + * + * + *
+   * The information of a BigQuery Dataset. When a link is created, a BigQuery
+   * dataset is created along with it, in the same project as the LogBucket it's
+   * linked to. This dataset will also have BigQuery Views corresponding to the
+   * LogViews in the bucket.
+   * 
+ * + * .google.logging.v2.BigQueryDataset bigquery_dataset = 5; + */ + @java.lang.Override + public com.google.logging.v2.BigQueryDatasetOrBuilder getBigqueryDatasetOrBuilder() { + return bigqueryDataset_ == null + ? com.google.logging.v2.BigQueryDataset.getDefaultInstance() + : bigqueryDataset_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, description_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getCreateTime()); + } + if (lifecycleState_ + != com.google.logging.v2.LifecycleState.LIFECYCLE_STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(4, lifecycleState_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(5, getBigqueryDataset()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, description_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getCreateTime()); + } + if (lifecycleState_ + != com.google.logging.v2.LifecycleState.LIFECYCLE_STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, lifecycleState_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getBigqueryDataset()); + } + size += getUnknownFields().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.logging.v2.Link)) { + return super.equals(obj); + } + com.google.logging.v2.Link other = (com.google.logging.v2.Link) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (lifecycleState_ != other.lifecycleState_) return false; + if (hasBigqueryDataset() != other.hasBigqueryDataset()) return false; + if (hasBigqueryDataset()) { + if (!getBigqueryDataset().equals(other.getBigqueryDataset())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + hash = (37 * hash) + LIFECYCLE_STATE_FIELD_NUMBER; + hash = (53 * hash) + lifecycleState_; + if (hasBigqueryDataset()) { + hash = (37 * hash) + BIGQUERY_DATASET_FIELD_NUMBER; + hash = (53 * hash) + getBigqueryDataset().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.Link parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.Link parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.Link parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.Link 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.logging.v2.Link parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.Link parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.Link parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.Link 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.logging.v2.Link parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.Link 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.logging.v2.Link parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.Link 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.logging.v2.Link 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; + } + + /** + * + * + *
+   * Describes a link connected to an analytics enabled bucket.
+   * 
+ * + * Protobuf type {@code google.logging.v2.Link} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.Link) + com.google.logging.v2.LinkOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_Link_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_Link_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.Link.class, com.google.logging.v2.Link.Builder.class); + } + + // Construct using com.google.logging.v2.Link.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getCreateTimeFieldBuilder(); + getBigqueryDatasetFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + description_ = ""; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + lifecycleState_ = 0; + bigqueryDataset_ = null; + if (bigqueryDatasetBuilder_ != null) { + bigqueryDatasetBuilder_.dispose(); + bigqueryDatasetBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_Link_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.Link getDefaultInstanceForType() { + return com.google.logging.v2.Link.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.Link build() { + com.google.logging.v2.Link result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.Link buildPartial() { + com.google.logging.v2.Link result = new com.google.logging.v2.Link(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.logging.v2.Link result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.description_ = description_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.lifecycleState_ = lifecycleState_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.bigqueryDataset_ = + bigqueryDatasetBuilder_ == null ? bigqueryDataset_ : bigqueryDatasetBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @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.logging.v2.Link) { + return mergeFrom((com.google.logging.v2.Link) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.Link other) { + if (other == com.google.logging.v2.Link.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.lifecycleState_ != 0) { + setLifecycleStateValue(other.getLifecycleStateValue()); + } + if (other.hasBigqueryDataset()) { + mergeBigqueryDataset(other.getBigqueryDataset()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + lifecycleState_ = input.readEnum(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 42: + { + input.readMessage(getBigqueryDatasetFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * The resource name of the link. The name can have up to 100 characters.
+     * A valid link id (at the end of the link name) must only have alphanumeric
+     * characters and underscores within it.
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+     *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+     *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+     *
+     * For example:
+     *
+     *   `projects/my-project/locations/global/buckets/my-bucket/links/my_link
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The resource name of the link. The name can have up to 100 characters.
+     * A valid link id (at the end of the link name) must only have alphanumeric
+     * characters and underscores within it.
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+     *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+     *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+     *
+     * For example:
+     *
+     *   `projects/my-project/locations/global/buckets/my-bucket/links/my_link
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The resource name of the link. The name can have up to 100 characters.
+     * A valid link id (at the end of the link name) must only have alphanumeric
+     * characters and underscores within it.
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+     *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+     *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+     *
+     * For example:
+     *
+     *   `projects/my-project/locations/global/buckets/my-bucket/links/my_link
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The resource name of the link. The name can have up to 100 characters.
+     * A valid link id (at the end of the link name) must only have alphanumeric
+     * characters and underscores within it.
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+     *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+     *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+     *
+     * For example:
+     *
+     *   `projects/my-project/locations/global/buckets/my-bucket/links/my_link
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * The resource name of the link. The name can have up to 100 characters.
+     * A valid link id (at the end of the link name) must only have alphanumeric
+     * characters and underscores within it.
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+     *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+     *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+     *
+     * For example:
+     *
+     *   `projects/my-project/locations/global/buckets/my-bucket/links/my_link
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + + /** + * + * + *
+     * Describes this link.
+     *
+     * The maximum length of the description is 8000 characters.
+     * 
+ * + * string description = 2; + * + * @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; + } + } + + /** + * + * + *
+     * Describes this link.
+     *
+     * The maximum length of the description is 8000 characters.
+     * 
+ * + * string description = 2; + * + * @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; + } + } + + /** + * + * + *
+     * Describes this link.
+     *
+     * The maximum length of the description is 8000 characters.
+     * 
+ * + * string description = 2; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Describes this link.
+     *
+     * The maximum length of the description is 8000 characters.
+     * 
+ * + * string description = 2; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Describes this link.
+     *
+     * The maximum length of the description is 8000 characters.
+     * 
+ * + * string description = 2; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + + /** + * + * + *
+     * Output only. The creation timestamp of the link.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Output only. The creation timestamp of the link.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Output only. The creation timestamp of the link.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The creation timestamp of the link.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The creation timestamp of the link.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + if (createTime_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Output only. The creation timestamp of the link.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000004); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The creation timestamp of the link.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Output only. The creation timestamp of the link.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + + /** + * + * + *
+     * Output only. The creation timestamp of the link.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private int lifecycleState_ = 0; + + /** + * + * + *
+     * Output only. The resource lifecycle state.
+     * 
+ * + * + * .google.logging.v2.LifecycleState lifecycle_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for lifecycleState. + */ + @java.lang.Override + public int getLifecycleStateValue() { + return lifecycleState_; + } + + /** + * + * + *
+     * Output only. The resource lifecycle state.
+     * 
+ * + * + * .google.logging.v2.LifecycleState lifecycle_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for lifecycleState to set. + * @return This builder for chaining. + */ + public Builder setLifecycleStateValue(int value) { + lifecycleState_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The resource lifecycle state.
+     * 
+ * + * + * .google.logging.v2.LifecycleState lifecycle_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The lifecycleState. + */ + @java.lang.Override + public com.google.logging.v2.LifecycleState getLifecycleState() { + com.google.logging.v2.LifecycleState result = + com.google.logging.v2.LifecycleState.forNumber(lifecycleState_); + return result == null ? com.google.logging.v2.LifecycleState.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * Output only. The resource lifecycle state.
+     * 
+ * + * + * .google.logging.v2.LifecycleState lifecycle_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The lifecycleState to set. + * @return This builder for chaining. + */ + public Builder setLifecycleState(com.google.logging.v2.LifecycleState value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + lifecycleState_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The resource lifecycle state.
+     * 
+ * + * + * .google.logging.v2.LifecycleState lifecycle_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearLifecycleState() { + bitField0_ = (bitField0_ & ~0x00000008); + lifecycleState_ = 0; + onChanged(); + return this; + } + + private com.google.logging.v2.BigQueryDataset bigqueryDataset_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.BigQueryDataset, + com.google.logging.v2.BigQueryDataset.Builder, + com.google.logging.v2.BigQueryDatasetOrBuilder> + bigqueryDatasetBuilder_; + + /** + * + * + *
+     * The information of a BigQuery Dataset. When a link is created, a BigQuery
+     * dataset is created along with it, in the same project as the LogBucket it's
+     * linked to. This dataset will also have BigQuery Views corresponding to the
+     * LogViews in the bucket.
+     * 
+ * + * .google.logging.v2.BigQueryDataset bigquery_dataset = 5; + * + * @return Whether the bigqueryDataset field is set. + */ + public boolean hasBigqueryDataset() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * The information of a BigQuery Dataset. When a link is created, a BigQuery
+     * dataset is created along with it, in the same project as the LogBucket it's
+     * linked to. This dataset will also have BigQuery Views corresponding to the
+     * LogViews in the bucket.
+     * 
+ * + * .google.logging.v2.BigQueryDataset bigquery_dataset = 5; + * + * @return The bigqueryDataset. + */ + public com.google.logging.v2.BigQueryDataset getBigqueryDataset() { + if (bigqueryDatasetBuilder_ == null) { + return bigqueryDataset_ == null + ? com.google.logging.v2.BigQueryDataset.getDefaultInstance() + : bigqueryDataset_; + } else { + return bigqueryDatasetBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The information of a BigQuery Dataset. When a link is created, a BigQuery
+     * dataset is created along with it, in the same project as the LogBucket it's
+     * linked to. This dataset will also have BigQuery Views corresponding to the
+     * LogViews in the bucket.
+     * 
+ * + * .google.logging.v2.BigQueryDataset bigquery_dataset = 5; + */ + public Builder setBigqueryDataset(com.google.logging.v2.BigQueryDataset value) { + if (bigqueryDatasetBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + bigqueryDataset_ = value; + } else { + bigqueryDatasetBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * The information of a BigQuery Dataset. When a link is created, a BigQuery
+     * dataset is created along with it, in the same project as the LogBucket it's
+     * linked to. This dataset will also have BigQuery Views corresponding to the
+     * LogViews in the bucket.
+     * 
+ * + * .google.logging.v2.BigQueryDataset bigquery_dataset = 5; + */ + public Builder setBigqueryDataset( + com.google.logging.v2.BigQueryDataset.Builder builderForValue) { + if (bigqueryDatasetBuilder_ == null) { + bigqueryDataset_ = builderForValue.build(); + } else { + bigqueryDatasetBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * The information of a BigQuery Dataset. When a link is created, a BigQuery
+     * dataset is created along with it, in the same project as the LogBucket it's
+     * linked to. This dataset will also have BigQuery Views corresponding to the
+     * LogViews in the bucket.
+     * 
+ * + * .google.logging.v2.BigQueryDataset bigquery_dataset = 5; + */ + public Builder mergeBigqueryDataset(com.google.logging.v2.BigQueryDataset value) { + if (bigqueryDatasetBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && bigqueryDataset_ != null + && bigqueryDataset_ != com.google.logging.v2.BigQueryDataset.getDefaultInstance()) { + getBigqueryDatasetBuilder().mergeFrom(value); + } else { + bigqueryDataset_ = value; + } + } else { + bigqueryDatasetBuilder_.mergeFrom(value); + } + if (bigqueryDataset_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The information of a BigQuery Dataset. When a link is created, a BigQuery
+     * dataset is created along with it, in the same project as the LogBucket it's
+     * linked to. This dataset will also have BigQuery Views corresponding to the
+     * LogViews in the bucket.
+     * 
+ * + * .google.logging.v2.BigQueryDataset bigquery_dataset = 5; + */ + public Builder clearBigqueryDataset() { + bitField0_ = (bitField0_ & ~0x00000010); + bigqueryDataset_ = null; + if (bigqueryDatasetBuilder_ != null) { + bigqueryDatasetBuilder_.dispose(); + bigqueryDatasetBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The information of a BigQuery Dataset. When a link is created, a BigQuery
+     * dataset is created along with it, in the same project as the LogBucket it's
+     * linked to. This dataset will also have BigQuery Views corresponding to the
+     * LogViews in the bucket.
+     * 
+ * + * .google.logging.v2.BigQueryDataset bigquery_dataset = 5; + */ + public com.google.logging.v2.BigQueryDataset.Builder getBigqueryDatasetBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getBigqueryDatasetFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The information of a BigQuery Dataset. When a link is created, a BigQuery
+     * dataset is created along with it, in the same project as the LogBucket it's
+     * linked to. This dataset will also have BigQuery Views corresponding to the
+     * LogViews in the bucket.
+     * 
+ * + * .google.logging.v2.BigQueryDataset bigquery_dataset = 5; + */ + public com.google.logging.v2.BigQueryDatasetOrBuilder getBigqueryDatasetOrBuilder() { + if (bigqueryDatasetBuilder_ != null) { + return bigqueryDatasetBuilder_.getMessageOrBuilder(); + } else { + return bigqueryDataset_ == null + ? com.google.logging.v2.BigQueryDataset.getDefaultInstance() + : bigqueryDataset_; + } + } + + /** + * + * + *
+     * The information of a BigQuery Dataset. When a link is created, a BigQuery
+     * dataset is created along with it, in the same project as the LogBucket it's
+     * linked to. This dataset will also have BigQuery Views corresponding to the
+     * LogViews in the bucket.
+     * 
+ * + * .google.logging.v2.BigQueryDataset bigquery_dataset = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.BigQueryDataset, + com.google.logging.v2.BigQueryDataset.Builder, + com.google.logging.v2.BigQueryDatasetOrBuilder> + getBigqueryDatasetFieldBuilder() { + if (bigqueryDatasetBuilder_ == null) { + bigqueryDatasetBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.BigQueryDataset, + com.google.logging.v2.BigQueryDataset.Builder, + com.google.logging.v2.BigQueryDatasetOrBuilder>( + getBigqueryDataset(), getParentForChildren(), isClean()); + bigqueryDataset_ = null; + } + return bigqueryDatasetBuilder_; + } + + @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.logging.v2.Link) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.Link) + private static final com.google.logging.v2.Link DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.Link(); + } + + public static com.google.logging.v2.Link getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Link parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.Link getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LinkMetadata.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LinkMetadata.java new file mode 100644 index 000000000000..3e594a8c8664 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LinkMetadata.java @@ -0,0 +1,1848 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * Metadata for long running Link operations.
+ * 
+ * + * Protobuf type {@code google.logging.v2.LinkMetadata} + */ +public final class LinkMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.LinkMetadata) + LinkMetadataOrBuilder { + private static final long serialVersionUID = 0L; + + // Use LinkMetadata.newBuilder() to construct. + private LinkMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private LinkMetadata() { + state_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new LinkMetadata(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_LinkMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_LinkMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.LinkMetadata.class, + com.google.logging.v2.LinkMetadata.Builder.class); + } + + private int bitField0_; + private int requestCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object request_; + + public enum RequestCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + CREATE_LINK_REQUEST(4), + DELETE_LINK_REQUEST(5), + REQUEST_NOT_SET(0); + private final int value; + + private RequestCase(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 RequestCase valueOf(int value) { + return forNumber(value); + } + + public static RequestCase forNumber(int value) { + switch (value) { + case 4: + return CREATE_LINK_REQUEST; + case 5: + return DELETE_LINK_REQUEST; + case 0: + return REQUEST_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public RequestCase getRequestCase() { + return RequestCase.forNumber(requestCase_); + } + + public static final int START_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp startTime_; + + /** + * + * + *
+   * The start time of an operation.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return Whether the startTime field is set. + */ + @java.lang.Override + public boolean hasStartTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * The start time of an operation.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return The startTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getStartTime() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + + /** + * + * + *
+   * The start time of an operation.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + + public static final int END_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp endTime_; + + /** + * + * + *
+   * The end time of an operation.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * The end time of an operation.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + /** + * + * + *
+   * The end time of an operation.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + + public static final int STATE_FIELD_NUMBER = 3; + private int state_ = 0; + + /** + * + * + *
+   * State of an operation.
+   * 
+ * + * .google.logging.v2.OperationState state = 3; + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + + /** + * + * + *
+   * State of an operation.
+   * 
+ * + * .google.logging.v2.OperationState state = 3; + * + * @return The state. + */ + @java.lang.Override + public com.google.logging.v2.OperationState getState() { + com.google.logging.v2.OperationState result = + com.google.logging.v2.OperationState.forNumber(state_); + return result == null ? com.google.logging.v2.OperationState.UNRECOGNIZED : result; + } + + public static final int CREATE_LINK_REQUEST_FIELD_NUMBER = 4; + + /** + * + * + *
+   * CreateLink RPC request.
+   * 
+ * + * .google.logging.v2.CreateLinkRequest create_link_request = 4; + * + * @return Whether the createLinkRequest field is set. + */ + @java.lang.Override + public boolean hasCreateLinkRequest() { + return requestCase_ == 4; + } + + /** + * + * + *
+   * CreateLink RPC request.
+   * 
+ * + * .google.logging.v2.CreateLinkRequest create_link_request = 4; + * + * @return The createLinkRequest. + */ + @java.lang.Override + public com.google.logging.v2.CreateLinkRequest getCreateLinkRequest() { + if (requestCase_ == 4) { + return (com.google.logging.v2.CreateLinkRequest) request_; + } + return com.google.logging.v2.CreateLinkRequest.getDefaultInstance(); + } + + /** + * + * + *
+   * CreateLink RPC request.
+   * 
+ * + * .google.logging.v2.CreateLinkRequest create_link_request = 4; + */ + @java.lang.Override + public com.google.logging.v2.CreateLinkRequestOrBuilder getCreateLinkRequestOrBuilder() { + if (requestCase_ == 4) { + return (com.google.logging.v2.CreateLinkRequest) request_; + } + return com.google.logging.v2.CreateLinkRequest.getDefaultInstance(); + } + + public static final int DELETE_LINK_REQUEST_FIELD_NUMBER = 5; + + /** + * + * + *
+   * DeleteLink RPC request.
+   * 
+ * + * .google.logging.v2.DeleteLinkRequest delete_link_request = 5; + * + * @return Whether the deleteLinkRequest field is set. + */ + @java.lang.Override + public boolean hasDeleteLinkRequest() { + return requestCase_ == 5; + } + + /** + * + * + *
+   * DeleteLink RPC request.
+   * 
+ * + * .google.logging.v2.DeleteLinkRequest delete_link_request = 5; + * + * @return The deleteLinkRequest. + */ + @java.lang.Override + public com.google.logging.v2.DeleteLinkRequest getDeleteLinkRequest() { + if (requestCase_ == 5) { + return (com.google.logging.v2.DeleteLinkRequest) request_; + } + return com.google.logging.v2.DeleteLinkRequest.getDefaultInstance(); + } + + /** + * + * + *
+   * DeleteLink RPC request.
+   * 
+ * + * .google.logging.v2.DeleteLinkRequest delete_link_request = 5; + */ + @java.lang.Override + public com.google.logging.v2.DeleteLinkRequestOrBuilder getDeleteLinkRequestOrBuilder() { + if (requestCase_ == 5) { + return (com.google.logging.v2.DeleteLinkRequest) request_; + } + return com.google.logging.v2.DeleteLinkRequest.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getStartTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getEndTime()); + } + if (state_ != com.google.logging.v2.OperationState.OPERATION_STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(3, state_); + } + if (requestCase_ == 4) { + output.writeMessage(4, (com.google.logging.v2.CreateLinkRequest) request_); + } + if (requestCase_ == 5) { + output.writeMessage(5, (com.google.logging.v2.DeleteLinkRequest) request_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getStartTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getEndTime()); + } + if (state_ != com.google.logging.v2.OperationState.OPERATION_STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, state_); + } + if (requestCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.logging.v2.CreateLinkRequest) request_); + } + if (requestCase_ == 5) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 5, (com.google.logging.v2.DeleteLinkRequest) request_); + } + size += getUnknownFields().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.logging.v2.LinkMetadata)) { + return super.equals(obj); + } + com.google.logging.v2.LinkMetadata other = (com.google.logging.v2.LinkMetadata) obj; + + 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 (state_ != other.state_) return false; + if (!getRequestCase().equals(other.getRequestCase())) return false; + switch (requestCase_) { + case 4: + if (!getCreateLinkRequest().equals(other.getCreateLinkRequest())) return false; + break; + case 5: + if (!getDeleteLinkRequest().equals(other.getDeleteLinkRequest())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().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(); + } + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + switch (requestCase_) { + case 4: + hash = (37 * hash) + CREATE_LINK_REQUEST_FIELD_NUMBER; + hash = (53 * hash) + getCreateLinkRequest().hashCode(); + break; + case 5: + hash = (37 * hash) + DELETE_LINK_REQUEST_FIELD_NUMBER; + hash = (53 * hash) + getDeleteLinkRequest().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.LinkMetadata parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.LinkMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.LinkMetadata parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.LinkMetadata 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.logging.v2.LinkMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.LinkMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.LinkMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.LinkMetadata 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.logging.v2.LinkMetadata parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.LinkMetadata 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.logging.v2.LinkMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.LinkMetadata 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.logging.v2.LinkMetadata 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; + } + + /** + * + * + *
+   * Metadata for long running Link operations.
+   * 
+ * + * Protobuf type {@code google.logging.v2.LinkMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.LinkMetadata) + com.google.logging.v2.LinkMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_LinkMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_LinkMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.LinkMetadata.class, + com.google.logging.v2.LinkMetadata.Builder.class); + } + + // Construct using com.google.logging.v2.LinkMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getStartTimeFieldBuilder(); + getEndTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + state_ = 0; + if (createLinkRequestBuilder_ != null) { + createLinkRequestBuilder_.clear(); + } + if (deleteLinkRequestBuilder_ != null) { + deleteLinkRequestBuilder_.clear(); + } + requestCase_ = 0; + request_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_LinkMetadata_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.LinkMetadata getDefaultInstanceForType() { + return com.google.logging.v2.LinkMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.LinkMetadata build() { + com.google.logging.v2.LinkMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.LinkMetadata buildPartial() { + com.google.logging.v2.LinkMetadata result = new com.google.logging.v2.LinkMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.logging.v2.LinkMetadata result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.startTime_ = startTimeBuilder_ == null ? startTime_ : startTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.endTime_ = endTimeBuilder_ == null ? endTime_ : endTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.state_ = state_; + } + result.bitField0_ |= to_bitField0_; + } + + private void buildPartialOneofs(com.google.logging.v2.LinkMetadata result) { + result.requestCase_ = requestCase_; + result.request_ = this.request_; + if (requestCase_ == 4 && createLinkRequestBuilder_ != null) { + result.request_ = createLinkRequestBuilder_.build(); + } + if (requestCase_ == 5 && deleteLinkRequestBuilder_ != null) { + result.request_ = deleteLinkRequestBuilder_.build(); + } + } + + @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.logging.v2.LinkMetadata) { + return mergeFrom((com.google.logging.v2.LinkMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.LinkMetadata other) { + if (other == com.google.logging.v2.LinkMetadata.getDefaultInstance()) return this; + if (other.hasStartTime()) { + mergeStartTime(other.getStartTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + switch (other.getRequestCase()) { + case CREATE_LINK_REQUEST: + { + mergeCreateLinkRequest(other.getCreateLinkRequest()); + break; + } + case DELETE_LINK_REQUEST: + { + mergeDeleteLinkRequest(other.getDeleteLinkRequest()); + break; + } + case REQUEST_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getStartTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getEndTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + state_ = input.readEnum(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: + { + input.readMessage( + getCreateLinkRequestFieldBuilder().getBuilder(), extensionRegistry); + requestCase_ = 4; + break; + } // case 34 + case 42: + { + input.readMessage( + getDeleteLinkRequestFieldBuilder().getBuilder(), extensionRegistry); + requestCase_ = 5; + break; + } // case 42 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int requestCase_ = 0; + private java.lang.Object request_; + + public RequestCase getRequestCase() { + return RequestCase.forNumber(requestCase_); + } + + public Builder clearRequest() { + requestCase_ = 0; + request_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + 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 time of an operation.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return Whether the startTime field is set. + */ + public boolean hasStartTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * The start time of an operation.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @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 time of an operation.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public Builder setStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTime_ = value; + } else { + startTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The start time of an operation.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (startTimeBuilder_ == null) { + startTime_ = builderForValue.build(); + } else { + startTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The start time of an operation.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public Builder mergeStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && startTime_ != null + && startTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getStartTimeBuilder().mergeFrom(value); + } else { + startTime_ = value; + } + } else { + startTimeBuilder_.mergeFrom(value); + } + if (startTime_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The start time of an operation.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public Builder clearStartTime() { + bitField0_ = (bitField0_ & ~0x00000001); + startTime_ = null; + if (startTimeBuilder_ != null) { + startTimeBuilder_.dispose(); + startTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The start time of an operation.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getStartTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The start time of an operation.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + if (startTimeBuilder_ != null) { + return startTimeBuilder_.getMessageOrBuilder(); + } else { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + } + + /** + * + * + *
+     * The start time of an operation.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + 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 time of an operation.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * The end time of an operation.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @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 time of an operation.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + } else { + endTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The end time of an operation.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The end time of an operation.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && endTime_ != null + && endTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEndTimeBuilder().mergeFrom(value); + } else { + endTime_ = value; + } + } else { + endTimeBuilder_.mergeFrom(value); + } + if (endTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The end time of an operation.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder clearEndTime() { + bitField0_ = (bitField0_ & ~0x00000002); + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The end time of an operation.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getEndTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The end time of an operation.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + + /** + * + * + *
+     * The end time of an operation.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTime(), getParentForChildren(), isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + private int state_ = 0; + + /** + * + * + *
+     * State of an operation.
+     * 
+ * + * .google.logging.v2.OperationState state = 3; + * + * @return The enum numeric value on the wire for state. + */ + @java.lang.Override + public int getStateValue() { + return state_; + } + + /** + * + * + *
+     * State of an operation.
+     * 
+ * + * .google.logging.v2.OperationState state = 3; + * + * @param value The enum numeric value on the wire for state to set. + * @return This builder for chaining. + */ + public Builder setStateValue(int value) { + state_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * State of an operation.
+     * 
+ * + * .google.logging.v2.OperationState state = 3; + * + * @return The state. + */ + @java.lang.Override + public com.google.logging.v2.OperationState getState() { + com.google.logging.v2.OperationState result = + com.google.logging.v2.OperationState.forNumber(state_); + return result == null ? com.google.logging.v2.OperationState.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * State of an operation.
+     * 
+ * + * .google.logging.v2.OperationState state = 3; + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.logging.v2.OperationState value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + state_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * State of an operation.
+     * 
+ * + * .google.logging.v2.OperationState state = 3; + * + * @return This builder for chaining. + */ + public Builder clearState() { + bitField0_ = (bitField0_ & ~0x00000004); + state_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.CreateLinkRequest, + com.google.logging.v2.CreateLinkRequest.Builder, + com.google.logging.v2.CreateLinkRequestOrBuilder> + createLinkRequestBuilder_; + + /** + * + * + *
+     * CreateLink RPC request.
+     * 
+ * + * .google.logging.v2.CreateLinkRequest create_link_request = 4; + * + * @return Whether the createLinkRequest field is set. + */ + @java.lang.Override + public boolean hasCreateLinkRequest() { + return requestCase_ == 4; + } + + /** + * + * + *
+     * CreateLink RPC request.
+     * 
+ * + * .google.logging.v2.CreateLinkRequest create_link_request = 4; + * + * @return The createLinkRequest. + */ + @java.lang.Override + public com.google.logging.v2.CreateLinkRequest getCreateLinkRequest() { + if (createLinkRequestBuilder_ == null) { + if (requestCase_ == 4) { + return (com.google.logging.v2.CreateLinkRequest) request_; + } + return com.google.logging.v2.CreateLinkRequest.getDefaultInstance(); + } else { + if (requestCase_ == 4) { + return createLinkRequestBuilder_.getMessage(); + } + return com.google.logging.v2.CreateLinkRequest.getDefaultInstance(); + } + } + + /** + * + * + *
+     * CreateLink RPC request.
+     * 
+ * + * .google.logging.v2.CreateLinkRequest create_link_request = 4; + */ + public Builder setCreateLinkRequest(com.google.logging.v2.CreateLinkRequest value) { + if (createLinkRequestBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + request_ = value; + onChanged(); + } else { + createLinkRequestBuilder_.setMessage(value); + } + requestCase_ = 4; + return this; + } + + /** + * + * + *
+     * CreateLink RPC request.
+     * 
+ * + * .google.logging.v2.CreateLinkRequest create_link_request = 4; + */ + public Builder setCreateLinkRequest( + com.google.logging.v2.CreateLinkRequest.Builder builderForValue) { + if (createLinkRequestBuilder_ == null) { + request_ = builderForValue.build(); + onChanged(); + } else { + createLinkRequestBuilder_.setMessage(builderForValue.build()); + } + requestCase_ = 4; + return this; + } + + /** + * + * + *
+     * CreateLink RPC request.
+     * 
+ * + * .google.logging.v2.CreateLinkRequest create_link_request = 4; + */ + public Builder mergeCreateLinkRequest(com.google.logging.v2.CreateLinkRequest value) { + if (createLinkRequestBuilder_ == null) { + if (requestCase_ == 4 + && request_ != com.google.logging.v2.CreateLinkRequest.getDefaultInstance()) { + request_ = + com.google.logging.v2.CreateLinkRequest.newBuilder( + (com.google.logging.v2.CreateLinkRequest) request_) + .mergeFrom(value) + .buildPartial(); + } else { + request_ = value; + } + onChanged(); + } else { + if (requestCase_ == 4) { + createLinkRequestBuilder_.mergeFrom(value); + } else { + createLinkRequestBuilder_.setMessage(value); + } + } + requestCase_ = 4; + return this; + } + + /** + * + * + *
+     * CreateLink RPC request.
+     * 
+ * + * .google.logging.v2.CreateLinkRequest create_link_request = 4; + */ + public Builder clearCreateLinkRequest() { + if (createLinkRequestBuilder_ == null) { + if (requestCase_ == 4) { + requestCase_ = 0; + request_ = null; + onChanged(); + } + } else { + if (requestCase_ == 4) { + requestCase_ = 0; + request_ = null; + } + createLinkRequestBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * CreateLink RPC request.
+     * 
+ * + * .google.logging.v2.CreateLinkRequest create_link_request = 4; + */ + public com.google.logging.v2.CreateLinkRequest.Builder getCreateLinkRequestBuilder() { + return getCreateLinkRequestFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * CreateLink RPC request.
+     * 
+ * + * .google.logging.v2.CreateLinkRequest create_link_request = 4; + */ + @java.lang.Override + public com.google.logging.v2.CreateLinkRequestOrBuilder getCreateLinkRequestOrBuilder() { + if ((requestCase_ == 4) && (createLinkRequestBuilder_ != null)) { + return createLinkRequestBuilder_.getMessageOrBuilder(); + } else { + if (requestCase_ == 4) { + return (com.google.logging.v2.CreateLinkRequest) request_; + } + return com.google.logging.v2.CreateLinkRequest.getDefaultInstance(); + } + } + + /** + * + * + *
+     * CreateLink RPC request.
+     * 
+ * + * .google.logging.v2.CreateLinkRequest create_link_request = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.CreateLinkRequest, + com.google.logging.v2.CreateLinkRequest.Builder, + com.google.logging.v2.CreateLinkRequestOrBuilder> + getCreateLinkRequestFieldBuilder() { + if (createLinkRequestBuilder_ == null) { + if (!(requestCase_ == 4)) { + request_ = com.google.logging.v2.CreateLinkRequest.getDefaultInstance(); + } + createLinkRequestBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.CreateLinkRequest, + com.google.logging.v2.CreateLinkRequest.Builder, + com.google.logging.v2.CreateLinkRequestOrBuilder>( + (com.google.logging.v2.CreateLinkRequest) request_, + getParentForChildren(), + isClean()); + request_ = null; + } + requestCase_ = 4; + onChanged(); + return createLinkRequestBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.DeleteLinkRequest, + com.google.logging.v2.DeleteLinkRequest.Builder, + com.google.logging.v2.DeleteLinkRequestOrBuilder> + deleteLinkRequestBuilder_; + + /** + * + * + *
+     * DeleteLink RPC request.
+     * 
+ * + * .google.logging.v2.DeleteLinkRequest delete_link_request = 5; + * + * @return Whether the deleteLinkRequest field is set. + */ + @java.lang.Override + public boolean hasDeleteLinkRequest() { + return requestCase_ == 5; + } + + /** + * + * + *
+     * DeleteLink RPC request.
+     * 
+ * + * .google.logging.v2.DeleteLinkRequest delete_link_request = 5; + * + * @return The deleteLinkRequest. + */ + @java.lang.Override + public com.google.logging.v2.DeleteLinkRequest getDeleteLinkRequest() { + if (deleteLinkRequestBuilder_ == null) { + if (requestCase_ == 5) { + return (com.google.logging.v2.DeleteLinkRequest) request_; + } + return com.google.logging.v2.DeleteLinkRequest.getDefaultInstance(); + } else { + if (requestCase_ == 5) { + return deleteLinkRequestBuilder_.getMessage(); + } + return com.google.logging.v2.DeleteLinkRequest.getDefaultInstance(); + } + } + + /** + * + * + *
+     * DeleteLink RPC request.
+     * 
+ * + * .google.logging.v2.DeleteLinkRequest delete_link_request = 5; + */ + public Builder setDeleteLinkRequest(com.google.logging.v2.DeleteLinkRequest value) { + if (deleteLinkRequestBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + request_ = value; + onChanged(); + } else { + deleteLinkRequestBuilder_.setMessage(value); + } + requestCase_ = 5; + return this; + } + + /** + * + * + *
+     * DeleteLink RPC request.
+     * 
+ * + * .google.logging.v2.DeleteLinkRequest delete_link_request = 5; + */ + public Builder setDeleteLinkRequest( + com.google.logging.v2.DeleteLinkRequest.Builder builderForValue) { + if (deleteLinkRequestBuilder_ == null) { + request_ = builderForValue.build(); + onChanged(); + } else { + deleteLinkRequestBuilder_.setMessage(builderForValue.build()); + } + requestCase_ = 5; + return this; + } + + /** + * + * + *
+     * DeleteLink RPC request.
+     * 
+ * + * .google.logging.v2.DeleteLinkRequest delete_link_request = 5; + */ + public Builder mergeDeleteLinkRequest(com.google.logging.v2.DeleteLinkRequest value) { + if (deleteLinkRequestBuilder_ == null) { + if (requestCase_ == 5 + && request_ != com.google.logging.v2.DeleteLinkRequest.getDefaultInstance()) { + request_ = + com.google.logging.v2.DeleteLinkRequest.newBuilder( + (com.google.logging.v2.DeleteLinkRequest) request_) + .mergeFrom(value) + .buildPartial(); + } else { + request_ = value; + } + onChanged(); + } else { + if (requestCase_ == 5) { + deleteLinkRequestBuilder_.mergeFrom(value); + } else { + deleteLinkRequestBuilder_.setMessage(value); + } + } + requestCase_ = 5; + return this; + } + + /** + * + * + *
+     * DeleteLink RPC request.
+     * 
+ * + * .google.logging.v2.DeleteLinkRequest delete_link_request = 5; + */ + public Builder clearDeleteLinkRequest() { + if (deleteLinkRequestBuilder_ == null) { + if (requestCase_ == 5) { + requestCase_ = 0; + request_ = null; + onChanged(); + } + } else { + if (requestCase_ == 5) { + requestCase_ = 0; + request_ = null; + } + deleteLinkRequestBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * DeleteLink RPC request.
+     * 
+ * + * .google.logging.v2.DeleteLinkRequest delete_link_request = 5; + */ + public com.google.logging.v2.DeleteLinkRequest.Builder getDeleteLinkRequestBuilder() { + return getDeleteLinkRequestFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * DeleteLink RPC request.
+     * 
+ * + * .google.logging.v2.DeleteLinkRequest delete_link_request = 5; + */ + @java.lang.Override + public com.google.logging.v2.DeleteLinkRequestOrBuilder getDeleteLinkRequestOrBuilder() { + if ((requestCase_ == 5) && (deleteLinkRequestBuilder_ != null)) { + return deleteLinkRequestBuilder_.getMessageOrBuilder(); + } else { + if (requestCase_ == 5) { + return (com.google.logging.v2.DeleteLinkRequest) request_; + } + return com.google.logging.v2.DeleteLinkRequest.getDefaultInstance(); + } + } + + /** + * + * + *
+     * DeleteLink RPC request.
+     * 
+ * + * .google.logging.v2.DeleteLinkRequest delete_link_request = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.DeleteLinkRequest, + com.google.logging.v2.DeleteLinkRequest.Builder, + com.google.logging.v2.DeleteLinkRequestOrBuilder> + getDeleteLinkRequestFieldBuilder() { + if (deleteLinkRequestBuilder_ == null) { + if (!(requestCase_ == 5)) { + request_ = com.google.logging.v2.DeleteLinkRequest.getDefaultInstance(); + } + deleteLinkRequestBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.DeleteLinkRequest, + com.google.logging.v2.DeleteLinkRequest.Builder, + com.google.logging.v2.DeleteLinkRequestOrBuilder>( + (com.google.logging.v2.DeleteLinkRequest) request_, + getParentForChildren(), + isClean()); + request_ = null; + } + requestCase_ = 5; + onChanged(); + return deleteLinkRequestBuilder_; + } + + @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.logging.v2.LinkMetadata) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.LinkMetadata) + private static final com.google.logging.v2.LinkMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.LinkMetadata(); + } + + public static com.google.logging.v2.LinkMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LinkMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.LinkMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LinkMetadataOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LinkMetadataOrBuilder.java new file mode 100644 index 000000000000..1cd31b9f16a4 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LinkMetadataOrBuilder.java @@ -0,0 +1,202 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface LinkMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.LinkMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The start time of an operation.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return Whether the startTime field is set. + */ + boolean hasStartTime(); + + /** + * + * + *
+   * The start time of an operation.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + * + * @return The startTime. + */ + com.google.protobuf.Timestamp getStartTime(); + + /** + * + * + *
+   * The start time of an operation.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 1; + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); + + /** + * + * + *
+   * The end time of an operation.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + + /** + * + * + *
+   * The end time of an operation.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + + /** + * + * + *
+   * The end time of an operation.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); + + /** + * + * + *
+   * State of an operation.
+   * 
+ * + * .google.logging.v2.OperationState state = 3; + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + + /** + * + * + *
+   * State of an operation.
+   * 
+ * + * .google.logging.v2.OperationState state = 3; + * + * @return The state. + */ + com.google.logging.v2.OperationState getState(); + + /** + * + * + *
+   * CreateLink RPC request.
+   * 
+ * + * .google.logging.v2.CreateLinkRequest create_link_request = 4; + * + * @return Whether the createLinkRequest field is set. + */ + boolean hasCreateLinkRequest(); + + /** + * + * + *
+   * CreateLink RPC request.
+   * 
+ * + * .google.logging.v2.CreateLinkRequest create_link_request = 4; + * + * @return The createLinkRequest. + */ + com.google.logging.v2.CreateLinkRequest getCreateLinkRequest(); + + /** + * + * + *
+   * CreateLink RPC request.
+   * 
+ * + * .google.logging.v2.CreateLinkRequest create_link_request = 4; + */ + com.google.logging.v2.CreateLinkRequestOrBuilder getCreateLinkRequestOrBuilder(); + + /** + * + * + *
+   * DeleteLink RPC request.
+   * 
+ * + * .google.logging.v2.DeleteLinkRequest delete_link_request = 5; + * + * @return Whether the deleteLinkRequest field is set. + */ + boolean hasDeleteLinkRequest(); + + /** + * + * + *
+   * DeleteLink RPC request.
+   * 
+ * + * .google.logging.v2.DeleteLinkRequest delete_link_request = 5; + * + * @return The deleteLinkRequest. + */ + com.google.logging.v2.DeleteLinkRequest getDeleteLinkRequest(); + + /** + * + * + *
+   * DeleteLink RPC request.
+   * 
+ * + * .google.logging.v2.DeleteLinkRequest delete_link_request = 5; + */ + com.google.logging.v2.DeleteLinkRequestOrBuilder getDeleteLinkRequestOrBuilder(); + + com.google.logging.v2.LinkMetadata.RequestCase getRequestCase(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LinkName.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LinkName.java new file mode 100644 index 000000000000..71b077484041 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LinkName.java @@ -0,0 +1,628 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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.logging.v2; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.pathtemplate.ValidationException; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class LinkName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_BUCKET_LINK = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/buckets/{bucket}/links/{link}"); + private static final PathTemplate ORGANIZATION_LOCATION_BUCKET_LINK = + PathTemplate.createWithoutUrlEncoding( + "organizations/{organization}/locations/{location}/buckets/{bucket}/links/{link}"); + private static final PathTemplate FOLDER_LOCATION_BUCKET_LINK = + PathTemplate.createWithoutUrlEncoding( + "folders/{folder}/locations/{location}/buckets/{bucket}/links/{link}"); + private static final PathTemplate BILLING_ACCOUNT_LOCATION_BUCKET_LINK = + PathTemplate.createWithoutUrlEncoding( + "billingAccounts/{billing_account}/locations/{location}/buckets/{bucket}/links/{link}"); + private volatile Map fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; + private final String project; + private final String location; + private final String bucket; + private final String link; + private final String organization; + private final String folder; + private final String billingAccount; + + @Deprecated + protected LinkName() { + project = null; + location = null; + bucket = null; + link = null; + organization = null; + folder = null; + billingAccount = null; + } + + private LinkName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + bucket = Preconditions.checkNotNull(builder.getBucket()); + link = Preconditions.checkNotNull(builder.getLink()); + organization = null; + folder = null; + billingAccount = null; + pathTemplate = PROJECT_LOCATION_BUCKET_LINK; + } + + private LinkName(OrganizationLocationBucketLinkBuilder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + location = Preconditions.checkNotNull(builder.getLocation()); + bucket = Preconditions.checkNotNull(builder.getBucket()); + link = Preconditions.checkNotNull(builder.getLink()); + project = null; + folder = null; + billingAccount = null; + pathTemplate = ORGANIZATION_LOCATION_BUCKET_LINK; + } + + private LinkName(FolderLocationBucketLinkBuilder builder) { + folder = Preconditions.checkNotNull(builder.getFolder()); + location = Preconditions.checkNotNull(builder.getLocation()); + bucket = Preconditions.checkNotNull(builder.getBucket()); + link = Preconditions.checkNotNull(builder.getLink()); + project = null; + organization = null; + billingAccount = null; + pathTemplate = FOLDER_LOCATION_BUCKET_LINK; + } + + private LinkName(BillingAccountLocationBucketLinkBuilder builder) { + billingAccount = Preconditions.checkNotNull(builder.getBillingAccount()); + location = Preconditions.checkNotNull(builder.getLocation()); + bucket = Preconditions.checkNotNull(builder.getBucket()); + link = Preconditions.checkNotNull(builder.getLink()); + project = null; + organization = null; + folder = null; + pathTemplate = BILLING_ACCOUNT_LOCATION_BUCKET_LINK; + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getBucket() { + return bucket; + } + + public String getLink() { + return link; + } + + public String getOrganization() { + return organization; + } + + public String getFolder() { + return folder; + } + + public String getBillingAccount() { + return billingAccount; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public static Builder newProjectLocationBucketLinkBuilder() { + return new Builder(); + } + + public static OrganizationLocationBucketLinkBuilder newOrganizationLocationBucketLinkBuilder() { + return new OrganizationLocationBucketLinkBuilder(); + } + + public static FolderLocationBucketLinkBuilder newFolderLocationBucketLinkBuilder() { + return new FolderLocationBucketLinkBuilder(); + } + + public static BillingAccountLocationBucketLinkBuilder + newBillingAccountLocationBucketLinkBuilder() { + return new BillingAccountLocationBucketLinkBuilder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static LinkName of(String project, String location, String bucket, String link) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setBucket(bucket) + .setLink(link) + .build(); + } + + public static LinkName ofProjectLocationBucketLinkName( + String project, String location, String bucket, String link) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setBucket(bucket) + .setLink(link) + .build(); + } + + public static LinkName ofOrganizationLocationBucketLinkName( + String organization, String location, String bucket, String link) { + return newOrganizationLocationBucketLinkBuilder() + .setOrganization(organization) + .setLocation(location) + .setBucket(bucket) + .setLink(link) + .build(); + } + + public static LinkName ofFolderLocationBucketLinkName( + String folder, String location, String bucket, String link) { + return newFolderLocationBucketLinkBuilder() + .setFolder(folder) + .setLocation(location) + .setBucket(bucket) + .setLink(link) + .build(); + } + + public static LinkName ofBillingAccountLocationBucketLinkName( + String billingAccount, String location, String bucket, String link) { + return newBillingAccountLocationBucketLinkBuilder() + .setBillingAccount(billingAccount) + .setLocation(location) + .setBucket(bucket) + .setLink(link) + .build(); + } + + public static String format(String project, String location, String bucket, String link) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setBucket(bucket) + .setLink(link) + .build() + .toString(); + } + + public static String formatProjectLocationBucketLinkName( + String project, String location, String bucket, String link) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setBucket(bucket) + .setLink(link) + .build() + .toString(); + } + + public static String formatOrganizationLocationBucketLinkName( + String organization, String location, String bucket, String link) { + return newOrganizationLocationBucketLinkBuilder() + .setOrganization(organization) + .setLocation(location) + .setBucket(bucket) + .setLink(link) + .build() + .toString(); + } + + public static String formatFolderLocationBucketLinkName( + String folder, String location, String bucket, String link) { + return newFolderLocationBucketLinkBuilder() + .setFolder(folder) + .setLocation(location) + .setBucket(bucket) + .setLink(link) + .build() + .toString(); + } + + public static String formatBillingAccountLocationBucketLinkName( + String billingAccount, String location, String bucket, String link) { + return newBillingAccountLocationBucketLinkBuilder() + .setBillingAccount(billingAccount) + .setLocation(location) + .setBucket(bucket) + .setLink(link) + .build() + .toString(); + } + + public static LinkName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + if (PROJECT_LOCATION_BUCKET_LINK.matches(formattedString)) { + Map matchMap = PROJECT_LOCATION_BUCKET_LINK.match(formattedString); + return ofProjectLocationBucketLinkName( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("bucket"), + matchMap.get("link")); + } else if (ORGANIZATION_LOCATION_BUCKET_LINK.matches(formattedString)) { + Map matchMap = ORGANIZATION_LOCATION_BUCKET_LINK.match(formattedString); + return ofOrganizationLocationBucketLinkName( + matchMap.get("organization"), + matchMap.get("location"), + matchMap.get("bucket"), + matchMap.get("link")); + } else if (FOLDER_LOCATION_BUCKET_LINK.matches(formattedString)) { + Map matchMap = FOLDER_LOCATION_BUCKET_LINK.match(formattedString); + return ofFolderLocationBucketLinkName( + matchMap.get("folder"), + matchMap.get("location"), + matchMap.get("bucket"), + matchMap.get("link")); + } else if (BILLING_ACCOUNT_LOCATION_BUCKET_LINK.matches(formattedString)) { + Map matchMap = BILLING_ACCOUNT_LOCATION_BUCKET_LINK.match(formattedString); + return ofBillingAccountLocationBucketLinkName( + matchMap.get("billing_account"), + matchMap.get("location"), + matchMap.get("bucket"), + matchMap.get("link")); + } + throw new ValidationException("LinkName.parse: formattedString not in valid format"); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (LinkName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_BUCKET_LINK.matches(formattedString) + || ORGANIZATION_LOCATION_BUCKET_LINK.matches(formattedString) + || FOLDER_LOCATION_BUCKET_LINK.matches(formattedString) + || BILLING_ACCOUNT_LOCATION_BUCKET_LINK.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (bucket != null) { + fieldMapBuilder.put("bucket", bucket); + } + if (link != null) { + fieldMapBuilder.put("link", link); + } + if (organization != null) { + fieldMapBuilder.put("organization", organization); + } + if (folder != null) { + fieldMapBuilder.put("folder", folder); + } + if (billingAccount != null) { + fieldMapBuilder.put("billing_account", billingAccount); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + LinkName that = ((LinkName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.bucket, that.bucket) + && Objects.equals(this.link, that.link) + && Objects.equals(this.organization, that.organization) + && Objects.equals(this.folder, that.folder) + && Objects.equals(this.billingAccount, that.billingAccount); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(fixedValue); + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(bucket); + h *= 1000003; + h ^= Objects.hashCode(link); + h *= 1000003; + h ^= Objects.hashCode(organization); + h *= 1000003; + h ^= Objects.hashCode(folder); + h *= 1000003; + h ^= Objects.hashCode(billingAccount); + return h; + } + + /** Builder for projects/{project}/locations/{location}/buckets/{bucket}/links/{link}. */ + public static class Builder { + private String project; + private String location; + private String bucket; + private String link; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getBucket() { + return bucket; + } + + public String getLink() { + return link; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setBucket(String bucket) { + this.bucket = bucket; + return this; + } + + public Builder setLink(String link) { + this.link = link; + return this; + } + + private Builder(LinkName linkName) { + Preconditions.checkArgument( + Objects.equals(linkName.pathTemplate, PROJECT_LOCATION_BUCKET_LINK), + "toBuilder is only supported when LinkName has the pattern of" + + " projects/{project}/locations/{location}/buckets/{bucket}/links/{link}"); + this.project = linkName.project; + this.location = linkName.location; + this.bucket = linkName.bucket; + this.link = linkName.link; + } + + public LinkName build() { + return new LinkName(this); + } + } + + /** + * Builder for organizations/{organization}/locations/{location}/buckets/{bucket}/links/{link}. + */ + public static class OrganizationLocationBucketLinkBuilder { + private String organization; + private String location; + private String bucket; + private String link; + + protected OrganizationLocationBucketLinkBuilder() {} + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public String getBucket() { + return bucket; + } + + public String getLink() { + return link; + } + + public OrganizationLocationBucketLinkBuilder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public OrganizationLocationBucketLinkBuilder setLocation(String location) { + this.location = location; + return this; + } + + public OrganizationLocationBucketLinkBuilder setBucket(String bucket) { + this.bucket = bucket; + return this; + } + + public OrganizationLocationBucketLinkBuilder setLink(String link) { + this.link = link; + return this; + } + + public LinkName build() { + return new LinkName(this); + } + } + + /** Builder for folders/{folder}/locations/{location}/buckets/{bucket}/links/{link}. */ + public static class FolderLocationBucketLinkBuilder { + private String folder; + private String location; + private String bucket; + private String link; + + protected FolderLocationBucketLinkBuilder() {} + + public String getFolder() { + return folder; + } + + public String getLocation() { + return location; + } + + public String getBucket() { + return bucket; + } + + public String getLink() { + return link; + } + + public FolderLocationBucketLinkBuilder setFolder(String folder) { + this.folder = folder; + return this; + } + + public FolderLocationBucketLinkBuilder setLocation(String location) { + this.location = location; + return this; + } + + public FolderLocationBucketLinkBuilder setBucket(String bucket) { + this.bucket = bucket; + return this; + } + + public FolderLocationBucketLinkBuilder setLink(String link) { + this.link = link; + return this; + } + + public LinkName build() { + return new LinkName(this); + } + } + + /** + * Builder for + * billingAccounts/{billing_account}/locations/{location}/buckets/{bucket}/links/{link}. + */ + public static class BillingAccountLocationBucketLinkBuilder { + private String billingAccount; + private String location; + private String bucket; + private String link; + + protected BillingAccountLocationBucketLinkBuilder() {} + + public String getBillingAccount() { + return billingAccount; + } + + public String getLocation() { + return location; + } + + public String getBucket() { + return bucket; + } + + public String getLink() { + return link; + } + + public BillingAccountLocationBucketLinkBuilder setBillingAccount(String billingAccount) { + this.billingAccount = billingAccount; + return this; + } + + public BillingAccountLocationBucketLinkBuilder setLocation(String location) { + this.location = location; + return this; + } + + public BillingAccountLocationBucketLinkBuilder setBucket(String bucket) { + this.bucket = bucket; + return this; + } + + public BillingAccountLocationBucketLinkBuilder setLink(String link) { + this.link = link; + return this; + } + + public LinkName build() { + return new LinkName(this); + } + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LinkOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LinkOrBuilder.java new file mode 100644 index 000000000000..c818e0cc5b7f --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LinkOrBuilder.java @@ -0,0 +1,220 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface LinkOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.Link) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The resource name of the link. The name can have up to 100 characters.
+   * A valid link id (at the end of the link name) must only have alphanumeric
+   * characters and underscores within it.
+   *
+   *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+   *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+   *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+   *
+   * For example:
+   *
+   *   `projects/my-project/locations/global/buckets/my-bucket/links/my_link
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * The resource name of the link. The name can have up to 100 characters.
+   * A valid link id (at the end of the link name) must only have alphanumeric
+   * characters and underscores within it.
+   *
+   *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+   *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+   *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
+   *
+   * For example:
+   *
+   *   `projects/my-project/locations/global/buckets/my-bucket/links/my_link
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Describes this link.
+   *
+   * The maximum length of the description is 8000 characters.
+   * 
+ * + * string description = 2; + * + * @return The description. + */ + java.lang.String getDescription(); + + /** + * + * + *
+   * Describes this link.
+   *
+   * The maximum length of the description is 8000 characters.
+   * 
+ * + * string description = 2; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Output only. The creation timestamp of the link.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + + /** + * + * + *
+   * Output only. The creation timestamp of the link.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + + /** + * + * + *
+   * Output only. The creation timestamp of the link.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The resource lifecycle state.
+   * 
+ * + * + * .google.logging.v2.LifecycleState lifecycle_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for lifecycleState. + */ + int getLifecycleStateValue(); + + /** + * + * + *
+   * Output only. The resource lifecycle state.
+   * 
+ * + * + * .google.logging.v2.LifecycleState lifecycle_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The lifecycleState. + */ + com.google.logging.v2.LifecycleState getLifecycleState(); + + /** + * + * + *
+   * The information of a BigQuery Dataset. When a link is created, a BigQuery
+   * dataset is created along with it, in the same project as the LogBucket it's
+   * linked to. This dataset will also have BigQuery Views corresponding to the
+   * LogViews in the bucket.
+   * 
+ * + * .google.logging.v2.BigQueryDataset bigquery_dataset = 5; + * + * @return Whether the bigqueryDataset field is set. + */ + boolean hasBigqueryDataset(); + + /** + * + * + *
+   * The information of a BigQuery Dataset. When a link is created, a BigQuery
+   * dataset is created along with it, in the same project as the LogBucket it's
+   * linked to. This dataset will also have BigQuery Views corresponding to the
+   * LogViews in the bucket.
+   * 
+ * + * .google.logging.v2.BigQueryDataset bigquery_dataset = 5; + * + * @return The bigqueryDataset. + */ + com.google.logging.v2.BigQueryDataset getBigqueryDataset(); + + /** + * + * + *
+   * The information of a BigQuery Dataset. When a link is created, a BigQuery
+   * dataset is created along with it, in the same project as the LogBucket it's
+   * linked to. This dataset will also have BigQuery Views corresponding to the
+   * LogViews in the bucket.
+   * 
+ * + * .google.logging.v2.BigQueryDataset bigquery_dataset = 5; + */ + com.google.logging.v2.BigQueryDatasetOrBuilder getBigqueryDatasetOrBuilder(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListBucketsRequest.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListBucketsRequest.java new file mode 100644 index 000000000000..9baa7dd8725e --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListBucketsRequest.java @@ -0,0 +1,1024 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * The parameters to `ListBuckets`.
+ * 
+ * + * Protobuf type {@code google.logging.v2.ListBucketsRequest} + */ +public final class ListBucketsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.ListBucketsRequest) + ListBucketsRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ListBucketsRequest.newBuilder() to construct. + private ListBucketsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListBucketsRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListBucketsRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_ListBucketsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_ListBucketsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.ListBucketsRequest.class, + com.google.logging.v2.ListBucketsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
+   * Required. The parent resource whose buckets are to be listed:
+   *
+   *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]"
+   *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]"
+   *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]"
+   *
+   * Note: The locations portion of the resource must be specified, but
+   * supplying the character `-` in place of [LOCATION_ID] will return all
+   * buckets.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The parent resource whose buckets are to be listed:
+   *
+   *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]"
+   *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]"
+   *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]"
+   *
+   * Note: The locations portion of the resource must be specified, but
+   * supplying the character `-` in place of [LOCATION_ID] will return all
+   * buckets.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + + /** + * + * + *
+   * Optional. If present, then retrieve the next batch of results from the
+   * preceding call to this method. `pageToken` must be the value of
+   * `nextPageToken` from the previous response. The values of other method
+   * parameters should be identical to those in the previous call.
+   * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. If present, then retrieve the next batch of results from the
+   * preceding call to this method. `pageToken` must be the value of
+   * `nextPageToken` from the previous response. The values of other method
+   * parameters should be identical to those in the previous call.
+   * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 3; + private int pageSize_ = 0; + + /** + * + * + *
+   * Optional. The maximum number of results to return from this request.
+   * Non-positive values are ignored. The presence of `nextPageToken` in the
+   * response indicates that more results might be available.
+   * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, pageToken_); + } + if (pageSize_ != 0) { + output.writeInt32(3, pageSize_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, pageToken_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, pageSize_); + } + size += getUnknownFields().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.logging.v2.ListBucketsRequest)) { + return super.equals(obj); + } + com.google.logging.v2.ListBucketsRequest other = (com.google.logging.v2.ListBucketsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.ListBucketsRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.ListBucketsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.ListBucketsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.ListBucketsRequest 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.logging.v2.ListBucketsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.ListBucketsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.ListBucketsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.ListBucketsRequest 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.logging.v2.ListBucketsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.ListBucketsRequest 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.logging.v2.ListBucketsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.ListBucketsRequest 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.logging.v2.ListBucketsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The parameters to `ListBuckets`.
+   * 
+ * + * Protobuf type {@code google.logging.v2.ListBucketsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.ListBucketsRequest) + com.google.logging.v2.ListBucketsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_ListBucketsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_ListBucketsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.ListBucketsRequest.class, + com.google.logging.v2.ListBucketsRequest.Builder.class); + } + + // Construct using com.google.logging.v2.ListBucketsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageToken_ = ""; + pageSize_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_ListBucketsRequest_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.ListBucketsRequest getDefaultInstanceForType() { + return com.google.logging.v2.ListBucketsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.ListBucketsRequest build() { + com.google.logging.v2.ListBucketsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.ListBucketsRequest buildPartial() { + com.google.logging.v2.ListBucketsRequest result = + new com.google.logging.v2.ListBucketsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.logging.v2.ListBucketsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageToken_ = pageToken_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageSize_ = pageSize_; + } + } + + @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.logging.v2.ListBucketsRequest) { + return mergeFrom((com.google.logging.v2.ListBucketsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.ListBucketsRequest other) { + if (other == com.google.logging.v2.ListBucketsRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + + /** + * + * + *
+     * Required. The parent resource whose buckets are to be listed:
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]"
+     *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]"
+     *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]"
+     *
+     * Note: The locations portion of the resource must be specified, but
+     * supplying the character `-` in place of [LOCATION_ID] will return all
+     * buckets.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The parent resource whose buckets are to be listed:
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]"
+     *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]"
+     *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]"
+     *
+     * Note: The locations portion of the resource must be specified, but
+     * supplying the character `-` in place of [LOCATION_ID] will return all
+     * buckets.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The parent resource whose buckets are to be listed:
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]"
+     *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]"
+     *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]"
+     *
+     * Note: The locations portion of the resource must be specified, but
+     * supplying the character `-` in place of [LOCATION_ID] will return all
+     * buckets.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The parent resource whose buckets are to be listed:
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]"
+     *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]"
+     *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]"
+     *
+     * Note: The locations portion of the resource must be specified, but
+     * supplying the character `-` in place of [LOCATION_ID] will return all
+     * buckets.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The parent resource whose buckets are to be listed:
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]"
+     *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]"
+     *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]"
+     *
+     * Note: The locations portion of the resource must be specified, but
+     * supplying the character `-` in place of [LOCATION_ID] will return all
+     * buckets.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method. `pageToken` must be the value of
+     * `nextPageToken` from the previous response. The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method. `pageToken` must be the value of
+     * `nextPageToken` from the previous response. The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method. `pageToken` must be the value of
+     * `nextPageToken` from the previous response. The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method. `pageToken` must be the value of
+     * `nextPageToken` from the previous response. The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method. `pageToken` must be the value of
+     * `nextPageToken` from the previous response. The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int pageSize_; + + /** + * + * + *
+     * Optional. The maximum number of results to return from this request.
+     * Non-positive values are ignored. The presence of `nextPageToken` in the
+     * response indicates that more results might be available.
+     * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + /** + * + * + *
+     * Optional. The maximum number of results to return from this request.
+     * Non-positive values are ignored. The presence of `nextPageToken` in the
+     * response indicates that more results might be available.
+     * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The maximum number of results to return from this request.
+     * Non-positive values are ignored. The presence of `nextPageToken` in the
+     * response indicates that more results might be available.
+     * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000004); + pageSize_ = 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.logging.v2.ListBucketsRequest) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.ListBucketsRequest) + private static final com.google.logging.v2.ListBucketsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.ListBucketsRequest(); + } + + public static com.google.logging.v2.ListBucketsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListBucketsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.ListBucketsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListBucketsRequestOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListBucketsRequestOrBuilder.java new file mode 100644 index 000000000000..1353d494fb4e --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListBucketsRequestOrBuilder.java @@ -0,0 +1,121 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface ListBucketsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.ListBucketsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource whose buckets are to be listed:
+   *
+   *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]"
+   *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]"
+   *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]"
+   *
+   * Note: The locations portion of the resource must be specified, but
+   * supplying the character `-` in place of [LOCATION_ID] will return all
+   * buckets.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
+   * Required. The parent resource whose buckets are to be listed:
+   *
+   *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]"
+   *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]"
+   *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]"
+   *
+   * Note: The locations portion of the resource must be specified, but
+   * supplying the character `-` in place of [LOCATION_ID] will return all
+   * buckets.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. If present, then retrieve the next batch of results from the
+   * preceding call to this method. `pageToken` must be the value of
+   * `nextPageToken` from the previous response. The values of other method
+   * parameters should be identical to those in the previous call.
+   * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
+   * Optional. If present, then retrieve the next batch of results from the
+   * preceding call to this method. `pageToken` must be the value of
+   * `nextPageToken` from the previous response. The values of other method
+   * parameters should be identical to those in the previous call.
+   * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Optional. The maximum number of results to return from this request.
+   * Non-positive values are ignored. The presence of `nextPageToken` in the
+   * response indicates that more results might be available.
+   * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListBucketsResponse.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListBucketsResponse.java new file mode 100644 index 000000000000..0ce5a98796bb --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListBucketsResponse.java @@ -0,0 +1,1157 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * The response from ListBuckets.
+ * 
+ * + * Protobuf type {@code google.logging.v2.ListBucketsResponse} + */ +public final class ListBucketsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.ListBucketsResponse) + ListBucketsResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ListBucketsResponse.newBuilder() to construct. + private ListBucketsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListBucketsResponse() { + buckets_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListBucketsResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_ListBucketsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_ListBucketsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.ListBucketsResponse.class, + com.google.logging.v2.ListBucketsResponse.Builder.class); + } + + public static final int BUCKETS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List buckets_; + + /** + * + * + *
+   * A list of buckets.
+   * 
+ * + * repeated .google.logging.v2.LogBucket buckets = 1; + */ + @java.lang.Override + public java.util.List getBucketsList() { + return buckets_; + } + + /** + * + * + *
+   * A list of buckets.
+   * 
+ * + * repeated .google.logging.v2.LogBucket buckets = 1; + */ + @java.lang.Override + public java.util.List + getBucketsOrBuilderList() { + return buckets_; + } + + /** + * + * + *
+   * A list of buckets.
+   * 
+ * + * repeated .google.logging.v2.LogBucket buckets = 1; + */ + @java.lang.Override + public int getBucketsCount() { + return buckets_.size(); + } + + /** + * + * + *
+   * A list of buckets.
+   * 
+ * + * repeated .google.logging.v2.LogBucket buckets = 1; + */ + @java.lang.Override + public com.google.logging.v2.LogBucket getBuckets(int index) { + return buckets_.get(index); + } + + /** + * + * + *
+   * A list of buckets.
+   * 
+ * + * repeated .google.logging.v2.LogBucket buckets = 1; + */ + @java.lang.Override + public com.google.logging.v2.LogBucketOrBuilder getBucketsOrBuilder(int index) { + return buckets_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+   * If there might be more results than appear in this response, then
+   * `nextPageToken` is included. To get the next set of results, call the same
+   * method again using the value of `nextPageToken` as `pageToken`.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * If there might be more results than appear in this response, then
+   * `nextPageToken` is included. To get the next set of results, call the same
+   * method again using the value of `nextPageToken` as `pageToken`.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < buckets_.size(); i++) { + output.writeMessage(1, buckets_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < buckets_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, buckets_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += getUnknownFields().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.logging.v2.ListBucketsResponse)) { + return super.equals(obj); + } + com.google.logging.v2.ListBucketsResponse other = + (com.google.logging.v2.ListBucketsResponse) obj; + + if (!getBucketsList().equals(other.getBucketsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getBucketsCount() > 0) { + hash = (37 * hash) + BUCKETS_FIELD_NUMBER; + hash = (53 * hash) + getBucketsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.ListBucketsResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.ListBucketsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.ListBucketsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.ListBucketsResponse 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.logging.v2.ListBucketsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.ListBucketsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.ListBucketsResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.ListBucketsResponse 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.logging.v2.ListBucketsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.ListBucketsResponse 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.logging.v2.ListBucketsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.ListBucketsResponse 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.logging.v2.ListBucketsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The response from ListBuckets.
+   * 
+ * + * Protobuf type {@code google.logging.v2.ListBucketsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.ListBucketsResponse) + com.google.logging.v2.ListBucketsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_ListBucketsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_ListBucketsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.ListBucketsResponse.class, + com.google.logging.v2.ListBucketsResponse.Builder.class); + } + + // Construct using com.google.logging.v2.ListBucketsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (bucketsBuilder_ == null) { + buckets_ = java.util.Collections.emptyList(); + } else { + buckets_ = null; + bucketsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_ListBucketsResponse_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.ListBucketsResponse getDefaultInstanceForType() { + return com.google.logging.v2.ListBucketsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.ListBucketsResponse build() { + com.google.logging.v2.ListBucketsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.ListBucketsResponse buildPartial() { + com.google.logging.v2.ListBucketsResponse result = + new com.google.logging.v2.ListBucketsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.logging.v2.ListBucketsResponse result) { + if (bucketsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + buckets_ = java.util.Collections.unmodifiableList(buckets_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.buckets_ = buckets_; + } else { + result.buckets_ = bucketsBuilder_.build(); + } + } + + private void buildPartial0(com.google.logging.v2.ListBucketsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @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.logging.v2.ListBucketsResponse) { + return mergeFrom((com.google.logging.v2.ListBucketsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.ListBucketsResponse other) { + if (other == com.google.logging.v2.ListBucketsResponse.getDefaultInstance()) return this; + if (bucketsBuilder_ == null) { + if (!other.buckets_.isEmpty()) { + if (buckets_.isEmpty()) { + buckets_ = other.buckets_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureBucketsIsMutable(); + buckets_.addAll(other.buckets_); + } + onChanged(); + } + } else { + if (!other.buckets_.isEmpty()) { + if (bucketsBuilder_.isEmpty()) { + bucketsBuilder_.dispose(); + bucketsBuilder_ = null; + buckets_ = other.buckets_; + bitField0_ = (bitField0_ & ~0x00000001); + bucketsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getBucketsFieldBuilder() + : null; + } else { + bucketsBuilder_.addAllMessages(other.buckets_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.logging.v2.LogBucket m = + input.readMessage(com.google.logging.v2.LogBucket.parser(), extensionRegistry); + if (bucketsBuilder_ == null) { + ensureBucketsIsMutable(); + buckets_.add(m); + } else { + bucketsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List buckets_ = + java.util.Collections.emptyList(); + + private void ensureBucketsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + buckets_ = new java.util.ArrayList(buckets_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.logging.v2.LogBucket, + com.google.logging.v2.LogBucket.Builder, + com.google.logging.v2.LogBucketOrBuilder> + bucketsBuilder_; + + /** + * + * + *
+     * A list of buckets.
+     * 
+ * + * repeated .google.logging.v2.LogBucket buckets = 1; + */ + public java.util.List getBucketsList() { + if (bucketsBuilder_ == null) { + return java.util.Collections.unmodifiableList(buckets_); + } else { + return bucketsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * A list of buckets.
+     * 
+ * + * repeated .google.logging.v2.LogBucket buckets = 1; + */ + public int getBucketsCount() { + if (bucketsBuilder_ == null) { + return buckets_.size(); + } else { + return bucketsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * A list of buckets.
+     * 
+ * + * repeated .google.logging.v2.LogBucket buckets = 1; + */ + public com.google.logging.v2.LogBucket getBuckets(int index) { + if (bucketsBuilder_ == null) { + return buckets_.get(index); + } else { + return bucketsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * A list of buckets.
+     * 
+ * + * repeated .google.logging.v2.LogBucket buckets = 1; + */ + public Builder setBuckets(int index, com.google.logging.v2.LogBucket value) { + if (bucketsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBucketsIsMutable(); + buckets_.set(index, value); + onChanged(); + } else { + bucketsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * A list of buckets.
+     * 
+ * + * repeated .google.logging.v2.LogBucket buckets = 1; + */ + public Builder setBuckets(int index, com.google.logging.v2.LogBucket.Builder builderForValue) { + if (bucketsBuilder_ == null) { + ensureBucketsIsMutable(); + buckets_.set(index, builderForValue.build()); + onChanged(); + } else { + bucketsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of buckets.
+     * 
+ * + * repeated .google.logging.v2.LogBucket buckets = 1; + */ + public Builder addBuckets(com.google.logging.v2.LogBucket value) { + if (bucketsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBucketsIsMutable(); + buckets_.add(value); + onChanged(); + } else { + bucketsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * A list of buckets.
+     * 
+ * + * repeated .google.logging.v2.LogBucket buckets = 1; + */ + public Builder addBuckets(int index, com.google.logging.v2.LogBucket value) { + if (bucketsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBucketsIsMutable(); + buckets_.add(index, value); + onChanged(); + } else { + bucketsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * A list of buckets.
+     * 
+ * + * repeated .google.logging.v2.LogBucket buckets = 1; + */ + public Builder addBuckets(com.google.logging.v2.LogBucket.Builder builderForValue) { + if (bucketsBuilder_ == null) { + ensureBucketsIsMutable(); + buckets_.add(builderForValue.build()); + onChanged(); + } else { + bucketsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of buckets.
+     * 
+ * + * repeated .google.logging.v2.LogBucket buckets = 1; + */ + public Builder addBuckets(int index, com.google.logging.v2.LogBucket.Builder builderForValue) { + if (bucketsBuilder_ == null) { + ensureBucketsIsMutable(); + buckets_.add(index, builderForValue.build()); + onChanged(); + } else { + bucketsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of buckets.
+     * 
+ * + * repeated .google.logging.v2.LogBucket buckets = 1; + */ + public Builder addAllBuckets( + java.lang.Iterable values) { + if (bucketsBuilder_ == null) { + ensureBucketsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, buckets_); + onChanged(); + } else { + bucketsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * A list of buckets.
+     * 
+ * + * repeated .google.logging.v2.LogBucket buckets = 1; + */ + public Builder clearBuckets() { + if (bucketsBuilder_ == null) { + buckets_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + bucketsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * A list of buckets.
+     * 
+ * + * repeated .google.logging.v2.LogBucket buckets = 1; + */ + public Builder removeBuckets(int index) { + if (bucketsBuilder_ == null) { + ensureBucketsIsMutable(); + buckets_.remove(index); + onChanged(); + } else { + bucketsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * A list of buckets.
+     * 
+ * + * repeated .google.logging.v2.LogBucket buckets = 1; + */ + public com.google.logging.v2.LogBucket.Builder getBucketsBuilder(int index) { + return getBucketsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * A list of buckets.
+     * 
+ * + * repeated .google.logging.v2.LogBucket buckets = 1; + */ + public com.google.logging.v2.LogBucketOrBuilder getBucketsOrBuilder(int index) { + if (bucketsBuilder_ == null) { + return buckets_.get(index); + } else { + return bucketsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * A list of buckets.
+     * 
+ * + * repeated .google.logging.v2.LogBucket buckets = 1; + */ + public java.util.List + getBucketsOrBuilderList() { + if (bucketsBuilder_ != null) { + return bucketsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(buckets_); + } + } + + /** + * + * + *
+     * A list of buckets.
+     * 
+ * + * repeated .google.logging.v2.LogBucket buckets = 1; + */ + public com.google.logging.v2.LogBucket.Builder addBucketsBuilder() { + return getBucketsFieldBuilder() + .addBuilder(com.google.logging.v2.LogBucket.getDefaultInstance()); + } + + /** + * + * + *
+     * A list of buckets.
+     * 
+ * + * repeated .google.logging.v2.LogBucket buckets = 1; + */ + public com.google.logging.v2.LogBucket.Builder addBucketsBuilder(int index) { + return getBucketsFieldBuilder() + .addBuilder(index, com.google.logging.v2.LogBucket.getDefaultInstance()); + } + + /** + * + * + *
+     * A list of buckets.
+     * 
+ * + * repeated .google.logging.v2.LogBucket buckets = 1; + */ + public java.util.List getBucketsBuilderList() { + return getBucketsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.logging.v2.LogBucket, + com.google.logging.v2.LogBucket.Builder, + com.google.logging.v2.LogBucketOrBuilder> + getBucketsFieldBuilder() { + if (bucketsBuilder_ == null) { + bucketsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.logging.v2.LogBucket, + com.google.logging.v2.LogBucket.Builder, + com.google.logging.v2.LogBucketOrBuilder>( + buckets_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + buckets_ = null; + } + return bucketsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+     * If there might be more results than appear in this response, then
+     * `nextPageToken` is included. To get the next set of results, call the same
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * If there might be more results than appear in this response, then
+     * `nextPageToken` is included. To get the next set of results, call the same
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * If there might be more results than appear in this response, then
+     * `nextPageToken` is included. To get the next set of results, call the same
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * If there might be more results than appear in this response, then
+     * `nextPageToken` is included. To get the next set of results, call the same
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * If there might be more results than appear in this response, then
+     * `nextPageToken` is included. To get the next set of results, call the same
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextPageToken_ = value; + bitField0_ |= 0x00000002; + 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.logging.v2.ListBucketsResponse) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.ListBucketsResponse) + private static final com.google.logging.v2.ListBucketsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.ListBucketsResponse(); + } + + public static com.google.logging.v2.ListBucketsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListBucketsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.ListBucketsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListBucketsResponseOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListBucketsResponseOrBuilder.java new file mode 100644 index 000000000000..1d7ebd525835 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListBucketsResponseOrBuilder.java @@ -0,0 +1,111 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface ListBucketsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.ListBucketsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A list of buckets.
+   * 
+ * + * repeated .google.logging.v2.LogBucket buckets = 1; + */ + java.util.List getBucketsList(); + + /** + * + * + *
+   * A list of buckets.
+   * 
+ * + * repeated .google.logging.v2.LogBucket buckets = 1; + */ + com.google.logging.v2.LogBucket getBuckets(int index); + + /** + * + * + *
+   * A list of buckets.
+   * 
+ * + * repeated .google.logging.v2.LogBucket buckets = 1; + */ + int getBucketsCount(); + + /** + * + * + *
+   * A list of buckets.
+   * 
+ * + * repeated .google.logging.v2.LogBucket buckets = 1; + */ + java.util.List getBucketsOrBuilderList(); + + /** + * + * + *
+   * A list of buckets.
+   * 
+ * + * repeated .google.logging.v2.LogBucket buckets = 1; + */ + com.google.logging.v2.LogBucketOrBuilder getBucketsOrBuilder(int index); + + /** + * + * + *
+   * If there might be more results than appear in this response, then
+   * `nextPageToken` is included. To get the next set of results, call the same
+   * method again using the value of `nextPageToken` as `pageToken`.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
+   * If there might be more results than appear in this response, then
+   * `nextPageToken` is included. To get the next set of results, call the same
+   * method again using the value of `nextPageToken` as `pageToken`.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListExclusionsRequest.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListExclusionsRequest.java new file mode 100644 index 000000000000..4eab300ad546 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListExclusionsRequest.java @@ -0,0 +1,997 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * The parameters to `ListExclusions`.
+ * 
+ * + * Protobuf type {@code google.logging.v2.ListExclusionsRequest} + */ +public final class ListExclusionsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.ListExclusionsRequest) + ListExclusionsRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ListExclusionsRequest.newBuilder() to construct. + private ListExclusionsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListExclusionsRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListExclusionsRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_ListExclusionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_ListExclusionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.ListExclusionsRequest.class, + com.google.logging.v2.ListExclusionsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
+   * Required. The parent resource whose exclusions are to be listed.
+   *
+   *     "projects/[PROJECT_ID]"
+   *     "organizations/[ORGANIZATION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+   *     "folders/[FOLDER_ID]"
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The parent resource whose exclusions are to be listed.
+   *
+   *     "projects/[PROJECT_ID]"
+   *     "organizations/[ORGANIZATION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+   *     "folders/[FOLDER_ID]"
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + + /** + * + * + *
+   * Optional. If present, then retrieve the next batch of results from the
+   * preceding call to this method. `pageToken` must be the value of
+   * `nextPageToken` from the previous response. The values of other method
+   * parameters should be identical to those in the previous call.
+   * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. If present, then retrieve the next batch of results from the
+   * preceding call to this method. `pageToken` must be the value of
+   * `nextPageToken` from the previous response. The values of other method
+   * parameters should be identical to those in the previous call.
+   * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 3; + private int pageSize_ = 0; + + /** + * + * + *
+   * Optional. The maximum number of results to return from this request.
+   * Non-positive values are ignored. The presence of `nextPageToken` in the
+   * response indicates that more results might be available.
+   * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, pageToken_); + } + if (pageSize_ != 0) { + output.writeInt32(3, pageSize_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, pageToken_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, pageSize_); + } + size += getUnknownFields().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.logging.v2.ListExclusionsRequest)) { + return super.equals(obj); + } + com.google.logging.v2.ListExclusionsRequest other = + (com.google.logging.v2.ListExclusionsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.ListExclusionsRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.ListExclusionsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.ListExclusionsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.ListExclusionsRequest 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.logging.v2.ListExclusionsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.ListExclusionsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.ListExclusionsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.ListExclusionsRequest 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.logging.v2.ListExclusionsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.ListExclusionsRequest 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.logging.v2.ListExclusionsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.ListExclusionsRequest 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.logging.v2.ListExclusionsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The parameters to `ListExclusions`.
+   * 
+ * + * Protobuf type {@code google.logging.v2.ListExclusionsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.ListExclusionsRequest) + com.google.logging.v2.ListExclusionsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_ListExclusionsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_ListExclusionsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.ListExclusionsRequest.class, + com.google.logging.v2.ListExclusionsRequest.Builder.class); + } + + // Construct using com.google.logging.v2.ListExclusionsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageToken_ = ""; + pageSize_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_ListExclusionsRequest_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.ListExclusionsRequest getDefaultInstanceForType() { + return com.google.logging.v2.ListExclusionsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.ListExclusionsRequest build() { + com.google.logging.v2.ListExclusionsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.ListExclusionsRequest buildPartial() { + com.google.logging.v2.ListExclusionsRequest result = + new com.google.logging.v2.ListExclusionsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.logging.v2.ListExclusionsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageToken_ = pageToken_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageSize_ = pageSize_; + } + } + + @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.logging.v2.ListExclusionsRequest) { + return mergeFrom((com.google.logging.v2.ListExclusionsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.ListExclusionsRequest other) { + if (other == com.google.logging.v2.ListExclusionsRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + + /** + * + * + *
+     * Required. The parent resource whose exclusions are to be listed.
+     *
+     *     "projects/[PROJECT_ID]"
+     *     "organizations/[ORGANIZATION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+     *     "folders/[FOLDER_ID]"
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The parent resource whose exclusions are to be listed.
+     *
+     *     "projects/[PROJECT_ID]"
+     *     "organizations/[ORGANIZATION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+     *     "folders/[FOLDER_ID]"
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The parent resource whose exclusions are to be listed.
+     *
+     *     "projects/[PROJECT_ID]"
+     *     "organizations/[ORGANIZATION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+     *     "folders/[FOLDER_ID]"
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The parent resource whose exclusions are to be listed.
+     *
+     *     "projects/[PROJECT_ID]"
+     *     "organizations/[ORGANIZATION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+     *     "folders/[FOLDER_ID]"
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The parent resource whose exclusions are to be listed.
+     *
+     *     "projects/[PROJECT_ID]"
+     *     "organizations/[ORGANIZATION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+     *     "folders/[FOLDER_ID]"
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method. `pageToken` must be the value of
+     * `nextPageToken` from the previous response. The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method. `pageToken` must be the value of
+     * `nextPageToken` from the previous response. The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method. `pageToken` must be the value of
+     * `nextPageToken` from the previous response. The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method. `pageToken` must be the value of
+     * `nextPageToken` from the previous response. The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method. `pageToken` must be the value of
+     * `nextPageToken` from the previous response. The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int pageSize_; + + /** + * + * + *
+     * Optional. The maximum number of results to return from this request.
+     * Non-positive values are ignored. The presence of `nextPageToken` in the
+     * response indicates that more results might be available.
+     * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + /** + * + * + *
+     * Optional. The maximum number of results to return from this request.
+     * Non-positive values are ignored. The presence of `nextPageToken` in the
+     * response indicates that more results might be available.
+     * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The maximum number of results to return from this request.
+     * Non-positive values are ignored. The presence of `nextPageToken` in the
+     * response indicates that more results might be available.
+     * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000004); + pageSize_ = 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.logging.v2.ListExclusionsRequest) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.ListExclusionsRequest) + private static final com.google.logging.v2.ListExclusionsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.ListExclusionsRequest(); + } + + public static com.google.logging.v2.ListExclusionsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListExclusionsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.ListExclusionsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListExclusionsRequestOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListExclusionsRequestOrBuilder.java new file mode 100644 index 000000000000..fabecce1e8ba --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListExclusionsRequestOrBuilder.java @@ -0,0 +1,113 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface ListExclusionsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.ListExclusionsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource whose exclusions are to be listed.
+   *
+   *     "projects/[PROJECT_ID]"
+   *     "organizations/[ORGANIZATION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+   *     "folders/[FOLDER_ID]"
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
+   * Required. The parent resource whose exclusions are to be listed.
+   *
+   *     "projects/[PROJECT_ID]"
+   *     "organizations/[ORGANIZATION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+   *     "folders/[FOLDER_ID]"
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. If present, then retrieve the next batch of results from the
+   * preceding call to this method. `pageToken` must be the value of
+   * `nextPageToken` from the previous response. The values of other method
+   * parameters should be identical to those in the previous call.
+   * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
+   * Optional. If present, then retrieve the next batch of results from the
+   * preceding call to this method. `pageToken` must be the value of
+   * `nextPageToken` from the previous response. The values of other method
+   * parameters should be identical to those in the previous call.
+   * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Optional. The maximum number of results to return from this request.
+   * Non-positive values are ignored. The presence of `nextPageToken` in the
+   * response indicates that more results might be available.
+   * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListExclusionsResponse.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListExclusionsResponse.java new file mode 100644 index 000000000000..f68fd08cc1f7 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListExclusionsResponse.java @@ -0,0 +1,1160 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * Result returned from `ListExclusions`.
+ * 
+ * + * Protobuf type {@code google.logging.v2.ListExclusionsResponse} + */ +public final class ListExclusionsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.ListExclusionsResponse) + ListExclusionsResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ListExclusionsResponse.newBuilder() to construct. + private ListExclusionsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListExclusionsResponse() { + exclusions_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListExclusionsResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_ListExclusionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_ListExclusionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.ListExclusionsResponse.class, + com.google.logging.v2.ListExclusionsResponse.Builder.class); + } + + public static final int EXCLUSIONS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List exclusions_; + + /** + * + * + *
+   * A list of exclusions.
+   * 
+ * + * repeated .google.logging.v2.LogExclusion exclusions = 1; + */ + @java.lang.Override + public java.util.List getExclusionsList() { + return exclusions_; + } + + /** + * + * + *
+   * A list of exclusions.
+   * 
+ * + * repeated .google.logging.v2.LogExclusion exclusions = 1; + */ + @java.lang.Override + public java.util.List + getExclusionsOrBuilderList() { + return exclusions_; + } + + /** + * + * + *
+   * A list of exclusions.
+   * 
+ * + * repeated .google.logging.v2.LogExclusion exclusions = 1; + */ + @java.lang.Override + public int getExclusionsCount() { + return exclusions_.size(); + } + + /** + * + * + *
+   * A list of exclusions.
+   * 
+ * + * repeated .google.logging.v2.LogExclusion exclusions = 1; + */ + @java.lang.Override + public com.google.logging.v2.LogExclusion getExclusions(int index) { + return exclusions_.get(index); + } + + /** + * + * + *
+   * A list of exclusions.
+   * 
+ * + * repeated .google.logging.v2.LogExclusion exclusions = 1; + */ + @java.lang.Override + public com.google.logging.v2.LogExclusionOrBuilder getExclusionsOrBuilder(int index) { + return exclusions_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+   * If there might be more results than appear in this response, then
+   * `nextPageToken` is included. To get the next set of results, call the same
+   * method again using the value of `nextPageToken` as `pageToken`.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * If there might be more results than appear in this response, then
+   * `nextPageToken` is included. To get the next set of results, call the same
+   * method again using the value of `nextPageToken` as `pageToken`.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < exclusions_.size(); i++) { + output.writeMessage(1, exclusions_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < exclusions_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, exclusions_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += getUnknownFields().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.logging.v2.ListExclusionsResponse)) { + return super.equals(obj); + } + com.google.logging.v2.ListExclusionsResponse other = + (com.google.logging.v2.ListExclusionsResponse) obj; + + if (!getExclusionsList().equals(other.getExclusionsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getExclusionsCount() > 0) { + hash = (37 * hash) + EXCLUSIONS_FIELD_NUMBER; + hash = (53 * hash) + getExclusionsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.ListExclusionsResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.ListExclusionsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.ListExclusionsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.ListExclusionsResponse 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.logging.v2.ListExclusionsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.ListExclusionsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.ListExclusionsResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.ListExclusionsResponse 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.logging.v2.ListExclusionsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.ListExclusionsResponse 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.logging.v2.ListExclusionsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.ListExclusionsResponse 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.logging.v2.ListExclusionsResponse 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; + } + + /** + * + * + *
+   * Result returned from `ListExclusions`.
+   * 
+ * + * Protobuf type {@code google.logging.v2.ListExclusionsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.ListExclusionsResponse) + com.google.logging.v2.ListExclusionsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_ListExclusionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_ListExclusionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.ListExclusionsResponse.class, + com.google.logging.v2.ListExclusionsResponse.Builder.class); + } + + // Construct using com.google.logging.v2.ListExclusionsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (exclusionsBuilder_ == null) { + exclusions_ = java.util.Collections.emptyList(); + } else { + exclusions_ = null; + exclusionsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_ListExclusionsResponse_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.ListExclusionsResponse getDefaultInstanceForType() { + return com.google.logging.v2.ListExclusionsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.ListExclusionsResponse build() { + com.google.logging.v2.ListExclusionsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.ListExclusionsResponse buildPartial() { + com.google.logging.v2.ListExclusionsResponse result = + new com.google.logging.v2.ListExclusionsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.logging.v2.ListExclusionsResponse result) { + if (exclusionsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + exclusions_ = java.util.Collections.unmodifiableList(exclusions_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.exclusions_ = exclusions_; + } else { + result.exclusions_ = exclusionsBuilder_.build(); + } + } + + private void buildPartial0(com.google.logging.v2.ListExclusionsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @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.logging.v2.ListExclusionsResponse) { + return mergeFrom((com.google.logging.v2.ListExclusionsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.ListExclusionsResponse other) { + if (other == com.google.logging.v2.ListExclusionsResponse.getDefaultInstance()) return this; + if (exclusionsBuilder_ == null) { + if (!other.exclusions_.isEmpty()) { + if (exclusions_.isEmpty()) { + exclusions_ = other.exclusions_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureExclusionsIsMutable(); + exclusions_.addAll(other.exclusions_); + } + onChanged(); + } + } else { + if (!other.exclusions_.isEmpty()) { + if (exclusionsBuilder_.isEmpty()) { + exclusionsBuilder_.dispose(); + exclusionsBuilder_ = null; + exclusions_ = other.exclusions_; + bitField0_ = (bitField0_ & ~0x00000001); + exclusionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getExclusionsFieldBuilder() + : null; + } else { + exclusionsBuilder_.addAllMessages(other.exclusions_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.logging.v2.LogExclusion m = + input.readMessage( + com.google.logging.v2.LogExclusion.parser(), extensionRegistry); + if (exclusionsBuilder_ == null) { + ensureExclusionsIsMutable(); + exclusions_.add(m); + } else { + exclusionsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List exclusions_ = + java.util.Collections.emptyList(); + + private void ensureExclusionsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + exclusions_ = new java.util.ArrayList(exclusions_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.logging.v2.LogExclusion, + com.google.logging.v2.LogExclusion.Builder, + com.google.logging.v2.LogExclusionOrBuilder> + exclusionsBuilder_; + + /** + * + * + *
+     * A list of exclusions.
+     * 
+ * + * repeated .google.logging.v2.LogExclusion exclusions = 1; + */ + public java.util.List getExclusionsList() { + if (exclusionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(exclusions_); + } else { + return exclusionsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * A list of exclusions.
+     * 
+ * + * repeated .google.logging.v2.LogExclusion exclusions = 1; + */ + public int getExclusionsCount() { + if (exclusionsBuilder_ == null) { + return exclusions_.size(); + } else { + return exclusionsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * A list of exclusions.
+     * 
+ * + * repeated .google.logging.v2.LogExclusion exclusions = 1; + */ + public com.google.logging.v2.LogExclusion getExclusions(int index) { + if (exclusionsBuilder_ == null) { + return exclusions_.get(index); + } else { + return exclusionsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * A list of exclusions.
+     * 
+ * + * repeated .google.logging.v2.LogExclusion exclusions = 1; + */ + public Builder setExclusions(int index, com.google.logging.v2.LogExclusion value) { + if (exclusionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExclusionsIsMutable(); + exclusions_.set(index, value); + onChanged(); + } else { + exclusionsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * A list of exclusions.
+     * 
+ * + * repeated .google.logging.v2.LogExclusion exclusions = 1; + */ + public Builder setExclusions( + int index, com.google.logging.v2.LogExclusion.Builder builderForValue) { + if (exclusionsBuilder_ == null) { + ensureExclusionsIsMutable(); + exclusions_.set(index, builderForValue.build()); + onChanged(); + } else { + exclusionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of exclusions.
+     * 
+ * + * repeated .google.logging.v2.LogExclusion exclusions = 1; + */ + public Builder addExclusions(com.google.logging.v2.LogExclusion value) { + if (exclusionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExclusionsIsMutable(); + exclusions_.add(value); + onChanged(); + } else { + exclusionsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * A list of exclusions.
+     * 
+ * + * repeated .google.logging.v2.LogExclusion exclusions = 1; + */ + public Builder addExclusions(int index, com.google.logging.v2.LogExclusion value) { + if (exclusionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExclusionsIsMutable(); + exclusions_.add(index, value); + onChanged(); + } else { + exclusionsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * A list of exclusions.
+     * 
+ * + * repeated .google.logging.v2.LogExclusion exclusions = 1; + */ + public Builder addExclusions(com.google.logging.v2.LogExclusion.Builder builderForValue) { + if (exclusionsBuilder_ == null) { + ensureExclusionsIsMutable(); + exclusions_.add(builderForValue.build()); + onChanged(); + } else { + exclusionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of exclusions.
+     * 
+ * + * repeated .google.logging.v2.LogExclusion exclusions = 1; + */ + public Builder addExclusions( + int index, com.google.logging.v2.LogExclusion.Builder builderForValue) { + if (exclusionsBuilder_ == null) { + ensureExclusionsIsMutable(); + exclusions_.add(index, builderForValue.build()); + onChanged(); + } else { + exclusionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of exclusions.
+     * 
+ * + * repeated .google.logging.v2.LogExclusion exclusions = 1; + */ + public Builder addAllExclusions( + java.lang.Iterable values) { + if (exclusionsBuilder_ == null) { + ensureExclusionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, exclusions_); + onChanged(); + } else { + exclusionsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * A list of exclusions.
+     * 
+ * + * repeated .google.logging.v2.LogExclusion exclusions = 1; + */ + public Builder clearExclusions() { + if (exclusionsBuilder_ == null) { + exclusions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + exclusionsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * A list of exclusions.
+     * 
+ * + * repeated .google.logging.v2.LogExclusion exclusions = 1; + */ + public Builder removeExclusions(int index) { + if (exclusionsBuilder_ == null) { + ensureExclusionsIsMutable(); + exclusions_.remove(index); + onChanged(); + } else { + exclusionsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * A list of exclusions.
+     * 
+ * + * repeated .google.logging.v2.LogExclusion exclusions = 1; + */ + public com.google.logging.v2.LogExclusion.Builder getExclusionsBuilder(int index) { + return getExclusionsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * A list of exclusions.
+     * 
+ * + * repeated .google.logging.v2.LogExclusion exclusions = 1; + */ + public com.google.logging.v2.LogExclusionOrBuilder getExclusionsOrBuilder(int index) { + if (exclusionsBuilder_ == null) { + return exclusions_.get(index); + } else { + return exclusionsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * A list of exclusions.
+     * 
+ * + * repeated .google.logging.v2.LogExclusion exclusions = 1; + */ + public java.util.List + getExclusionsOrBuilderList() { + if (exclusionsBuilder_ != null) { + return exclusionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(exclusions_); + } + } + + /** + * + * + *
+     * A list of exclusions.
+     * 
+ * + * repeated .google.logging.v2.LogExclusion exclusions = 1; + */ + public com.google.logging.v2.LogExclusion.Builder addExclusionsBuilder() { + return getExclusionsFieldBuilder() + .addBuilder(com.google.logging.v2.LogExclusion.getDefaultInstance()); + } + + /** + * + * + *
+     * A list of exclusions.
+     * 
+ * + * repeated .google.logging.v2.LogExclusion exclusions = 1; + */ + public com.google.logging.v2.LogExclusion.Builder addExclusionsBuilder(int index) { + return getExclusionsFieldBuilder() + .addBuilder(index, com.google.logging.v2.LogExclusion.getDefaultInstance()); + } + + /** + * + * + *
+     * A list of exclusions.
+     * 
+ * + * repeated .google.logging.v2.LogExclusion exclusions = 1; + */ + public java.util.List getExclusionsBuilderList() { + return getExclusionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.logging.v2.LogExclusion, + com.google.logging.v2.LogExclusion.Builder, + com.google.logging.v2.LogExclusionOrBuilder> + getExclusionsFieldBuilder() { + if (exclusionsBuilder_ == null) { + exclusionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.logging.v2.LogExclusion, + com.google.logging.v2.LogExclusion.Builder, + com.google.logging.v2.LogExclusionOrBuilder>( + exclusions_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + exclusions_ = null; + } + return exclusionsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+     * If there might be more results than appear in this response, then
+     * `nextPageToken` is included. To get the next set of results, call the same
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * If there might be more results than appear in this response, then
+     * `nextPageToken` is included. To get the next set of results, call the same
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * If there might be more results than appear in this response, then
+     * `nextPageToken` is included. To get the next set of results, call the same
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * If there might be more results than appear in this response, then
+     * `nextPageToken` is included. To get the next set of results, call the same
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * If there might be more results than appear in this response, then
+     * `nextPageToken` is included. To get the next set of results, call the same
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextPageToken_ = value; + bitField0_ |= 0x00000002; + 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.logging.v2.ListExclusionsResponse) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.ListExclusionsResponse) + private static final com.google.logging.v2.ListExclusionsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.ListExclusionsResponse(); + } + + public static com.google.logging.v2.ListExclusionsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListExclusionsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.ListExclusionsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListExclusionsResponseOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListExclusionsResponseOrBuilder.java new file mode 100644 index 000000000000..45628897b5a8 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListExclusionsResponseOrBuilder.java @@ -0,0 +1,112 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface ListExclusionsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.ListExclusionsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A list of exclusions.
+   * 
+ * + * repeated .google.logging.v2.LogExclusion exclusions = 1; + */ + java.util.List getExclusionsList(); + + /** + * + * + *
+   * A list of exclusions.
+   * 
+ * + * repeated .google.logging.v2.LogExclusion exclusions = 1; + */ + com.google.logging.v2.LogExclusion getExclusions(int index); + + /** + * + * + *
+   * A list of exclusions.
+   * 
+ * + * repeated .google.logging.v2.LogExclusion exclusions = 1; + */ + int getExclusionsCount(); + + /** + * + * + *
+   * A list of exclusions.
+   * 
+ * + * repeated .google.logging.v2.LogExclusion exclusions = 1; + */ + java.util.List + getExclusionsOrBuilderList(); + + /** + * + * + *
+   * A list of exclusions.
+   * 
+ * + * repeated .google.logging.v2.LogExclusion exclusions = 1; + */ + com.google.logging.v2.LogExclusionOrBuilder getExclusionsOrBuilder(int index); + + /** + * + * + *
+   * If there might be more results than appear in this response, then
+   * `nextPageToken` is included. To get the next set of results, call the same
+   * method again using the value of `nextPageToken` as `pageToken`.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
+   * If there might be more results than appear in this response, then
+   * `nextPageToken` is included. To get the next set of results, call the same
+   * method again using the value of `nextPageToken` as `pageToken`.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLinksRequest.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLinksRequest.java new file mode 100644 index 000000000000..52fcaac17d09 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLinksRequest.java @@ -0,0 +1,981 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * The parameters to ListLinks.
+ * 
+ * + * Protobuf type {@code google.logging.v2.ListLinksRequest} + */ +public final class ListLinksRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.ListLinksRequest) + ListLinksRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ListLinksRequest.newBuilder() to construct. + private ListLinksRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListLinksRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListLinksRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_ListLinksRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_ListLinksRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.ListLinksRequest.class, + com.google.logging.v2.ListLinksRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
+   * Required. The parent resource whose links are to be listed:
+   *
+   *   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/"
+   *   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/"
+   *   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/"
+   *   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The parent resource whose links are to be listed:
+   *
+   *   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/"
+   *   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/"
+   *   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/"
+   *   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + + /** + * + * + *
+   * Optional. If present, then retrieve the next batch of results from the
+   * preceding call to this method. `pageToken` must be the value of
+   * `nextPageToken` from the previous response.
+   * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. If present, then retrieve the next batch of results from the
+   * preceding call to this method. `pageToken` must be the value of
+   * `nextPageToken` from the previous response.
+   * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 3; + private int pageSize_ = 0; + + /** + * + * + *
+   * Optional. The maximum number of results to return from this request.
+   * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, pageToken_); + } + if (pageSize_ != 0) { + output.writeInt32(3, pageSize_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, pageToken_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, pageSize_); + } + size += getUnknownFields().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.logging.v2.ListLinksRequest)) { + return super.equals(obj); + } + com.google.logging.v2.ListLinksRequest other = (com.google.logging.v2.ListLinksRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.ListLinksRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.ListLinksRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.ListLinksRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.ListLinksRequest 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.logging.v2.ListLinksRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.ListLinksRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.ListLinksRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.ListLinksRequest 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.logging.v2.ListLinksRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.ListLinksRequest 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.logging.v2.ListLinksRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.ListLinksRequest 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.logging.v2.ListLinksRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The parameters to ListLinks.
+   * 
+ * + * Protobuf type {@code google.logging.v2.ListLinksRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.ListLinksRequest) + com.google.logging.v2.ListLinksRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_ListLinksRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_ListLinksRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.ListLinksRequest.class, + com.google.logging.v2.ListLinksRequest.Builder.class); + } + + // Construct using com.google.logging.v2.ListLinksRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageToken_ = ""; + pageSize_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_ListLinksRequest_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.ListLinksRequest getDefaultInstanceForType() { + return com.google.logging.v2.ListLinksRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.ListLinksRequest build() { + com.google.logging.v2.ListLinksRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.ListLinksRequest buildPartial() { + com.google.logging.v2.ListLinksRequest result = + new com.google.logging.v2.ListLinksRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.logging.v2.ListLinksRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageToken_ = pageToken_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageSize_ = pageSize_; + } + } + + @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.logging.v2.ListLinksRequest) { + return mergeFrom((com.google.logging.v2.ListLinksRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.ListLinksRequest other) { + if (other == com.google.logging.v2.ListLinksRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + + /** + * + * + *
+     * Required. The parent resource whose links are to be listed:
+     *
+     *   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/"
+     *   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/"
+     *   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/"
+     *   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The parent resource whose links are to be listed:
+     *
+     *   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/"
+     *   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/"
+     *   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/"
+     *   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The parent resource whose links are to be listed:
+     *
+     *   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/"
+     *   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/"
+     *   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/"
+     *   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The parent resource whose links are to be listed:
+     *
+     *   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/"
+     *   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/"
+     *   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/"
+     *   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The parent resource whose links are to be listed:
+     *
+     *   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/"
+     *   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/"
+     *   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/"
+     *   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method. `pageToken` must be the value of
+     * `nextPageToken` from the previous response.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method. `pageToken` must be the value of
+     * `nextPageToken` from the previous response.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method. `pageToken` must be the value of
+     * `nextPageToken` from the previous response.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method. `pageToken` must be the value of
+     * `nextPageToken` from the previous response.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method. `pageToken` must be the value of
+     * `nextPageToken` from the previous response.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int pageSize_; + + /** + * + * + *
+     * Optional. The maximum number of results to return from this request.
+     * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + /** + * + * + *
+     * Optional. The maximum number of results to return from this request.
+     * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The maximum number of results to return from this request.
+     * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000004); + pageSize_ = 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.logging.v2.ListLinksRequest) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.ListLinksRequest) + private static final com.google.logging.v2.ListLinksRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.ListLinksRequest(); + } + + public static com.google.logging.v2.ListLinksRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListLinksRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.ListLinksRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLinksRequestOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLinksRequestOrBuilder.java new file mode 100644 index 000000000000..79c4c1071050 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLinksRequestOrBuilder.java @@ -0,0 +1,109 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface ListLinksRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.ListLinksRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource whose links are to be listed:
+   *
+   *   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/"
+   *   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/"
+   *   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/"
+   *   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
+   * Required. The parent resource whose links are to be listed:
+   *
+   *   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/"
+   *   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/"
+   *   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/"
+   *   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. If present, then retrieve the next batch of results from the
+   * preceding call to this method. `pageToken` must be the value of
+   * `nextPageToken` from the previous response.
+   * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
+   * Optional. If present, then retrieve the next batch of results from the
+   * preceding call to this method. `pageToken` must be the value of
+   * `nextPageToken` from the previous response.
+   * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Optional. The maximum number of results to return from this request.
+   * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLinksResponse.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLinksResponse.java new file mode 100644 index 000000000000..9776e8303ed4 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLinksResponse.java @@ -0,0 +1,1151 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * The response from ListLinks.
+ * 
+ * + * Protobuf type {@code google.logging.v2.ListLinksResponse} + */ +public final class ListLinksResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.ListLinksResponse) + ListLinksResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ListLinksResponse.newBuilder() to construct. + private ListLinksResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListLinksResponse() { + links_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListLinksResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_ListLinksResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_ListLinksResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.ListLinksResponse.class, + com.google.logging.v2.ListLinksResponse.Builder.class); + } + + public static final int LINKS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List links_; + + /** + * + * + *
+   * A list of links.
+   * 
+ * + * repeated .google.logging.v2.Link links = 1; + */ + @java.lang.Override + public java.util.List getLinksList() { + return links_; + } + + /** + * + * + *
+   * A list of links.
+   * 
+ * + * repeated .google.logging.v2.Link links = 1; + */ + @java.lang.Override + public java.util.List getLinksOrBuilderList() { + return links_; + } + + /** + * + * + *
+   * A list of links.
+   * 
+ * + * repeated .google.logging.v2.Link links = 1; + */ + @java.lang.Override + public int getLinksCount() { + return links_.size(); + } + + /** + * + * + *
+   * A list of links.
+   * 
+ * + * repeated .google.logging.v2.Link links = 1; + */ + @java.lang.Override + public com.google.logging.v2.Link getLinks(int index) { + return links_.get(index); + } + + /** + * + * + *
+   * A list of links.
+   * 
+ * + * repeated .google.logging.v2.Link links = 1; + */ + @java.lang.Override + public com.google.logging.v2.LinkOrBuilder getLinksOrBuilder(int index) { + return links_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+   * If there might be more results than those appearing in this response, then
+   * `nextPageToken` is included. To get the next set of results, call the same
+   * method again using the value of `nextPageToken` as `pageToken`.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * If there might be more results than those appearing in this response, then
+   * `nextPageToken` is included. To get the next set of results, call the same
+   * method again using the value of `nextPageToken` as `pageToken`.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < links_.size(); i++) { + output.writeMessage(1, links_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < links_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, links_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += getUnknownFields().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.logging.v2.ListLinksResponse)) { + return super.equals(obj); + } + com.google.logging.v2.ListLinksResponse other = (com.google.logging.v2.ListLinksResponse) obj; + + if (!getLinksList().equals(other.getLinksList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getLinksCount() > 0) { + hash = (37 * hash) + LINKS_FIELD_NUMBER; + hash = (53 * hash) + getLinksList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.ListLinksResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.ListLinksResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.ListLinksResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.ListLinksResponse 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.logging.v2.ListLinksResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.ListLinksResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.ListLinksResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.ListLinksResponse 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.logging.v2.ListLinksResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.ListLinksResponse 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.logging.v2.ListLinksResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.ListLinksResponse 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.logging.v2.ListLinksResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The response from ListLinks.
+   * 
+ * + * Protobuf type {@code google.logging.v2.ListLinksResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.ListLinksResponse) + com.google.logging.v2.ListLinksResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_ListLinksResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_ListLinksResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.ListLinksResponse.class, + com.google.logging.v2.ListLinksResponse.Builder.class); + } + + // Construct using com.google.logging.v2.ListLinksResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (linksBuilder_ == null) { + links_ = java.util.Collections.emptyList(); + } else { + links_ = null; + linksBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_ListLinksResponse_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.ListLinksResponse getDefaultInstanceForType() { + return com.google.logging.v2.ListLinksResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.ListLinksResponse build() { + com.google.logging.v2.ListLinksResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.ListLinksResponse buildPartial() { + com.google.logging.v2.ListLinksResponse result = + new com.google.logging.v2.ListLinksResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.logging.v2.ListLinksResponse result) { + if (linksBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + links_ = java.util.Collections.unmodifiableList(links_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.links_ = links_; + } else { + result.links_ = linksBuilder_.build(); + } + } + + private void buildPartial0(com.google.logging.v2.ListLinksResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @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.logging.v2.ListLinksResponse) { + return mergeFrom((com.google.logging.v2.ListLinksResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.ListLinksResponse other) { + if (other == com.google.logging.v2.ListLinksResponse.getDefaultInstance()) return this; + if (linksBuilder_ == null) { + if (!other.links_.isEmpty()) { + if (links_.isEmpty()) { + links_ = other.links_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureLinksIsMutable(); + links_.addAll(other.links_); + } + onChanged(); + } + } else { + if (!other.links_.isEmpty()) { + if (linksBuilder_.isEmpty()) { + linksBuilder_.dispose(); + linksBuilder_ = null; + links_ = other.links_; + bitField0_ = (bitField0_ & ~0x00000001); + linksBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getLinksFieldBuilder() + : null; + } else { + linksBuilder_.addAllMessages(other.links_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.logging.v2.Link m = + input.readMessage(com.google.logging.v2.Link.parser(), extensionRegistry); + if (linksBuilder_ == null) { + ensureLinksIsMutable(); + links_.add(m); + } else { + linksBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List links_ = java.util.Collections.emptyList(); + + private void ensureLinksIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + links_ = new java.util.ArrayList(links_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.logging.v2.Link, + com.google.logging.v2.Link.Builder, + com.google.logging.v2.LinkOrBuilder> + linksBuilder_; + + /** + * + * + *
+     * A list of links.
+     * 
+ * + * repeated .google.logging.v2.Link links = 1; + */ + public java.util.List getLinksList() { + if (linksBuilder_ == null) { + return java.util.Collections.unmodifiableList(links_); + } else { + return linksBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * A list of links.
+     * 
+ * + * repeated .google.logging.v2.Link links = 1; + */ + public int getLinksCount() { + if (linksBuilder_ == null) { + return links_.size(); + } else { + return linksBuilder_.getCount(); + } + } + + /** + * + * + *
+     * A list of links.
+     * 
+ * + * repeated .google.logging.v2.Link links = 1; + */ + public com.google.logging.v2.Link getLinks(int index) { + if (linksBuilder_ == null) { + return links_.get(index); + } else { + return linksBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * A list of links.
+     * 
+ * + * repeated .google.logging.v2.Link links = 1; + */ + public Builder setLinks(int index, com.google.logging.v2.Link value) { + if (linksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLinksIsMutable(); + links_.set(index, value); + onChanged(); + } else { + linksBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * A list of links.
+     * 
+ * + * repeated .google.logging.v2.Link links = 1; + */ + public Builder setLinks(int index, com.google.logging.v2.Link.Builder builderForValue) { + if (linksBuilder_ == null) { + ensureLinksIsMutable(); + links_.set(index, builderForValue.build()); + onChanged(); + } else { + linksBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of links.
+     * 
+ * + * repeated .google.logging.v2.Link links = 1; + */ + public Builder addLinks(com.google.logging.v2.Link value) { + if (linksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLinksIsMutable(); + links_.add(value); + onChanged(); + } else { + linksBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * A list of links.
+     * 
+ * + * repeated .google.logging.v2.Link links = 1; + */ + public Builder addLinks(int index, com.google.logging.v2.Link value) { + if (linksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLinksIsMutable(); + links_.add(index, value); + onChanged(); + } else { + linksBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * A list of links.
+     * 
+ * + * repeated .google.logging.v2.Link links = 1; + */ + public Builder addLinks(com.google.logging.v2.Link.Builder builderForValue) { + if (linksBuilder_ == null) { + ensureLinksIsMutable(); + links_.add(builderForValue.build()); + onChanged(); + } else { + linksBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of links.
+     * 
+ * + * repeated .google.logging.v2.Link links = 1; + */ + public Builder addLinks(int index, com.google.logging.v2.Link.Builder builderForValue) { + if (linksBuilder_ == null) { + ensureLinksIsMutable(); + links_.add(index, builderForValue.build()); + onChanged(); + } else { + linksBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of links.
+     * 
+ * + * repeated .google.logging.v2.Link links = 1; + */ + public Builder addAllLinks(java.lang.Iterable values) { + if (linksBuilder_ == null) { + ensureLinksIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, links_); + onChanged(); + } else { + linksBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * A list of links.
+     * 
+ * + * repeated .google.logging.v2.Link links = 1; + */ + public Builder clearLinks() { + if (linksBuilder_ == null) { + links_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + linksBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * A list of links.
+     * 
+ * + * repeated .google.logging.v2.Link links = 1; + */ + public Builder removeLinks(int index) { + if (linksBuilder_ == null) { + ensureLinksIsMutable(); + links_.remove(index); + onChanged(); + } else { + linksBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * A list of links.
+     * 
+ * + * repeated .google.logging.v2.Link links = 1; + */ + public com.google.logging.v2.Link.Builder getLinksBuilder(int index) { + return getLinksFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * A list of links.
+     * 
+ * + * repeated .google.logging.v2.Link links = 1; + */ + public com.google.logging.v2.LinkOrBuilder getLinksOrBuilder(int index) { + if (linksBuilder_ == null) { + return links_.get(index); + } else { + return linksBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * A list of links.
+     * 
+ * + * repeated .google.logging.v2.Link links = 1; + */ + public java.util.List getLinksOrBuilderList() { + if (linksBuilder_ != null) { + return linksBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(links_); + } + } + + /** + * + * + *
+     * A list of links.
+     * 
+ * + * repeated .google.logging.v2.Link links = 1; + */ + public com.google.logging.v2.Link.Builder addLinksBuilder() { + return getLinksFieldBuilder().addBuilder(com.google.logging.v2.Link.getDefaultInstance()); + } + + /** + * + * + *
+     * A list of links.
+     * 
+ * + * repeated .google.logging.v2.Link links = 1; + */ + public com.google.logging.v2.Link.Builder addLinksBuilder(int index) { + return getLinksFieldBuilder() + .addBuilder(index, com.google.logging.v2.Link.getDefaultInstance()); + } + + /** + * + * + *
+     * A list of links.
+     * 
+ * + * repeated .google.logging.v2.Link links = 1; + */ + public java.util.List getLinksBuilderList() { + return getLinksFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.logging.v2.Link, + com.google.logging.v2.Link.Builder, + com.google.logging.v2.LinkOrBuilder> + getLinksFieldBuilder() { + if (linksBuilder_ == null) { + linksBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.logging.v2.Link, + com.google.logging.v2.Link.Builder, + com.google.logging.v2.LinkOrBuilder>( + links_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + links_ = null; + } + return linksBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+     * If there might be more results than those appearing in this response, then
+     * `nextPageToken` is included. To get the next set of results, call the same
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * If there might be more results than those appearing in this response, then
+     * `nextPageToken` is included. To get the next set of results, call the same
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * If there might be more results than those appearing in this response, then
+     * `nextPageToken` is included. To get the next set of results, call the same
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * If there might be more results than those appearing in this response, then
+     * `nextPageToken` is included. To get the next set of results, call the same
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * If there might be more results than those appearing in this response, then
+     * `nextPageToken` is included. To get the next set of results, call the same
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextPageToken_ = value; + bitField0_ |= 0x00000002; + 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.logging.v2.ListLinksResponse) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.ListLinksResponse) + private static final com.google.logging.v2.ListLinksResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.ListLinksResponse(); + } + + public static com.google.logging.v2.ListLinksResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListLinksResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.ListLinksResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLinksResponseOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLinksResponseOrBuilder.java new file mode 100644 index 000000000000..19945b209041 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLinksResponseOrBuilder.java @@ -0,0 +1,111 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface ListLinksResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.ListLinksResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A list of links.
+   * 
+ * + * repeated .google.logging.v2.Link links = 1; + */ + java.util.List getLinksList(); + + /** + * + * + *
+   * A list of links.
+   * 
+ * + * repeated .google.logging.v2.Link links = 1; + */ + com.google.logging.v2.Link getLinks(int index); + + /** + * + * + *
+   * A list of links.
+   * 
+ * + * repeated .google.logging.v2.Link links = 1; + */ + int getLinksCount(); + + /** + * + * + *
+   * A list of links.
+   * 
+ * + * repeated .google.logging.v2.Link links = 1; + */ + java.util.List getLinksOrBuilderList(); + + /** + * + * + *
+   * A list of links.
+   * 
+ * + * repeated .google.logging.v2.Link links = 1; + */ + com.google.logging.v2.LinkOrBuilder getLinksOrBuilder(int index); + + /** + * + * + *
+   * If there might be more results than those appearing in this response, then
+   * `nextPageToken` is included. To get the next set of results, call the same
+   * method again using the value of `nextPageToken` as `pageToken`.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
+   * If there might be more results than those appearing in this response, then
+   * `nextPageToken` is included. To get the next set of results, call the same
+   * method again using the value of `nextPageToken` as `pageToken`.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogEntriesRequest.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogEntriesRequest.java new file mode 100644 index 000000000000..199fba2e45ca --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogEntriesRequest.java @@ -0,0 +1,1728 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * The parameters to `ListLogEntries`.
+ * 
+ * + * Protobuf type {@code google.logging.v2.ListLogEntriesRequest} + */ +public final class ListLogEntriesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.ListLogEntriesRequest) + ListLogEntriesRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ListLogEntriesRequest.newBuilder() to construct. + private ListLogEntriesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListLogEntriesRequest() { + resourceNames_ = com.google.protobuf.LazyStringArrayList.emptyList(); + filter_ = ""; + orderBy_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListLogEntriesRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_ListLogEntriesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_ListLogEntriesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.ListLogEntriesRequest.class, + com.google.logging.v2.ListLogEntriesRequest.Builder.class); + } + + public static final int RESOURCE_NAMES_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList resourceNames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+   * Required. Names of one or more parent resources from which to
+   * retrieve log entries:
+   *
+   * *  `projects/[PROJECT_ID]`
+   * *  `organizations/[ORGANIZATION_ID]`
+   * *  `billingAccounts/[BILLING_ACCOUNT_ID]`
+   * *  `folders/[FOLDER_ID]`
+   *
+   * May alternatively be one or more views:
+   *
+   *  * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *
+   * Projects listed in the `project_ids` field are added to this list.
+   * A maximum of 100 resources may be specified in a single request.
+   * 
+ * + * + * repeated string resource_names = 8 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return A list containing the resourceNames. + */ + public com.google.protobuf.ProtocolStringList getResourceNamesList() { + return resourceNames_; + } + + /** + * + * + *
+   * Required. Names of one or more parent resources from which to
+   * retrieve log entries:
+   *
+   * *  `projects/[PROJECT_ID]`
+   * *  `organizations/[ORGANIZATION_ID]`
+   * *  `billingAccounts/[BILLING_ACCOUNT_ID]`
+   * *  `folders/[FOLDER_ID]`
+   *
+   * May alternatively be one or more views:
+   *
+   *  * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *
+   * Projects listed in the `project_ids` field are added to this list.
+   * A maximum of 100 resources may be specified in a single request.
+   * 
+ * + * + * repeated string resource_names = 8 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The count of resourceNames. + */ + public int getResourceNamesCount() { + return resourceNames_.size(); + } + + /** + * + * + *
+   * Required. Names of one or more parent resources from which to
+   * retrieve log entries:
+   *
+   * *  `projects/[PROJECT_ID]`
+   * *  `organizations/[ORGANIZATION_ID]`
+   * *  `billingAccounts/[BILLING_ACCOUNT_ID]`
+   * *  `folders/[FOLDER_ID]`
+   *
+   * May alternatively be one or more views:
+   *
+   *  * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *
+   * Projects listed in the `project_ids` field are added to this list.
+   * A maximum of 100 resources may be specified in a single request.
+   * 
+ * + * + * repeated string resource_names = 8 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the element to return. + * @return The resourceNames at the given index. + */ + public java.lang.String getResourceNames(int index) { + return resourceNames_.get(index); + } + + /** + * + * + *
+   * Required. Names of one or more parent resources from which to
+   * retrieve log entries:
+   *
+   * *  `projects/[PROJECT_ID]`
+   * *  `organizations/[ORGANIZATION_ID]`
+   * *  `billingAccounts/[BILLING_ACCOUNT_ID]`
+   * *  `folders/[FOLDER_ID]`
+   *
+   * May alternatively be one or more views:
+   *
+   *  * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *
+   * Projects listed in the `project_ids` field are added to this list.
+   * A maximum of 100 resources may be specified in a single request.
+   * 
+ * + * + * repeated string resource_names = 8 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the value to return. + * @return The bytes of the resourceNames at the given index. + */ + public com.google.protobuf.ByteString getResourceNamesBytes(int index) { + return resourceNames_.getByteString(index); + } + + public static final int FILTER_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + + /** + * + * + *
+   * Optional. Only log entries that match the filter are returned.  An empty
+   * filter matches all log entries in the resources listed in `resource_names`.
+   * Referencing a parent resource that is not listed in `resource_names` will
+   * cause the filter to return no results. The maximum length of a filter is
+   * 20,000 characters.
+   * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. Only log entries that match the filter are returned.  An empty
+   * filter matches all log entries in the resources listed in `resource_names`.
+   * Referencing a parent resource that is not listed in `resource_names` will
+   * cause the filter to return no results. The maximum length of a filter is
+   * 20,000 characters.
+   * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORDER_BY_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object orderBy_ = ""; + + /** + * + * + *
+   * Optional. How the results should be sorted.  Presently, the only permitted
+   * values are `"timestamp asc"` (default) and `"timestamp desc"`. The first
+   * option returns entries in order of increasing values of
+   * `LogEntry.timestamp` (oldest first), and the second option returns entries
+   * in order of decreasing timestamps (newest first).  Entries with equal
+   * timestamps are returned in order of their `insert_id` values.
+   * 
+ * + * string order_by = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + @java.lang.Override + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + 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(); + orderBy_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. How the results should be sorted.  Presently, the only permitted
+   * values are `"timestamp asc"` (default) and `"timestamp desc"`. The first
+   * option returns entries in order of increasing values of
+   * `LogEntry.timestamp` (oldest first), and the second option returns entries
+   * in order of decreasing timestamps (newest first).  Entries with equal
+   * timestamps are returned in order of their `insert_id` values.
+   * 
+ * + * string order_by = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 4; + private int pageSize_ = 0; + + /** + * + * + *
+   * Optional. The maximum number of results to return from this request.
+   * Default is 50. If the value is negative or exceeds 1000, the request is
+   * rejected. The presence of `next_page_token` in the response indicates that
+   * more results might be available.
+   * 
+ * + * int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + + /** + * + * + *
+   * Optional. If present, then retrieve the next batch of results from the
+   * preceding call to this method.  `page_token` must be the value of
+   * `next_page_token` from the previous response.  The values of other method
+   * parameters should be identical to those in the previous call.
+   * 
+ * + * string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. If present, then retrieve the next batch of results from the
+   * preceding call to this method.  `page_token` must be the value of
+   * `next_page_token` from the previous response.  The values of other method
+   * parameters should be identical to those in the previous call.
+   * 
+ * + * string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, orderBy_); + } + if (pageSize_ != 0) { + output.writeInt32(4, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, pageToken_); + } + for (int i = 0; i < resourceNames_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, resourceNames_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, orderBy_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, pageToken_); + } + { + int dataSize = 0; + for (int i = 0; i < resourceNames_.size(); i++) { + dataSize += computeStringSizeNoTag(resourceNames_.getRaw(i)); + } + size += dataSize; + size += 1 * getResourceNamesList().size(); + } + size += getUnknownFields().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.logging.v2.ListLogEntriesRequest)) { + return super.equals(obj); + } + com.google.logging.v2.ListLogEntriesRequest other = + (com.google.logging.v2.ListLogEntriesRequest) obj; + + if (!getResourceNamesList().equals(other.getResourceNamesList())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getOrderBy().equals(other.getOrderBy())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getResourceNamesCount() > 0) { + hash = (37 * hash) + RESOURCE_NAMES_FIELD_NUMBER; + hash = (53 * hash) + getResourceNamesList().hashCode(); + } + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.ListLogEntriesRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.ListLogEntriesRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.ListLogEntriesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.ListLogEntriesRequest 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.logging.v2.ListLogEntriesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.ListLogEntriesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.ListLogEntriesRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.ListLogEntriesRequest 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.logging.v2.ListLogEntriesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.ListLogEntriesRequest 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.logging.v2.ListLogEntriesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.ListLogEntriesRequest 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.logging.v2.ListLogEntriesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The parameters to `ListLogEntries`.
+   * 
+ * + * Protobuf type {@code google.logging.v2.ListLogEntriesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.ListLogEntriesRequest) + com.google.logging.v2.ListLogEntriesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_ListLogEntriesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_ListLogEntriesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.ListLogEntriesRequest.class, + com.google.logging.v2.ListLogEntriesRequest.Builder.class); + } + + // Construct using com.google.logging.v2.ListLogEntriesRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + resourceNames_ = com.google.protobuf.LazyStringArrayList.emptyList(); + filter_ = ""; + orderBy_ = ""; + pageSize_ = 0; + pageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_ListLogEntriesRequest_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.ListLogEntriesRequest getDefaultInstanceForType() { + return com.google.logging.v2.ListLogEntriesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.ListLogEntriesRequest build() { + com.google.logging.v2.ListLogEntriesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.ListLogEntriesRequest buildPartial() { + com.google.logging.v2.ListLogEntriesRequest result = + new com.google.logging.v2.ListLogEntriesRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.logging.v2.ListLogEntriesRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + resourceNames_.makeImmutable(); + result.resourceNames_ = resourceNames_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.filter_ = filter_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.orderBy_ = orderBy_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.pageToken_ = pageToken_; + } + } + + @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.logging.v2.ListLogEntriesRequest) { + return mergeFrom((com.google.logging.v2.ListLogEntriesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.ListLogEntriesRequest other) { + if (other == com.google.logging.v2.ListLogEntriesRequest.getDefaultInstance()) return this; + if (!other.resourceNames_.isEmpty()) { + if (resourceNames_.isEmpty()) { + resourceNames_ = other.resourceNames_; + bitField0_ |= 0x00000001; + } else { + ensureResourceNamesIsMutable(); + resourceNames_.addAll(other.resourceNames_); + } + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000010; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 18: + { + filter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + orderBy_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 42: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureResourceNamesIsMutable(); + resourceNames_.add(s); + break; + } // case 66 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringArrayList resourceNames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureResourceNamesIsMutable() { + if (!resourceNames_.isModifiable()) { + resourceNames_ = new com.google.protobuf.LazyStringArrayList(resourceNames_); + } + bitField0_ |= 0x00000001; + } + + /** + * + * + *
+     * Required. Names of one or more parent resources from which to
+     * retrieve log entries:
+     *
+     * *  `projects/[PROJECT_ID]`
+     * *  `organizations/[ORGANIZATION_ID]`
+     * *  `billingAccounts/[BILLING_ACCOUNT_ID]`
+     * *  `folders/[FOLDER_ID]`
+     *
+     * May alternatively be one or more views:
+     *
+     *  * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *
+     * Projects listed in the `project_ids` field are added to this list.
+     * A maximum of 100 resources may be specified in a single request.
+     * 
+ * + * + * repeated string resource_names = 8 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return A list containing the resourceNames. + */ + public com.google.protobuf.ProtocolStringList getResourceNamesList() { + resourceNames_.makeImmutable(); + return resourceNames_; + } + + /** + * + * + *
+     * Required. Names of one or more parent resources from which to
+     * retrieve log entries:
+     *
+     * *  `projects/[PROJECT_ID]`
+     * *  `organizations/[ORGANIZATION_ID]`
+     * *  `billingAccounts/[BILLING_ACCOUNT_ID]`
+     * *  `folders/[FOLDER_ID]`
+     *
+     * May alternatively be one or more views:
+     *
+     *  * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *
+     * Projects listed in the `project_ids` field are added to this list.
+     * A maximum of 100 resources may be specified in a single request.
+     * 
+ * + * + * repeated string resource_names = 8 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The count of resourceNames. + */ + public int getResourceNamesCount() { + return resourceNames_.size(); + } + + /** + * + * + *
+     * Required. Names of one or more parent resources from which to
+     * retrieve log entries:
+     *
+     * *  `projects/[PROJECT_ID]`
+     * *  `organizations/[ORGANIZATION_ID]`
+     * *  `billingAccounts/[BILLING_ACCOUNT_ID]`
+     * *  `folders/[FOLDER_ID]`
+     *
+     * May alternatively be one or more views:
+     *
+     *  * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *
+     * Projects listed in the `project_ids` field are added to this list.
+     * A maximum of 100 resources may be specified in a single request.
+     * 
+ * + * + * repeated string resource_names = 8 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the element to return. + * @return The resourceNames at the given index. + */ + public java.lang.String getResourceNames(int index) { + return resourceNames_.get(index); + } + + /** + * + * + *
+     * Required. Names of one or more parent resources from which to
+     * retrieve log entries:
+     *
+     * *  `projects/[PROJECT_ID]`
+     * *  `organizations/[ORGANIZATION_ID]`
+     * *  `billingAccounts/[BILLING_ACCOUNT_ID]`
+     * *  `folders/[FOLDER_ID]`
+     *
+     * May alternatively be one or more views:
+     *
+     *  * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *
+     * Projects listed in the `project_ids` field are added to this list.
+     * A maximum of 100 resources may be specified in a single request.
+     * 
+ * + * + * repeated string resource_names = 8 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the value to return. + * @return The bytes of the resourceNames at the given index. + */ + public com.google.protobuf.ByteString getResourceNamesBytes(int index) { + return resourceNames_.getByteString(index); + } + + /** + * + * + *
+     * Required. Names of one or more parent resources from which to
+     * retrieve log entries:
+     *
+     * *  `projects/[PROJECT_ID]`
+     * *  `organizations/[ORGANIZATION_ID]`
+     * *  `billingAccounts/[BILLING_ACCOUNT_ID]`
+     * *  `folders/[FOLDER_ID]`
+     *
+     * May alternatively be one or more views:
+     *
+     *  * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *
+     * Projects listed in the `project_ids` field are added to this list.
+     * A maximum of 100 resources may be specified in a single request.
+     * 
+ * + * + * repeated string resource_names = 8 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param index The index to set the value at. + * @param value The resourceNames to set. + * @return This builder for chaining. + */ + public Builder setResourceNames(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureResourceNamesIsMutable(); + resourceNames_.set(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Names of one or more parent resources from which to
+     * retrieve log entries:
+     *
+     * *  `projects/[PROJECT_ID]`
+     * *  `organizations/[ORGANIZATION_ID]`
+     * *  `billingAccounts/[BILLING_ACCOUNT_ID]`
+     * *  `folders/[FOLDER_ID]`
+     *
+     * May alternatively be one or more views:
+     *
+     *  * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *
+     * Projects listed in the `project_ids` field are added to this list.
+     * A maximum of 100 resources may be specified in a single request.
+     * 
+ * + * + * repeated string resource_names = 8 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The resourceNames to add. + * @return This builder for chaining. + */ + public Builder addResourceNames(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureResourceNamesIsMutable(); + resourceNames_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Names of one or more parent resources from which to
+     * retrieve log entries:
+     *
+     * *  `projects/[PROJECT_ID]`
+     * *  `organizations/[ORGANIZATION_ID]`
+     * *  `billingAccounts/[BILLING_ACCOUNT_ID]`
+     * *  `folders/[FOLDER_ID]`
+     *
+     * May alternatively be one or more views:
+     *
+     *  * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *
+     * Projects listed in the `project_ids` field are added to this list.
+     * A maximum of 100 resources may be specified in a single request.
+     * 
+ * + * + * repeated string resource_names = 8 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param values The resourceNames to add. + * @return This builder for chaining. + */ + public Builder addAllResourceNames(java.lang.Iterable values) { + ensureResourceNamesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, resourceNames_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Names of one or more parent resources from which to
+     * retrieve log entries:
+     *
+     * *  `projects/[PROJECT_ID]`
+     * *  `organizations/[ORGANIZATION_ID]`
+     * *  `billingAccounts/[BILLING_ACCOUNT_ID]`
+     * *  `folders/[FOLDER_ID]`
+     *
+     * May alternatively be one or more views:
+     *
+     *  * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *
+     * Projects listed in the `project_ids` field are added to this list.
+     * A maximum of 100 resources may be specified in a single request.
+     * 
+ * + * + * repeated string resource_names = 8 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearResourceNames() { + resourceNames_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + ; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Names of one or more parent resources from which to
+     * retrieve log entries:
+     *
+     * *  `projects/[PROJECT_ID]`
+     * *  `organizations/[ORGANIZATION_ID]`
+     * *  `billingAccounts/[BILLING_ACCOUNT_ID]`
+     * *  `folders/[FOLDER_ID]`
+     *
+     * May alternatively be one or more views:
+     *
+     *  * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *
+     * Projects listed in the `project_ids` field are added to this list.
+     * A maximum of 100 resources may be specified in a single request.
+     * 
+ * + * + * repeated string resource_names = 8 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes of the resourceNames to add. + * @return This builder for chaining. + */ + public Builder addResourceNamesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureResourceNamesIsMutable(); + resourceNames_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + + /** + * + * + *
+     * Optional. Only log entries that match the filter are returned.  An empty
+     * filter matches all log entries in the resources listed in `resource_names`.
+     * Referencing a parent resource that is not listed in `resource_names` will
+     * cause the filter to return no results. The maximum length of a filter is
+     * 20,000 characters.
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. Only log entries that match the filter are returned.  An empty
+     * filter matches all log entries in the resources listed in `resource_names`.
+     * Referencing a parent resource that is not listed in `resource_names` will
+     * cause the filter to return no results. The maximum length of a filter is
+     * 20,000 characters.
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. Only log entries that match the filter are returned.  An empty
+     * filter matches all log entries in the resources listed in `resource_names`.
+     * Referencing a parent resource that is not listed in `resource_names` will
+     * cause the filter to return no results. The maximum length of a filter is
+     * 20,000 characters.
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Only log entries that match the filter are returned.  An empty
+     * filter matches all log entries in the resources listed in `resource_names`.
+     * Referencing a parent resource that is not listed in `resource_names` will
+     * cause the filter to return no results. The maximum length of a filter is
+     * 20,000 characters.
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Only log entries that match the filter are returned.  An empty
+     * filter matches all log entries in the resources listed in `resource_names`.
+     * Referencing a parent resource that is not listed in `resource_names` will
+     * cause the filter to return no results. The maximum length of a filter is
+     * 20,000 characters.
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + filter_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + + /** + * + * + *
+     * Optional. How the results should be sorted.  Presently, the only permitted
+     * values are `"timestamp asc"` (default) and `"timestamp desc"`. The first
+     * option returns entries in order of increasing values of
+     * `LogEntry.timestamp` (oldest first), and the second option returns entries
+     * in order of decreasing timestamps (newest first).  Entries with equal
+     * timestamps are returned in order of their `insert_id` values.
+     * 
+ * + * string order_by = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. How the results should be sorted.  Presently, the only permitted
+     * values are `"timestamp asc"` (default) and `"timestamp desc"`. The first
+     * option returns entries in order of increasing values of
+     * `LogEntry.timestamp` (oldest first), and the second option returns entries
+     * in order of decreasing timestamps (newest first).  Entries with equal
+     * timestamps are returned in order of their `insert_id` values.
+     * 
+ * + * string order_by = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. How the results should be sorted.  Presently, the only permitted
+     * values are `"timestamp asc"` (default) and `"timestamp desc"`. The first
+     * option returns entries in order of increasing values of
+     * `LogEntry.timestamp` (oldest first), and the second option returns entries
+     * in order of decreasing timestamps (newest first).  Entries with equal
+     * timestamps are returned in order of their `insert_id` values.
+     * 
+ * + * string order_by = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + orderBy_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. How the results should be sorted.  Presently, the only permitted
+     * values are `"timestamp asc"` (default) and `"timestamp desc"`. The first
+     * option returns entries in order of increasing values of
+     * `LogEntry.timestamp` (oldest first), and the second option returns entries
+     * in order of decreasing timestamps (newest first).  Entries with equal
+     * timestamps are returned in order of their `insert_id` values.
+     * 
+ * + * string order_by = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + orderBy_ = getDefaultInstance().getOrderBy(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. How the results should be sorted.  Presently, the only permitted
+     * values are `"timestamp asc"` (default) and `"timestamp desc"`. The first
+     * option returns entries in order of increasing values of
+     * `LogEntry.timestamp` (oldest first), and the second option returns entries
+     * in order of decreasing timestamps (newest first).  Entries with equal
+     * timestamps are returned in order of their `insert_id` values.
+     * 
+ * + * string order_by = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + orderBy_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private int pageSize_; + + /** + * + * + *
+     * Optional. The maximum number of results to return from this request.
+     * Default is 50. If the value is negative or exceeds 1000, the request is
+     * rejected. The presence of `next_page_token` in the response indicates that
+     * more results might be available.
+     * 
+ * + * int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + /** + * + * + *
+     * Optional. The maximum number of results to return from this request.
+     * Default is 50. If the value is negative or exceeds 1000, the request is
+     * rejected. The presence of `next_page_token` in the response indicates that
+     * more results might be available.
+     * 
+ * + * int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The maximum number of results to return from this request.
+     * Default is 50. If the value is negative or exceeds 1000, the request is
+     * rejected. The presence of `next_page_token` in the response indicates that
+     * more results might be available.
+     * 
+ * + * int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000008); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method.  `page_token` must be the value of
+     * `next_page_token` from the previous response.  The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method.  `page_token` must be the value of
+     * `next_page_token` from the previous response.  The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method.  `page_token` must be the value of
+     * `next_page_token` from the previous response.  The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method.  `page_token` must be the value of
+     * `next_page_token` from the previous response.  The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method.  `page_token` must be the value of
+     * `next_page_token` from the previous response.  The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000010; + 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.logging.v2.ListLogEntriesRequest) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.ListLogEntriesRequest) + private static final com.google.logging.v2.ListLogEntriesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.ListLogEntriesRequest(); + } + + public static com.google.logging.v2.ListLogEntriesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListLogEntriesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.ListLogEntriesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogEntriesRequestOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogEntriesRequestOrBuilder.java new file mode 100644 index 000000000000..7abbf51e79a1 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogEntriesRequestOrBuilder.java @@ -0,0 +1,270 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface ListLogEntriesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.ListLogEntriesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Names of one or more parent resources from which to
+   * retrieve log entries:
+   *
+   * *  `projects/[PROJECT_ID]`
+   * *  `organizations/[ORGANIZATION_ID]`
+   * *  `billingAccounts/[BILLING_ACCOUNT_ID]`
+   * *  `folders/[FOLDER_ID]`
+   *
+   * May alternatively be one or more views:
+   *
+   *  * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *
+   * Projects listed in the `project_ids` field are added to this list.
+   * A maximum of 100 resources may be specified in a single request.
+   * 
+ * + * + * repeated string resource_names = 8 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return A list containing the resourceNames. + */ + java.util.List getResourceNamesList(); + + /** + * + * + *
+   * Required. Names of one or more parent resources from which to
+   * retrieve log entries:
+   *
+   * *  `projects/[PROJECT_ID]`
+   * *  `organizations/[ORGANIZATION_ID]`
+   * *  `billingAccounts/[BILLING_ACCOUNT_ID]`
+   * *  `folders/[FOLDER_ID]`
+   *
+   * May alternatively be one or more views:
+   *
+   *  * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *
+   * Projects listed in the `project_ids` field are added to this list.
+   * A maximum of 100 resources may be specified in a single request.
+   * 
+ * + * + * repeated string resource_names = 8 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The count of resourceNames. + */ + int getResourceNamesCount(); + + /** + * + * + *
+   * Required. Names of one or more parent resources from which to
+   * retrieve log entries:
+   *
+   * *  `projects/[PROJECT_ID]`
+   * *  `organizations/[ORGANIZATION_ID]`
+   * *  `billingAccounts/[BILLING_ACCOUNT_ID]`
+   * *  `folders/[FOLDER_ID]`
+   *
+   * May alternatively be one or more views:
+   *
+   *  * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *
+   * Projects listed in the `project_ids` field are added to this list.
+   * A maximum of 100 resources may be specified in a single request.
+   * 
+ * + * + * repeated string resource_names = 8 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the element to return. + * @return The resourceNames at the given index. + */ + java.lang.String getResourceNames(int index); + + /** + * + * + *
+   * Required. Names of one or more parent resources from which to
+   * retrieve log entries:
+   *
+   * *  `projects/[PROJECT_ID]`
+   * *  `organizations/[ORGANIZATION_ID]`
+   * *  `billingAccounts/[BILLING_ACCOUNT_ID]`
+   * *  `folders/[FOLDER_ID]`
+   *
+   * May alternatively be one or more views:
+   *
+   *  * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *
+   * Projects listed in the `project_ids` field are added to this list.
+   * A maximum of 100 resources may be specified in a single request.
+   * 
+ * + * + * repeated string resource_names = 8 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the value to return. + * @return The bytes of the resourceNames at the given index. + */ + com.google.protobuf.ByteString getResourceNamesBytes(int index); + + /** + * + * + *
+   * Optional. Only log entries that match the filter are returned.  An empty
+   * filter matches all log entries in the resources listed in `resource_names`.
+   * Referencing a parent resource that is not listed in `resource_names` will
+   * cause the filter to return no results. The maximum length of a filter is
+   * 20,000 characters.
+   * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + java.lang.String getFilter(); + + /** + * + * + *
+   * Optional. Only log entries that match the filter are returned.  An empty
+   * filter matches all log entries in the resources listed in `resource_names`.
+   * Referencing a parent resource that is not listed in `resource_names` will
+   * cause the filter to return no results. The maximum length of a filter is
+   * 20,000 characters.
+   * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Optional. How the results should be sorted.  Presently, the only permitted
+   * values are `"timestamp asc"` (default) and `"timestamp desc"`. The first
+   * option returns entries in order of increasing values of
+   * `LogEntry.timestamp` (oldest first), and the second option returns entries
+   * in order of decreasing timestamps (newest first).  Entries with equal
+   * timestamps are returned in order of their `insert_id` values.
+   * 
+ * + * string order_by = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + + /** + * + * + *
+   * Optional. How the results should be sorted.  Presently, the only permitted
+   * values are `"timestamp asc"` (default) and `"timestamp desc"`. The first
+   * option returns entries in order of increasing values of
+   * `LogEntry.timestamp` (oldest first), and the second option returns entries
+   * in order of decreasing timestamps (newest first).  Entries with equal
+   * timestamps are returned in order of their `insert_id` values.
+   * 
+ * + * string order_by = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); + + /** + * + * + *
+   * Optional. The maximum number of results to return from this request.
+   * Default is 50. If the value is negative or exceeds 1000, the request is
+   * rejected. The presence of `next_page_token` in the response indicates that
+   * more results might be available.
+   * 
+ * + * int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. If present, then retrieve the next batch of results from the
+   * preceding call to this method.  `page_token` must be the value of
+   * `next_page_token` from the previous response.  The values of other method
+   * parameters should be identical to those in the previous call.
+   * 
+ * + * string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
+   * Optional. If present, then retrieve the next batch of results from the
+   * preceding call to this method.  `page_token` must be the value of
+   * `next_page_token` from the previous response.  The values of other method
+   * parameters should be identical to those in the previous call.
+   * 
+ * + * string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogEntriesResponse.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogEntriesResponse.java new file mode 100644 index 000000000000..bccb09fa87f0 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogEntriesResponse.java @@ -0,0 +1,1252 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * Result returned from `ListLogEntries`.
+ * 
+ * + * Protobuf type {@code google.logging.v2.ListLogEntriesResponse} + */ +public final class ListLogEntriesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.ListLogEntriesResponse) + ListLogEntriesResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ListLogEntriesResponse.newBuilder() to construct. + private ListLogEntriesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListLogEntriesResponse() { + entries_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListLogEntriesResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_ListLogEntriesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_ListLogEntriesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.ListLogEntriesResponse.class, + com.google.logging.v2.ListLogEntriesResponse.Builder.class); + } + + public static final int ENTRIES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List entries_; + + /** + * + * + *
+   * A list of log entries.  If `entries` is empty, `nextPageToken` may still be
+   * returned, indicating that more entries may exist.  See `nextPageToken` for
+   * more information.
+   * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + @java.lang.Override + public java.util.List getEntriesList() { + return entries_; + } + + /** + * + * + *
+   * A list of log entries.  If `entries` is empty, `nextPageToken` may still be
+   * returned, indicating that more entries may exist.  See `nextPageToken` for
+   * more information.
+   * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + @java.lang.Override + public java.util.List + getEntriesOrBuilderList() { + return entries_; + } + + /** + * + * + *
+   * A list of log entries.  If `entries` is empty, `nextPageToken` may still be
+   * returned, indicating that more entries may exist.  See `nextPageToken` for
+   * more information.
+   * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + @java.lang.Override + public int getEntriesCount() { + return entries_.size(); + } + + /** + * + * + *
+   * A list of log entries.  If `entries` is empty, `nextPageToken` may still be
+   * returned, indicating that more entries may exist.  See `nextPageToken` for
+   * more information.
+   * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + @java.lang.Override + public com.google.logging.v2.LogEntry getEntries(int index) { + return entries_.get(index); + } + + /** + * + * + *
+   * A list of log entries.  If `entries` is empty, `nextPageToken` may still be
+   * returned, indicating that more entries may exist.  See `nextPageToken` for
+   * more information.
+   * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + @java.lang.Override + public com.google.logging.v2.LogEntryOrBuilder getEntriesOrBuilder(int index) { + return entries_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+   * If there might be more results than those appearing in this response, then
+   * `nextPageToken` is included.  To get the next set of results, call this
+   * method again using the value of `nextPageToken` as `pageToken`.
+   *
+   * If a value for `next_page_token` appears and the `entries` field is empty,
+   * it means that the search found no log entries so far but it did not have
+   * time to search all the possible log entries.  Retry the method with this
+   * value for `page_token` to continue the search.  Alternatively, consider
+   * speeding up the search by changing your filter to specify a single log name
+   * or resource type, or to narrow the time range of the search.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * If there might be more results than those appearing in this response, then
+   * `nextPageToken` is included.  To get the next set of results, call this
+   * method again using the value of `nextPageToken` as `pageToken`.
+   *
+   * If a value for `next_page_token` appears and the `entries` field is empty,
+   * it means that the search found no log entries so far but it did not have
+   * time to search all the possible log entries.  Retry the method with this
+   * value for `page_token` to continue the search.  Alternatively, consider
+   * speeding up the search by changing your filter to specify a single log name
+   * or resource type, or to narrow the time range of the search.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < entries_.size(); i++) { + output.writeMessage(1, entries_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < entries_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, entries_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += getUnknownFields().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.logging.v2.ListLogEntriesResponse)) { + return super.equals(obj); + } + com.google.logging.v2.ListLogEntriesResponse other = + (com.google.logging.v2.ListLogEntriesResponse) obj; + + if (!getEntriesList().equals(other.getEntriesList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getEntriesCount() > 0) { + hash = (37 * hash) + ENTRIES_FIELD_NUMBER; + hash = (53 * hash) + getEntriesList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.ListLogEntriesResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.ListLogEntriesResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.ListLogEntriesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.ListLogEntriesResponse 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.logging.v2.ListLogEntriesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.ListLogEntriesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.ListLogEntriesResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.ListLogEntriesResponse 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.logging.v2.ListLogEntriesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.ListLogEntriesResponse 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.logging.v2.ListLogEntriesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.ListLogEntriesResponse 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.logging.v2.ListLogEntriesResponse 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; + } + + /** + * + * + *
+   * Result returned from `ListLogEntries`.
+   * 
+ * + * Protobuf type {@code google.logging.v2.ListLogEntriesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.ListLogEntriesResponse) + com.google.logging.v2.ListLogEntriesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_ListLogEntriesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_ListLogEntriesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.ListLogEntriesResponse.class, + com.google.logging.v2.ListLogEntriesResponse.Builder.class); + } + + // Construct using com.google.logging.v2.ListLogEntriesResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (entriesBuilder_ == null) { + entries_ = java.util.Collections.emptyList(); + } else { + entries_ = null; + entriesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_ListLogEntriesResponse_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.ListLogEntriesResponse getDefaultInstanceForType() { + return com.google.logging.v2.ListLogEntriesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.ListLogEntriesResponse build() { + com.google.logging.v2.ListLogEntriesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.ListLogEntriesResponse buildPartial() { + com.google.logging.v2.ListLogEntriesResponse result = + new com.google.logging.v2.ListLogEntriesResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.logging.v2.ListLogEntriesResponse result) { + if (entriesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + entries_ = java.util.Collections.unmodifiableList(entries_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.entries_ = entries_; + } else { + result.entries_ = entriesBuilder_.build(); + } + } + + private void buildPartial0(com.google.logging.v2.ListLogEntriesResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @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.logging.v2.ListLogEntriesResponse) { + return mergeFrom((com.google.logging.v2.ListLogEntriesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.ListLogEntriesResponse other) { + if (other == com.google.logging.v2.ListLogEntriesResponse.getDefaultInstance()) return this; + if (entriesBuilder_ == null) { + if (!other.entries_.isEmpty()) { + if (entries_.isEmpty()) { + entries_ = other.entries_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureEntriesIsMutable(); + entries_.addAll(other.entries_); + } + onChanged(); + } + } else { + if (!other.entries_.isEmpty()) { + if (entriesBuilder_.isEmpty()) { + entriesBuilder_.dispose(); + entriesBuilder_ = null; + entries_ = other.entries_; + bitField0_ = (bitField0_ & ~0x00000001); + entriesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getEntriesFieldBuilder() + : null; + } else { + entriesBuilder_.addAllMessages(other.entries_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.logging.v2.LogEntry m = + input.readMessage(com.google.logging.v2.LogEntry.parser(), extensionRegistry); + if (entriesBuilder_ == null) { + ensureEntriesIsMutable(); + entries_.add(m); + } else { + entriesBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List entries_ = + java.util.Collections.emptyList(); + + private void ensureEntriesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + entries_ = new java.util.ArrayList(entries_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.logging.v2.LogEntry, + com.google.logging.v2.LogEntry.Builder, + com.google.logging.v2.LogEntryOrBuilder> + entriesBuilder_; + + /** + * + * + *
+     * A list of log entries.  If `entries` is empty, `nextPageToken` may still be
+     * returned, indicating that more entries may exist.  See `nextPageToken` for
+     * more information.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + public java.util.List getEntriesList() { + if (entriesBuilder_ == null) { + return java.util.Collections.unmodifiableList(entries_); + } else { + return entriesBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * A list of log entries.  If `entries` is empty, `nextPageToken` may still be
+     * returned, indicating that more entries may exist.  See `nextPageToken` for
+     * more information.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + public int getEntriesCount() { + if (entriesBuilder_ == null) { + return entries_.size(); + } else { + return entriesBuilder_.getCount(); + } + } + + /** + * + * + *
+     * A list of log entries.  If `entries` is empty, `nextPageToken` may still be
+     * returned, indicating that more entries may exist.  See `nextPageToken` for
+     * more information.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + public com.google.logging.v2.LogEntry getEntries(int index) { + if (entriesBuilder_ == null) { + return entries_.get(index); + } else { + return entriesBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * A list of log entries.  If `entries` is empty, `nextPageToken` may still be
+     * returned, indicating that more entries may exist.  See `nextPageToken` for
+     * more information.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + public Builder setEntries(int index, com.google.logging.v2.LogEntry value) { + if (entriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEntriesIsMutable(); + entries_.set(index, value); + onChanged(); + } else { + entriesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * A list of log entries.  If `entries` is empty, `nextPageToken` may still be
+     * returned, indicating that more entries may exist.  See `nextPageToken` for
+     * more information.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + public Builder setEntries(int index, com.google.logging.v2.LogEntry.Builder builderForValue) { + if (entriesBuilder_ == null) { + ensureEntriesIsMutable(); + entries_.set(index, builderForValue.build()); + onChanged(); + } else { + entriesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of log entries.  If `entries` is empty, `nextPageToken` may still be
+     * returned, indicating that more entries may exist.  See `nextPageToken` for
+     * more information.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + public Builder addEntries(com.google.logging.v2.LogEntry value) { + if (entriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEntriesIsMutable(); + entries_.add(value); + onChanged(); + } else { + entriesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * A list of log entries.  If `entries` is empty, `nextPageToken` may still be
+     * returned, indicating that more entries may exist.  See `nextPageToken` for
+     * more information.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + public Builder addEntries(int index, com.google.logging.v2.LogEntry value) { + if (entriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEntriesIsMutable(); + entries_.add(index, value); + onChanged(); + } else { + entriesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * A list of log entries.  If `entries` is empty, `nextPageToken` may still be
+     * returned, indicating that more entries may exist.  See `nextPageToken` for
+     * more information.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + public Builder addEntries(com.google.logging.v2.LogEntry.Builder builderForValue) { + if (entriesBuilder_ == null) { + ensureEntriesIsMutable(); + entries_.add(builderForValue.build()); + onChanged(); + } else { + entriesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of log entries.  If `entries` is empty, `nextPageToken` may still be
+     * returned, indicating that more entries may exist.  See `nextPageToken` for
+     * more information.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + public Builder addEntries(int index, com.google.logging.v2.LogEntry.Builder builderForValue) { + if (entriesBuilder_ == null) { + ensureEntriesIsMutable(); + entries_.add(index, builderForValue.build()); + onChanged(); + } else { + entriesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of log entries.  If `entries` is empty, `nextPageToken` may still be
+     * returned, indicating that more entries may exist.  See `nextPageToken` for
+     * more information.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + public Builder addAllEntries( + java.lang.Iterable values) { + if (entriesBuilder_ == null) { + ensureEntriesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, entries_); + onChanged(); + } else { + entriesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * A list of log entries.  If `entries` is empty, `nextPageToken` may still be
+     * returned, indicating that more entries may exist.  See `nextPageToken` for
+     * more information.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + public Builder clearEntries() { + if (entriesBuilder_ == null) { + entries_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + entriesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * A list of log entries.  If `entries` is empty, `nextPageToken` may still be
+     * returned, indicating that more entries may exist.  See `nextPageToken` for
+     * more information.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + public Builder removeEntries(int index) { + if (entriesBuilder_ == null) { + ensureEntriesIsMutable(); + entries_.remove(index); + onChanged(); + } else { + entriesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * A list of log entries.  If `entries` is empty, `nextPageToken` may still be
+     * returned, indicating that more entries may exist.  See `nextPageToken` for
+     * more information.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + public com.google.logging.v2.LogEntry.Builder getEntriesBuilder(int index) { + return getEntriesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * A list of log entries.  If `entries` is empty, `nextPageToken` may still be
+     * returned, indicating that more entries may exist.  See `nextPageToken` for
+     * more information.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + public com.google.logging.v2.LogEntryOrBuilder getEntriesOrBuilder(int index) { + if (entriesBuilder_ == null) { + return entries_.get(index); + } else { + return entriesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * A list of log entries.  If `entries` is empty, `nextPageToken` may still be
+     * returned, indicating that more entries may exist.  See `nextPageToken` for
+     * more information.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + public java.util.List + getEntriesOrBuilderList() { + if (entriesBuilder_ != null) { + return entriesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(entries_); + } + } + + /** + * + * + *
+     * A list of log entries.  If `entries` is empty, `nextPageToken` may still be
+     * returned, indicating that more entries may exist.  See `nextPageToken` for
+     * more information.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + public com.google.logging.v2.LogEntry.Builder addEntriesBuilder() { + return getEntriesFieldBuilder() + .addBuilder(com.google.logging.v2.LogEntry.getDefaultInstance()); + } + + /** + * + * + *
+     * A list of log entries.  If `entries` is empty, `nextPageToken` may still be
+     * returned, indicating that more entries may exist.  See `nextPageToken` for
+     * more information.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + public com.google.logging.v2.LogEntry.Builder addEntriesBuilder(int index) { + return getEntriesFieldBuilder() + .addBuilder(index, com.google.logging.v2.LogEntry.getDefaultInstance()); + } + + /** + * + * + *
+     * A list of log entries.  If `entries` is empty, `nextPageToken` may still be
+     * returned, indicating that more entries may exist.  See `nextPageToken` for
+     * more information.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + public java.util.List getEntriesBuilderList() { + return getEntriesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.logging.v2.LogEntry, + com.google.logging.v2.LogEntry.Builder, + com.google.logging.v2.LogEntryOrBuilder> + getEntriesFieldBuilder() { + if (entriesBuilder_ == null) { + entriesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.logging.v2.LogEntry, + com.google.logging.v2.LogEntry.Builder, + com.google.logging.v2.LogEntryOrBuilder>( + entries_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + entries_ = null; + } + return entriesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+     * If there might be more results than those appearing in this response, then
+     * `nextPageToken` is included.  To get the next set of results, call this
+     * method again using the value of `nextPageToken` as `pageToken`.
+     *
+     * If a value for `next_page_token` appears and the `entries` field is empty,
+     * it means that the search found no log entries so far but it did not have
+     * time to search all the possible log entries.  Retry the method with this
+     * value for `page_token` to continue the search.  Alternatively, consider
+     * speeding up the search by changing your filter to specify a single log name
+     * or resource type, or to narrow the time range of the search.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * If there might be more results than those appearing in this response, then
+     * `nextPageToken` is included.  To get the next set of results, call this
+     * method again using the value of `nextPageToken` as `pageToken`.
+     *
+     * If a value for `next_page_token` appears and the `entries` field is empty,
+     * it means that the search found no log entries so far but it did not have
+     * time to search all the possible log entries.  Retry the method with this
+     * value for `page_token` to continue the search.  Alternatively, consider
+     * speeding up the search by changing your filter to specify a single log name
+     * or resource type, or to narrow the time range of the search.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * If there might be more results than those appearing in this response, then
+     * `nextPageToken` is included.  To get the next set of results, call this
+     * method again using the value of `nextPageToken` as `pageToken`.
+     *
+     * If a value for `next_page_token` appears and the `entries` field is empty,
+     * it means that the search found no log entries so far but it did not have
+     * time to search all the possible log entries.  Retry the method with this
+     * value for `page_token` to continue the search.  Alternatively, consider
+     * speeding up the search by changing your filter to specify a single log name
+     * or resource type, or to narrow the time range of the search.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * If there might be more results than those appearing in this response, then
+     * `nextPageToken` is included.  To get the next set of results, call this
+     * method again using the value of `nextPageToken` as `pageToken`.
+     *
+     * If a value for `next_page_token` appears and the `entries` field is empty,
+     * it means that the search found no log entries so far but it did not have
+     * time to search all the possible log entries.  Retry the method with this
+     * value for `page_token` to continue the search.  Alternatively, consider
+     * speeding up the search by changing your filter to specify a single log name
+     * or resource type, or to narrow the time range of the search.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * If there might be more results than those appearing in this response, then
+     * `nextPageToken` is included.  To get the next set of results, call this
+     * method again using the value of `nextPageToken` as `pageToken`.
+     *
+     * If a value for `next_page_token` appears and the `entries` field is empty,
+     * it means that the search found no log entries so far but it did not have
+     * time to search all the possible log entries.  Retry the method with this
+     * value for `page_token` to continue the search.  Alternatively, consider
+     * speeding up the search by changing your filter to specify a single log name
+     * or resource type, or to narrow the time range of the search.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextPageToken_ = value; + bitField0_ |= 0x00000002; + 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.logging.v2.ListLogEntriesResponse) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.ListLogEntriesResponse) + private static final com.google.logging.v2.ListLogEntriesResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.ListLogEntriesResponse(); + } + + public static com.google.logging.v2.ListLogEntriesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListLogEntriesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.ListLogEntriesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogEntriesResponseOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogEntriesResponseOrBuilder.java new file mode 100644 index 000000000000..fb115c1920b6 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogEntriesResponseOrBuilder.java @@ -0,0 +1,135 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface ListLogEntriesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.ListLogEntriesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A list of log entries.  If `entries` is empty, `nextPageToken` may still be
+   * returned, indicating that more entries may exist.  See `nextPageToken` for
+   * more information.
+   * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + java.util.List getEntriesList(); + + /** + * + * + *
+   * A list of log entries.  If `entries` is empty, `nextPageToken` may still be
+   * returned, indicating that more entries may exist.  See `nextPageToken` for
+   * more information.
+   * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + com.google.logging.v2.LogEntry getEntries(int index); + + /** + * + * + *
+   * A list of log entries.  If `entries` is empty, `nextPageToken` may still be
+   * returned, indicating that more entries may exist.  See `nextPageToken` for
+   * more information.
+   * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + int getEntriesCount(); + + /** + * + * + *
+   * A list of log entries.  If `entries` is empty, `nextPageToken` may still be
+   * returned, indicating that more entries may exist.  See `nextPageToken` for
+   * more information.
+   * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + java.util.List getEntriesOrBuilderList(); + + /** + * + * + *
+   * A list of log entries.  If `entries` is empty, `nextPageToken` may still be
+   * returned, indicating that more entries may exist.  See `nextPageToken` for
+   * more information.
+   * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + com.google.logging.v2.LogEntryOrBuilder getEntriesOrBuilder(int index); + + /** + * + * + *
+   * If there might be more results than those appearing in this response, then
+   * `nextPageToken` is included.  To get the next set of results, call this
+   * method again using the value of `nextPageToken` as `pageToken`.
+   *
+   * If a value for `next_page_token` appears and the `entries` field is empty,
+   * it means that the search found no log entries so far but it did not have
+   * time to search all the possible log entries.  Retry the method with this
+   * value for `page_token` to continue the search.  Alternatively, consider
+   * speeding up the search by changing your filter to specify a single log name
+   * or resource type, or to narrow the time range of the search.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
+   * If there might be more results than those appearing in this response, then
+   * `nextPageToken` is included.  To get the next set of results, call this
+   * method again using the value of `nextPageToken` as `pageToken`.
+   *
+   * If a value for `next_page_token` appears and the `entries` field is empty,
+   * it means that the search found no log entries so far but it did not have
+   * time to search all the possible log entries.  Retry the method with this
+   * value for `page_token` to continue the search.  Alternatively, consider
+   * speeding up the search by changing your filter to specify a single log name
+   * or resource type, or to narrow the time range of the search.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogMetricsRequest.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogMetricsRequest.java new file mode 100644 index 000000000000..8e72f973eb39 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogMetricsRequest.java @@ -0,0 +1,976 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_metrics.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * The parameters to ListLogMetrics.
+ * 
+ * + * Protobuf type {@code google.logging.v2.ListLogMetricsRequest} + */ +public final class ListLogMetricsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.ListLogMetricsRequest) + ListLogMetricsRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ListLogMetricsRequest.newBuilder() to construct. + private ListLogMetricsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListLogMetricsRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListLogMetricsRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingMetricsProto + .internal_static_google_logging_v2_ListLogMetricsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingMetricsProto + .internal_static_google_logging_v2_ListLogMetricsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.ListLogMetricsRequest.class, + com.google.logging.v2.ListLogMetricsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
+   * Required. The name of the project containing the metrics:
+   *
+   *     "projects/[PROJECT_ID]"
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The name of the project containing the metrics:
+   *
+   *     "projects/[PROJECT_ID]"
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + + /** + * + * + *
+   * Optional. If present, then retrieve the next batch of results from the
+   * preceding call to this method. `pageToken` must be the value of
+   * `nextPageToken` from the previous response. The values of other method
+   * parameters should be identical to those in the previous call.
+   * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. If present, then retrieve the next batch of results from the
+   * preceding call to this method. `pageToken` must be the value of
+   * `nextPageToken` from the previous response. The values of other method
+   * parameters should be identical to those in the previous call.
+   * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 3; + private int pageSize_ = 0; + + /** + * + * + *
+   * Optional. The maximum number of results to return from this request.
+   * Non-positive values are ignored. The presence of `nextPageToken` in the
+   * response indicates that more results might be available.
+   * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, pageToken_); + } + if (pageSize_ != 0) { + output.writeInt32(3, pageSize_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, pageToken_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, pageSize_); + } + size += getUnknownFields().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.logging.v2.ListLogMetricsRequest)) { + return super.equals(obj); + } + com.google.logging.v2.ListLogMetricsRequest other = + (com.google.logging.v2.ListLogMetricsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.ListLogMetricsRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.ListLogMetricsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.ListLogMetricsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.ListLogMetricsRequest 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.logging.v2.ListLogMetricsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.ListLogMetricsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.ListLogMetricsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.ListLogMetricsRequest 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.logging.v2.ListLogMetricsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.ListLogMetricsRequest 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.logging.v2.ListLogMetricsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.ListLogMetricsRequest 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.logging.v2.ListLogMetricsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The parameters to ListLogMetrics.
+   * 
+ * + * Protobuf type {@code google.logging.v2.ListLogMetricsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.ListLogMetricsRequest) + com.google.logging.v2.ListLogMetricsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingMetricsProto + .internal_static_google_logging_v2_ListLogMetricsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingMetricsProto + .internal_static_google_logging_v2_ListLogMetricsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.ListLogMetricsRequest.class, + com.google.logging.v2.ListLogMetricsRequest.Builder.class); + } + + // Construct using com.google.logging.v2.ListLogMetricsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageToken_ = ""; + pageSize_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingMetricsProto + .internal_static_google_logging_v2_ListLogMetricsRequest_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.ListLogMetricsRequest getDefaultInstanceForType() { + return com.google.logging.v2.ListLogMetricsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.ListLogMetricsRequest build() { + com.google.logging.v2.ListLogMetricsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.ListLogMetricsRequest buildPartial() { + com.google.logging.v2.ListLogMetricsRequest result = + new com.google.logging.v2.ListLogMetricsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.logging.v2.ListLogMetricsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageToken_ = pageToken_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageSize_ = pageSize_; + } + } + + @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.logging.v2.ListLogMetricsRequest) { + return mergeFrom((com.google.logging.v2.ListLogMetricsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.ListLogMetricsRequest other) { + if (other == com.google.logging.v2.ListLogMetricsRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + + /** + * + * + *
+     * Required. The name of the project containing the metrics:
+     *
+     *     "projects/[PROJECT_ID]"
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The name of the project containing the metrics:
+     *
+     *     "projects/[PROJECT_ID]"
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The name of the project containing the metrics:
+     *
+     *     "projects/[PROJECT_ID]"
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The name of the project containing the metrics:
+     *
+     *     "projects/[PROJECT_ID]"
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The name of the project containing the metrics:
+     *
+     *     "projects/[PROJECT_ID]"
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method. `pageToken` must be the value of
+     * `nextPageToken` from the previous response. The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method. `pageToken` must be the value of
+     * `nextPageToken` from the previous response. The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method. `pageToken` must be the value of
+     * `nextPageToken` from the previous response. The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method. `pageToken` must be the value of
+     * `nextPageToken` from the previous response. The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method. `pageToken` must be the value of
+     * `nextPageToken` from the previous response. The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int pageSize_; + + /** + * + * + *
+     * Optional. The maximum number of results to return from this request.
+     * Non-positive values are ignored. The presence of `nextPageToken` in the
+     * response indicates that more results might be available.
+     * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + /** + * + * + *
+     * Optional. The maximum number of results to return from this request.
+     * Non-positive values are ignored. The presence of `nextPageToken` in the
+     * response indicates that more results might be available.
+     * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The maximum number of results to return from this request.
+     * Non-positive values are ignored. The presence of `nextPageToken` in the
+     * response indicates that more results might be available.
+     * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000004); + pageSize_ = 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.logging.v2.ListLogMetricsRequest) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.ListLogMetricsRequest) + private static final com.google.logging.v2.ListLogMetricsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.ListLogMetricsRequest(); + } + + public static com.google.logging.v2.ListLogMetricsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListLogMetricsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.ListLogMetricsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogMetricsRequestOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogMetricsRequestOrBuilder.java new file mode 100644 index 000000000000..f83ae6232dca --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogMetricsRequestOrBuilder.java @@ -0,0 +1,107 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_metrics.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface ListLogMetricsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.ListLogMetricsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the project containing the metrics:
+   *
+   *     "projects/[PROJECT_ID]"
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
+   * Required. The name of the project containing the metrics:
+   *
+   *     "projects/[PROJECT_ID]"
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. If present, then retrieve the next batch of results from the
+   * preceding call to this method. `pageToken` must be the value of
+   * `nextPageToken` from the previous response. The values of other method
+   * parameters should be identical to those in the previous call.
+   * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
+   * Optional. If present, then retrieve the next batch of results from the
+   * preceding call to this method. `pageToken` must be the value of
+   * `nextPageToken` from the previous response. The values of other method
+   * parameters should be identical to those in the previous call.
+   * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Optional. The maximum number of results to return from this request.
+   * Non-positive values are ignored. The presence of `nextPageToken` in the
+   * response indicates that more results might be available.
+   * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogMetricsResponse.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogMetricsResponse.java new file mode 100644 index 000000000000..bbaee6bee22e --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogMetricsResponse.java @@ -0,0 +1,1157 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_metrics.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * Result returned from ListLogMetrics.
+ * 
+ * + * Protobuf type {@code google.logging.v2.ListLogMetricsResponse} + */ +public final class ListLogMetricsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.ListLogMetricsResponse) + ListLogMetricsResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ListLogMetricsResponse.newBuilder() to construct. + private ListLogMetricsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListLogMetricsResponse() { + metrics_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListLogMetricsResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingMetricsProto + .internal_static_google_logging_v2_ListLogMetricsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingMetricsProto + .internal_static_google_logging_v2_ListLogMetricsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.ListLogMetricsResponse.class, + com.google.logging.v2.ListLogMetricsResponse.Builder.class); + } + + public static final int METRICS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List metrics_; + + /** + * + * + *
+   * A list of logs-based metrics.
+   * 
+ * + * repeated .google.logging.v2.LogMetric metrics = 1; + */ + @java.lang.Override + public java.util.List getMetricsList() { + return metrics_; + } + + /** + * + * + *
+   * A list of logs-based metrics.
+   * 
+ * + * repeated .google.logging.v2.LogMetric metrics = 1; + */ + @java.lang.Override + public java.util.List + getMetricsOrBuilderList() { + return metrics_; + } + + /** + * + * + *
+   * A list of logs-based metrics.
+   * 
+ * + * repeated .google.logging.v2.LogMetric metrics = 1; + */ + @java.lang.Override + public int getMetricsCount() { + return metrics_.size(); + } + + /** + * + * + *
+   * A list of logs-based metrics.
+   * 
+ * + * repeated .google.logging.v2.LogMetric metrics = 1; + */ + @java.lang.Override + public com.google.logging.v2.LogMetric getMetrics(int index) { + return metrics_.get(index); + } + + /** + * + * + *
+   * A list of logs-based metrics.
+   * 
+ * + * repeated .google.logging.v2.LogMetric metrics = 1; + */ + @java.lang.Override + public com.google.logging.v2.LogMetricOrBuilder getMetricsOrBuilder(int index) { + return metrics_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+   * If there might be more results than appear in this response, then
+   * `nextPageToken` is included. To get the next set of results, call this
+   * method again using the value of `nextPageToken` as `pageToken`.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * If there might be more results than appear in this response, then
+   * `nextPageToken` is included. To get the next set of results, call this
+   * method again using the value of `nextPageToken` as `pageToken`.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < metrics_.size(); i++) { + output.writeMessage(1, metrics_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < metrics_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, metrics_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += getUnknownFields().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.logging.v2.ListLogMetricsResponse)) { + return super.equals(obj); + } + com.google.logging.v2.ListLogMetricsResponse other = + (com.google.logging.v2.ListLogMetricsResponse) obj; + + if (!getMetricsList().equals(other.getMetricsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getMetricsCount() > 0) { + hash = (37 * hash) + METRICS_FIELD_NUMBER; + hash = (53 * hash) + getMetricsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.ListLogMetricsResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.ListLogMetricsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.ListLogMetricsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.ListLogMetricsResponse 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.logging.v2.ListLogMetricsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.ListLogMetricsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.ListLogMetricsResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.ListLogMetricsResponse 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.logging.v2.ListLogMetricsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.ListLogMetricsResponse 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.logging.v2.ListLogMetricsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.ListLogMetricsResponse 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.logging.v2.ListLogMetricsResponse 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; + } + + /** + * + * + *
+   * Result returned from ListLogMetrics.
+   * 
+ * + * Protobuf type {@code google.logging.v2.ListLogMetricsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.ListLogMetricsResponse) + com.google.logging.v2.ListLogMetricsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingMetricsProto + .internal_static_google_logging_v2_ListLogMetricsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingMetricsProto + .internal_static_google_logging_v2_ListLogMetricsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.ListLogMetricsResponse.class, + com.google.logging.v2.ListLogMetricsResponse.Builder.class); + } + + // Construct using com.google.logging.v2.ListLogMetricsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (metricsBuilder_ == null) { + metrics_ = java.util.Collections.emptyList(); + } else { + metrics_ = null; + metricsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingMetricsProto + .internal_static_google_logging_v2_ListLogMetricsResponse_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.ListLogMetricsResponse getDefaultInstanceForType() { + return com.google.logging.v2.ListLogMetricsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.ListLogMetricsResponse build() { + com.google.logging.v2.ListLogMetricsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.ListLogMetricsResponse buildPartial() { + com.google.logging.v2.ListLogMetricsResponse result = + new com.google.logging.v2.ListLogMetricsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.logging.v2.ListLogMetricsResponse result) { + if (metricsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + metrics_ = java.util.Collections.unmodifiableList(metrics_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.metrics_ = metrics_; + } else { + result.metrics_ = metricsBuilder_.build(); + } + } + + private void buildPartial0(com.google.logging.v2.ListLogMetricsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @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.logging.v2.ListLogMetricsResponse) { + return mergeFrom((com.google.logging.v2.ListLogMetricsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.ListLogMetricsResponse other) { + if (other == com.google.logging.v2.ListLogMetricsResponse.getDefaultInstance()) return this; + if (metricsBuilder_ == null) { + if (!other.metrics_.isEmpty()) { + if (metrics_.isEmpty()) { + metrics_ = other.metrics_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureMetricsIsMutable(); + metrics_.addAll(other.metrics_); + } + onChanged(); + } + } else { + if (!other.metrics_.isEmpty()) { + if (metricsBuilder_.isEmpty()) { + metricsBuilder_.dispose(); + metricsBuilder_ = null; + metrics_ = other.metrics_; + bitField0_ = (bitField0_ & ~0x00000001); + metricsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getMetricsFieldBuilder() + : null; + } else { + metricsBuilder_.addAllMessages(other.metrics_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.logging.v2.LogMetric m = + input.readMessage(com.google.logging.v2.LogMetric.parser(), extensionRegistry); + if (metricsBuilder_ == null) { + ensureMetricsIsMutable(); + metrics_.add(m); + } else { + metricsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List metrics_ = + java.util.Collections.emptyList(); + + private void ensureMetricsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + metrics_ = new java.util.ArrayList(metrics_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.logging.v2.LogMetric, + com.google.logging.v2.LogMetric.Builder, + com.google.logging.v2.LogMetricOrBuilder> + metricsBuilder_; + + /** + * + * + *
+     * A list of logs-based metrics.
+     * 
+ * + * repeated .google.logging.v2.LogMetric metrics = 1; + */ + public java.util.List getMetricsList() { + if (metricsBuilder_ == null) { + return java.util.Collections.unmodifiableList(metrics_); + } else { + return metricsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * A list of logs-based metrics.
+     * 
+ * + * repeated .google.logging.v2.LogMetric metrics = 1; + */ + public int getMetricsCount() { + if (metricsBuilder_ == null) { + return metrics_.size(); + } else { + return metricsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * A list of logs-based metrics.
+     * 
+ * + * repeated .google.logging.v2.LogMetric metrics = 1; + */ + public com.google.logging.v2.LogMetric getMetrics(int index) { + if (metricsBuilder_ == null) { + return metrics_.get(index); + } else { + return metricsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * A list of logs-based metrics.
+     * 
+ * + * repeated .google.logging.v2.LogMetric metrics = 1; + */ + public Builder setMetrics(int index, com.google.logging.v2.LogMetric value) { + if (metricsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMetricsIsMutable(); + metrics_.set(index, value); + onChanged(); + } else { + metricsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * A list of logs-based metrics.
+     * 
+ * + * repeated .google.logging.v2.LogMetric metrics = 1; + */ + public Builder setMetrics(int index, com.google.logging.v2.LogMetric.Builder builderForValue) { + if (metricsBuilder_ == null) { + ensureMetricsIsMutable(); + metrics_.set(index, builderForValue.build()); + onChanged(); + } else { + metricsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of logs-based metrics.
+     * 
+ * + * repeated .google.logging.v2.LogMetric metrics = 1; + */ + public Builder addMetrics(com.google.logging.v2.LogMetric value) { + if (metricsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMetricsIsMutable(); + metrics_.add(value); + onChanged(); + } else { + metricsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * A list of logs-based metrics.
+     * 
+ * + * repeated .google.logging.v2.LogMetric metrics = 1; + */ + public Builder addMetrics(int index, com.google.logging.v2.LogMetric value) { + if (metricsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMetricsIsMutable(); + metrics_.add(index, value); + onChanged(); + } else { + metricsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * A list of logs-based metrics.
+     * 
+ * + * repeated .google.logging.v2.LogMetric metrics = 1; + */ + public Builder addMetrics(com.google.logging.v2.LogMetric.Builder builderForValue) { + if (metricsBuilder_ == null) { + ensureMetricsIsMutable(); + metrics_.add(builderForValue.build()); + onChanged(); + } else { + metricsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of logs-based metrics.
+     * 
+ * + * repeated .google.logging.v2.LogMetric metrics = 1; + */ + public Builder addMetrics(int index, com.google.logging.v2.LogMetric.Builder builderForValue) { + if (metricsBuilder_ == null) { + ensureMetricsIsMutable(); + metrics_.add(index, builderForValue.build()); + onChanged(); + } else { + metricsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of logs-based metrics.
+     * 
+ * + * repeated .google.logging.v2.LogMetric metrics = 1; + */ + public Builder addAllMetrics( + java.lang.Iterable values) { + if (metricsBuilder_ == null) { + ensureMetricsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, metrics_); + onChanged(); + } else { + metricsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * A list of logs-based metrics.
+     * 
+ * + * repeated .google.logging.v2.LogMetric metrics = 1; + */ + public Builder clearMetrics() { + if (metricsBuilder_ == null) { + metrics_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + metricsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * A list of logs-based metrics.
+     * 
+ * + * repeated .google.logging.v2.LogMetric metrics = 1; + */ + public Builder removeMetrics(int index) { + if (metricsBuilder_ == null) { + ensureMetricsIsMutable(); + metrics_.remove(index); + onChanged(); + } else { + metricsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * A list of logs-based metrics.
+     * 
+ * + * repeated .google.logging.v2.LogMetric metrics = 1; + */ + public com.google.logging.v2.LogMetric.Builder getMetricsBuilder(int index) { + return getMetricsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * A list of logs-based metrics.
+     * 
+ * + * repeated .google.logging.v2.LogMetric metrics = 1; + */ + public com.google.logging.v2.LogMetricOrBuilder getMetricsOrBuilder(int index) { + if (metricsBuilder_ == null) { + return metrics_.get(index); + } else { + return metricsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * A list of logs-based metrics.
+     * 
+ * + * repeated .google.logging.v2.LogMetric metrics = 1; + */ + public java.util.List + getMetricsOrBuilderList() { + if (metricsBuilder_ != null) { + return metricsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(metrics_); + } + } + + /** + * + * + *
+     * A list of logs-based metrics.
+     * 
+ * + * repeated .google.logging.v2.LogMetric metrics = 1; + */ + public com.google.logging.v2.LogMetric.Builder addMetricsBuilder() { + return getMetricsFieldBuilder() + .addBuilder(com.google.logging.v2.LogMetric.getDefaultInstance()); + } + + /** + * + * + *
+     * A list of logs-based metrics.
+     * 
+ * + * repeated .google.logging.v2.LogMetric metrics = 1; + */ + public com.google.logging.v2.LogMetric.Builder addMetricsBuilder(int index) { + return getMetricsFieldBuilder() + .addBuilder(index, com.google.logging.v2.LogMetric.getDefaultInstance()); + } + + /** + * + * + *
+     * A list of logs-based metrics.
+     * 
+ * + * repeated .google.logging.v2.LogMetric metrics = 1; + */ + public java.util.List getMetricsBuilderList() { + return getMetricsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.logging.v2.LogMetric, + com.google.logging.v2.LogMetric.Builder, + com.google.logging.v2.LogMetricOrBuilder> + getMetricsFieldBuilder() { + if (metricsBuilder_ == null) { + metricsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.logging.v2.LogMetric, + com.google.logging.v2.LogMetric.Builder, + com.google.logging.v2.LogMetricOrBuilder>( + metrics_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + metrics_ = null; + } + return metricsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+     * If there might be more results than appear in this response, then
+     * `nextPageToken` is included. To get the next set of results, call this
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * If there might be more results than appear in this response, then
+     * `nextPageToken` is included. To get the next set of results, call this
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * If there might be more results than appear in this response, then
+     * `nextPageToken` is included. To get the next set of results, call this
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * If there might be more results than appear in this response, then
+     * `nextPageToken` is included. To get the next set of results, call this
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * If there might be more results than appear in this response, then
+     * `nextPageToken` is included. To get the next set of results, call this
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextPageToken_ = value; + bitField0_ |= 0x00000002; + 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.logging.v2.ListLogMetricsResponse) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.ListLogMetricsResponse) + private static final com.google.logging.v2.ListLogMetricsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.ListLogMetricsResponse(); + } + + public static com.google.logging.v2.ListLogMetricsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListLogMetricsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.ListLogMetricsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogMetricsResponseOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogMetricsResponseOrBuilder.java new file mode 100644 index 000000000000..bb5b506542d5 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogMetricsResponseOrBuilder.java @@ -0,0 +1,111 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_metrics.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface ListLogMetricsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.ListLogMetricsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A list of logs-based metrics.
+   * 
+ * + * repeated .google.logging.v2.LogMetric metrics = 1; + */ + java.util.List getMetricsList(); + + /** + * + * + *
+   * A list of logs-based metrics.
+   * 
+ * + * repeated .google.logging.v2.LogMetric metrics = 1; + */ + com.google.logging.v2.LogMetric getMetrics(int index); + + /** + * + * + *
+   * A list of logs-based metrics.
+   * 
+ * + * repeated .google.logging.v2.LogMetric metrics = 1; + */ + int getMetricsCount(); + + /** + * + * + *
+   * A list of logs-based metrics.
+   * 
+ * + * repeated .google.logging.v2.LogMetric metrics = 1; + */ + java.util.List getMetricsOrBuilderList(); + + /** + * + * + *
+   * A list of logs-based metrics.
+   * 
+ * + * repeated .google.logging.v2.LogMetric metrics = 1; + */ + com.google.logging.v2.LogMetricOrBuilder getMetricsOrBuilder(int index); + + /** + * + * + *
+   * If there might be more results than appear in this response, then
+   * `nextPageToken` is included. To get the next set of results, call this
+   * method again using the value of `nextPageToken` as `pageToken`.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
+   * If there might be more results than appear in this response, then
+   * `nextPageToken` is included. To get the next set of results, call this
+   * method again using the value of `nextPageToken` as `pageToken`.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogsRequest.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogsRequest.java new file mode 100644 index 000000000000..4d899e86e030 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogsRequest.java @@ -0,0 +1,1493 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * The parameters to ListLogs.
+ * 
+ * + * Protobuf type {@code google.logging.v2.ListLogsRequest} + */ +public final class ListLogsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.ListLogsRequest) + ListLogsRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ListLogsRequest.newBuilder() to construct. + private ListLogsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListLogsRequest() { + parent_ = ""; + resourceNames_ = com.google.protobuf.LazyStringArrayList.emptyList(); + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListLogsRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_ListLogsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_ListLogsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.ListLogsRequest.class, + com.google.logging.v2.ListLogsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
+   * Required. The resource name to list logs for:
+   *
+   * *  `projects/[PROJECT_ID]`
+   * *  `organizations/[ORGANIZATION_ID]`
+   * *  `billingAccounts/[BILLING_ACCOUNT_ID]`
+   * *  `folders/[FOLDER_ID]`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The resource name to list logs for:
+   *
+   * *  `projects/[PROJECT_ID]`
+   * *  `organizations/[ORGANIZATION_ID]`
+   * *  `billingAccounts/[BILLING_ACCOUNT_ID]`
+   * *  `folders/[FOLDER_ID]`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RESOURCE_NAMES_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList resourceNames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+   * Optional. List of resource names to list logs for:
+   *
+   *  * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *
+   * To support legacy queries, it could also be:
+   *
+   * *  `projects/[PROJECT_ID]`
+   * *  `organizations/[ORGANIZATION_ID]`
+   * *  `billingAccounts/[BILLING_ACCOUNT_ID]`
+   * *  `folders/[FOLDER_ID]`
+   *
+   * The resource name in the `parent` field is added to this list.
+   * 
+ * + * + * repeated string resource_names = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return A list containing the resourceNames. + */ + public com.google.protobuf.ProtocolStringList getResourceNamesList() { + return resourceNames_; + } + + /** + * + * + *
+   * Optional. List of resource names to list logs for:
+   *
+   *  * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *
+   * To support legacy queries, it could also be:
+   *
+   * *  `projects/[PROJECT_ID]`
+   * *  `organizations/[ORGANIZATION_ID]`
+   * *  `billingAccounts/[BILLING_ACCOUNT_ID]`
+   * *  `folders/[FOLDER_ID]`
+   *
+   * The resource name in the `parent` field is added to this list.
+   * 
+ * + * + * repeated string resource_names = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The count of resourceNames. + */ + public int getResourceNamesCount() { + return resourceNames_.size(); + } + + /** + * + * + *
+   * Optional. List of resource names to list logs for:
+   *
+   *  * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *
+   * To support legacy queries, it could also be:
+   *
+   * *  `projects/[PROJECT_ID]`
+   * *  `organizations/[ORGANIZATION_ID]`
+   * *  `billingAccounts/[BILLING_ACCOUNT_ID]`
+   * *  `folders/[FOLDER_ID]`
+   *
+   * The resource name in the `parent` field is added to this list.
+   * 
+ * + * + * repeated string resource_names = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the element to return. + * @return The resourceNames at the given index. + */ + public java.lang.String getResourceNames(int index) { + return resourceNames_.get(index); + } + + /** + * + * + *
+   * Optional. List of resource names to list logs for:
+   *
+   *  * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *
+   * To support legacy queries, it could also be:
+   *
+   * *  `projects/[PROJECT_ID]`
+   * *  `organizations/[ORGANIZATION_ID]`
+   * *  `billingAccounts/[BILLING_ACCOUNT_ID]`
+   * *  `folders/[FOLDER_ID]`
+   *
+   * The resource name in the `parent` field is added to this list.
+   * 
+ * + * + * repeated string resource_names = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the value to return. + * @return The bytes of the resourceNames at the given index. + */ + public com.google.protobuf.ByteString getResourceNamesBytes(int index) { + return resourceNames_.getByteString(index); + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_ = 0; + + /** + * + * + *
+   * Optional. The maximum number of results to return from this request.
+   * Non-positive values are ignored.  The presence of `nextPageToken` in the
+   * response indicates that more results might be available.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + + /** + * + * + *
+   * Optional. If present, then retrieve the next batch of results from the
+   * preceding call to this method.  `pageToken` must be the value of
+   * `nextPageToken` from the previous response.  The values of other method
+   * parameters should be identical to those in the previous call.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. If present, then retrieve the next batch of results from the
+   * preceding call to this method.  `pageToken` must be the value of
+   * `nextPageToken` from the previous response.  The values of other method
+   * parameters should be identical to those in the previous call.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + for (int i = 0; i < resourceNames_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, resourceNames_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + { + int dataSize = 0; + for (int i = 0; i < resourceNames_.size(); i++) { + dataSize += computeStringSizeNoTag(resourceNames_.getRaw(i)); + } + size += dataSize; + size += 1 * getResourceNamesList().size(); + } + size += getUnknownFields().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.logging.v2.ListLogsRequest)) { + return super.equals(obj); + } + com.google.logging.v2.ListLogsRequest other = (com.google.logging.v2.ListLogsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getResourceNamesList().equals(other.getResourceNamesList())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (getResourceNamesCount() > 0) { + hash = (37 * hash) + RESOURCE_NAMES_FIELD_NUMBER; + hash = (53 * hash) + getResourceNamesList().hashCode(); + } + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.ListLogsRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.ListLogsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.ListLogsRequest parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.ListLogsRequest 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.logging.v2.ListLogsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.ListLogsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.ListLogsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.ListLogsRequest 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.logging.v2.ListLogsRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.ListLogsRequest 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.logging.v2.ListLogsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.ListLogsRequest 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.logging.v2.ListLogsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The parameters to ListLogs.
+   * 
+ * + * Protobuf type {@code google.logging.v2.ListLogsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.ListLogsRequest) + com.google.logging.v2.ListLogsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_ListLogsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_ListLogsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.ListLogsRequest.class, + com.google.logging.v2.ListLogsRequest.Builder.class); + } + + // Construct using com.google.logging.v2.ListLogsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + resourceNames_ = com.google.protobuf.LazyStringArrayList.emptyList(); + pageSize_ = 0; + pageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_ListLogsRequest_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.ListLogsRequest getDefaultInstanceForType() { + return com.google.logging.v2.ListLogsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.ListLogsRequest build() { + com.google.logging.v2.ListLogsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.ListLogsRequest buildPartial() { + com.google.logging.v2.ListLogsRequest result = + new com.google.logging.v2.ListLogsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.logging.v2.ListLogsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + resourceNames_.makeImmutable(); + result.resourceNames_ = resourceNames_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.pageToken_ = pageToken_; + } + } + + @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.logging.v2.ListLogsRequest) { + return mergeFrom((com.google.logging.v2.ListLogsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.ListLogsRequest other) { + if (other == com.google.logging.v2.ListLogsRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.resourceNames_.isEmpty()) { + if (resourceNames_.isEmpty()) { + resourceNames_ = other.resourceNames_; + bitField0_ |= 0x00000002; + } else { + ensureResourceNamesIsMutable(); + resourceNames_.addAll(other.resourceNames_); + } + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000008; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 26 + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureResourceNamesIsMutable(); + resourceNames_.add(s); + break; + } // case 66 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + + /** + * + * + *
+     * Required. The resource name to list logs for:
+     *
+     * *  `projects/[PROJECT_ID]`
+     * *  `organizations/[ORGANIZATION_ID]`
+     * *  `billingAccounts/[BILLING_ACCOUNT_ID]`
+     * *  `folders/[FOLDER_ID]`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The resource name to list logs for:
+     *
+     * *  `projects/[PROJECT_ID]`
+     * *  `organizations/[ORGANIZATION_ID]`
+     * *  `billingAccounts/[BILLING_ACCOUNT_ID]`
+     * *  `folders/[FOLDER_ID]`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The resource name to list logs for:
+     *
+     * *  `projects/[PROJECT_ID]`
+     * *  `organizations/[ORGANIZATION_ID]`
+     * *  `billingAccounts/[BILLING_ACCOUNT_ID]`
+     * *  `folders/[FOLDER_ID]`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The resource name to list logs for:
+     *
+     * *  `projects/[PROJECT_ID]`
+     * *  `organizations/[ORGANIZATION_ID]`
+     * *  `billingAccounts/[BILLING_ACCOUNT_ID]`
+     * *  `folders/[FOLDER_ID]`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The resource name to list logs for:
+     *
+     * *  `projects/[PROJECT_ID]`
+     * *  `organizations/[ORGANIZATION_ID]`
+     * *  `billingAccounts/[BILLING_ACCOUNT_ID]`
+     * *  `folders/[FOLDER_ID]`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList resourceNames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureResourceNamesIsMutable() { + if (!resourceNames_.isModifiable()) { + resourceNames_ = new com.google.protobuf.LazyStringArrayList(resourceNames_); + } + bitField0_ |= 0x00000002; + } + + /** + * + * + *
+     * Optional. List of resource names to list logs for:
+     *
+     *  * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *
+     * To support legacy queries, it could also be:
+     *
+     * *  `projects/[PROJECT_ID]`
+     * *  `organizations/[ORGANIZATION_ID]`
+     * *  `billingAccounts/[BILLING_ACCOUNT_ID]`
+     * *  `folders/[FOLDER_ID]`
+     *
+     * The resource name in the `parent` field is added to this list.
+     * 
+ * + * + * repeated string resource_names = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return A list containing the resourceNames. + */ + public com.google.protobuf.ProtocolStringList getResourceNamesList() { + resourceNames_.makeImmutable(); + return resourceNames_; + } + + /** + * + * + *
+     * Optional. List of resource names to list logs for:
+     *
+     *  * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *
+     * To support legacy queries, it could also be:
+     *
+     * *  `projects/[PROJECT_ID]`
+     * *  `organizations/[ORGANIZATION_ID]`
+     * *  `billingAccounts/[BILLING_ACCOUNT_ID]`
+     * *  `folders/[FOLDER_ID]`
+     *
+     * The resource name in the `parent` field is added to this list.
+     * 
+ * + * + * repeated string resource_names = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The count of resourceNames. + */ + public int getResourceNamesCount() { + return resourceNames_.size(); + } + + /** + * + * + *
+     * Optional. List of resource names to list logs for:
+     *
+     *  * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *
+     * To support legacy queries, it could also be:
+     *
+     * *  `projects/[PROJECT_ID]`
+     * *  `organizations/[ORGANIZATION_ID]`
+     * *  `billingAccounts/[BILLING_ACCOUNT_ID]`
+     * *  `folders/[FOLDER_ID]`
+     *
+     * The resource name in the `parent` field is added to this list.
+     * 
+ * + * + * repeated string resource_names = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the element to return. + * @return The resourceNames at the given index. + */ + public java.lang.String getResourceNames(int index) { + return resourceNames_.get(index); + } + + /** + * + * + *
+     * Optional. List of resource names to list logs for:
+     *
+     *  * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *
+     * To support legacy queries, it could also be:
+     *
+     * *  `projects/[PROJECT_ID]`
+     * *  `organizations/[ORGANIZATION_ID]`
+     * *  `billingAccounts/[BILLING_ACCOUNT_ID]`
+     * *  `folders/[FOLDER_ID]`
+     *
+     * The resource name in the `parent` field is added to this list.
+     * 
+ * + * + * repeated string resource_names = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the value to return. + * @return The bytes of the resourceNames at the given index. + */ + public com.google.protobuf.ByteString getResourceNamesBytes(int index) { + return resourceNames_.getByteString(index); + } + + /** + * + * + *
+     * Optional. List of resource names to list logs for:
+     *
+     *  * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *
+     * To support legacy queries, it could also be:
+     *
+     * *  `projects/[PROJECT_ID]`
+     * *  `organizations/[ORGANIZATION_ID]`
+     * *  `billingAccounts/[BILLING_ACCOUNT_ID]`
+     * *  `folders/[FOLDER_ID]`
+     *
+     * The resource name in the `parent` field is added to this list.
+     * 
+ * + * + * repeated string resource_names = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param index The index to set the value at. + * @param value The resourceNames to set. + * @return This builder for chaining. + */ + public Builder setResourceNames(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureResourceNamesIsMutable(); + resourceNames_.set(index, value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. List of resource names to list logs for:
+     *
+     *  * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *
+     * To support legacy queries, it could also be:
+     *
+     * *  `projects/[PROJECT_ID]`
+     * *  `organizations/[ORGANIZATION_ID]`
+     * *  `billingAccounts/[BILLING_ACCOUNT_ID]`
+     * *  `folders/[FOLDER_ID]`
+     *
+     * The resource name in the `parent` field is added to this list.
+     * 
+ * + * + * repeated string resource_names = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The resourceNames to add. + * @return This builder for chaining. + */ + public Builder addResourceNames(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureResourceNamesIsMutable(); + resourceNames_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. List of resource names to list logs for:
+     *
+     *  * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *
+     * To support legacy queries, it could also be:
+     *
+     * *  `projects/[PROJECT_ID]`
+     * *  `organizations/[ORGANIZATION_ID]`
+     * *  `billingAccounts/[BILLING_ACCOUNT_ID]`
+     * *  `folders/[FOLDER_ID]`
+     *
+     * The resource name in the `parent` field is added to this list.
+     * 
+ * + * + * repeated string resource_names = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param values The resourceNames to add. + * @return This builder for chaining. + */ + public Builder addAllResourceNames(java.lang.Iterable values) { + ensureResourceNamesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, resourceNames_); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. List of resource names to list logs for:
+     *
+     *  * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *
+     * To support legacy queries, it could also be:
+     *
+     * *  `projects/[PROJECT_ID]`
+     * *  `organizations/[ORGANIZATION_ID]`
+     * *  `billingAccounts/[BILLING_ACCOUNT_ID]`
+     * *  `folders/[FOLDER_ID]`
+     *
+     * The resource name in the `parent` field is added to this list.
+     * 
+ * + * + * repeated string resource_names = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearResourceNames() { + resourceNames_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + ; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. List of resource names to list logs for:
+     *
+     *  * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *
+     * To support legacy queries, it could also be:
+     *
+     * *  `projects/[PROJECT_ID]`
+     * *  `organizations/[ORGANIZATION_ID]`
+     * *  `billingAccounts/[BILLING_ACCOUNT_ID]`
+     * *  `folders/[FOLDER_ID]`
+     *
+     * The resource name in the `parent` field is added to this list.
+     * 
+ * + * + * repeated string resource_names = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes of the resourceNames to add. + * @return This builder for chaining. + */ + public Builder addResourceNamesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureResourceNamesIsMutable(); + resourceNames_.add(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int pageSize_; + + /** + * + * + *
+     * Optional. The maximum number of results to return from this request.
+     * Non-positive values are ignored.  The presence of `nextPageToken` in the
+     * response indicates that more results might be available.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + /** + * + * + *
+     * Optional. The maximum number of results to return from this request.
+     * Non-positive values are ignored.  The presence of `nextPageToken` in the
+     * response indicates that more results might be available.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The maximum number of results to return from this request.
+     * Non-positive values are ignored.  The presence of `nextPageToken` in the
+     * response indicates that more results might be available.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000004); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method.  `pageToken` must be the value of
+     * `nextPageToken` from the previous response.  The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method.  `pageToken` must be the value of
+     * `nextPageToken` from the previous response.  The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method.  `pageToken` must be the value of
+     * `nextPageToken` from the previous response.  The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method.  `pageToken` must be the value of
+     * `nextPageToken` from the previous response.  The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method.  `pageToken` must be the value of
+     * `nextPageToken` from the previous response.  The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000008; + 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.logging.v2.ListLogsRequest) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.ListLogsRequest) + private static final com.google.logging.v2.ListLogsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.ListLogsRequest(); + } + + public static com.google.logging.v2.ListLogsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListLogsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.ListLogsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogsRequestOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogsRequestOrBuilder.java new file mode 100644 index 000000000000..8107fbb6f136 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogsRequestOrBuilder.java @@ -0,0 +1,231 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface ListLogsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.ListLogsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name to list logs for:
+   *
+   * *  `projects/[PROJECT_ID]`
+   * *  `organizations/[ORGANIZATION_ID]`
+   * *  `billingAccounts/[BILLING_ACCOUNT_ID]`
+   * *  `folders/[FOLDER_ID]`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
+   * Required. The resource name to list logs for:
+   *
+   * *  `projects/[PROJECT_ID]`
+   * *  `organizations/[ORGANIZATION_ID]`
+   * *  `billingAccounts/[BILLING_ACCOUNT_ID]`
+   * *  `folders/[FOLDER_ID]`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. List of resource names to list logs for:
+   *
+   *  * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *
+   * To support legacy queries, it could also be:
+   *
+   * *  `projects/[PROJECT_ID]`
+   * *  `organizations/[ORGANIZATION_ID]`
+   * *  `billingAccounts/[BILLING_ACCOUNT_ID]`
+   * *  `folders/[FOLDER_ID]`
+   *
+   * The resource name in the `parent` field is added to this list.
+   * 
+ * + * + * repeated string resource_names = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return A list containing the resourceNames. + */ + java.util.List getResourceNamesList(); + + /** + * + * + *
+   * Optional. List of resource names to list logs for:
+   *
+   *  * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *
+   * To support legacy queries, it could also be:
+   *
+   * *  `projects/[PROJECT_ID]`
+   * *  `organizations/[ORGANIZATION_ID]`
+   * *  `billingAccounts/[BILLING_ACCOUNT_ID]`
+   * *  `folders/[FOLDER_ID]`
+   *
+   * The resource name in the `parent` field is added to this list.
+   * 
+ * + * + * repeated string resource_names = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The count of resourceNames. + */ + int getResourceNamesCount(); + + /** + * + * + *
+   * Optional. List of resource names to list logs for:
+   *
+   *  * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *
+   * To support legacy queries, it could also be:
+   *
+   * *  `projects/[PROJECT_ID]`
+   * *  `organizations/[ORGANIZATION_ID]`
+   * *  `billingAccounts/[BILLING_ACCOUNT_ID]`
+   * *  `folders/[FOLDER_ID]`
+   *
+   * The resource name in the `parent` field is added to this list.
+   * 
+ * + * + * repeated string resource_names = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the element to return. + * @return The resourceNames at the given index. + */ + java.lang.String getResourceNames(int index); + + /** + * + * + *
+   * Optional. List of resource names to list logs for:
+   *
+   *  * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *
+   * To support legacy queries, it could also be:
+   *
+   * *  `projects/[PROJECT_ID]`
+   * *  `organizations/[ORGANIZATION_ID]`
+   * *  `billingAccounts/[BILLING_ACCOUNT_ID]`
+   * *  `folders/[FOLDER_ID]`
+   *
+   * The resource name in the `parent` field is added to this list.
+   * 
+ * + * + * repeated string resource_names = 8 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param index The index of the value to return. + * @return The bytes of the resourceNames at the given index. + */ + com.google.protobuf.ByteString getResourceNamesBytes(int index); + + /** + * + * + *
+   * Optional. The maximum number of results to return from this request.
+   * Non-positive values are ignored.  The presence of `nextPageToken` in the
+   * response indicates that more results might be available.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. If present, then retrieve the next batch of results from the
+   * preceding call to this method.  `pageToken` must be the value of
+   * `nextPageToken` from the previous response.  The values of other method
+   * parameters should be identical to those in the previous call.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
+   * Optional. If present, then retrieve the next batch of results from the
+   * preceding call to this method.  `pageToken` must be the value of
+   * `nextPageToken` from the previous response.  The values of other method
+   * parameters should be identical to those in the previous call.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogsResponse.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogsResponse.java new file mode 100644 index 000000000000..0ed83ee850a4 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogsResponse.java @@ -0,0 +1,962 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * Result returned from ListLogs.
+ * 
+ * + * Protobuf type {@code google.logging.v2.ListLogsResponse} + */ +public final class ListLogsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.ListLogsResponse) + ListLogsResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ListLogsResponse.newBuilder() to construct. + private ListLogsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListLogsResponse() { + logNames_ = com.google.protobuf.LazyStringArrayList.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListLogsResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_ListLogsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_ListLogsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.ListLogsResponse.class, + com.google.logging.v2.ListLogsResponse.Builder.class); + } + + public static final int LOG_NAMES_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList logNames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+   * A list of log names. For example,
+   * `"projects/my-project/logs/syslog"` or
+   * `"organizations/123/logs/cloudresourcemanager.googleapis.com%2Factivity"`.
+   * 
+ * + * repeated string log_names = 3; + * + * @return A list containing the logNames. + */ + public com.google.protobuf.ProtocolStringList getLogNamesList() { + return logNames_; + } + + /** + * + * + *
+   * A list of log names. For example,
+   * `"projects/my-project/logs/syslog"` or
+   * `"organizations/123/logs/cloudresourcemanager.googleapis.com%2Factivity"`.
+   * 
+ * + * repeated string log_names = 3; + * + * @return The count of logNames. + */ + public int getLogNamesCount() { + return logNames_.size(); + } + + /** + * + * + *
+   * A list of log names. For example,
+   * `"projects/my-project/logs/syslog"` or
+   * `"organizations/123/logs/cloudresourcemanager.googleapis.com%2Factivity"`.
+   * 
+ * + * repeated string log_names = 3; + * + * @param index The index of the element to return. + * @return The logNames at the given index. + */ + public java.lang.String getLogNames(int index) { + return logNames_.get(index); + } + + /** + * + * + *
+   * A list of log names. For example,
+   * `"projects/my-project/logs/syslog"` or
+   * `"organizations/123/logs/cloudresourcemanager.googleapis.com%2Factivity"`.
+   * 
+ * + * repeated string log_names = 3; + * + * @param index The index of the value to return. + * @return The bytes of the logNames at the given index. + */ + public com.google.protobuf.ByteString getLogNamesBytes(int index) { + return logNames_.getByteString(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+   * If there might be more results than those appearing in this response, then
+   * `nextPageToken` is included.  To get the next set of results, call this
+   * method again using the value of `nextPageToken` as `pageToken`.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * If there might be more results than those appearing in this response, then
+   * `nextPageToken` is included.  To get the next set of results, call this
+   * method again using the value of `nextPageToken` as `pageToken`.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + for (int i = 0; i < logNames_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, logNames_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + { + int dataSize = 0; + for (int i = 0; i < logNames_.size(); i++) { + dataSize += computeStringSizeNoTag(logNames_.getRaw(i)); + } + size += dataSize; + size += 1 * getLogNamesList().size(); + } + size += getUnknownFields().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.logging.v2.ListLogsResponse)) { + return super.equals(obj); + } + com.google.logging.v2.ListLogsResponse other = (com.google.logging.v2.ListLogsResponse) obj; + + if (!getLogNamesList().equals(other.getLogNamesList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getLogNamesCount() > 0) { + hash = (37 * hash) + LOG_NAMES_FIELD_NUMBER; + hash = (53 * hash) + getLogNamesList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.ListLogsResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.ListLogsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.ListLogsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.ListLogsResponse 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.logging.v2.ListLogsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.ListLogsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.ListLogsResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.ListLogsResponse 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.logging.v2.ListLogsResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.ListLogsResponse 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.logging.v2.ListLogsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.ListLogsResponse 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.logging.v2.ListLogsResponse 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; + } + + /** + * + * + *
+   * Result returned from ListLogs.
+   * 
+ * + * Protobuf type {@code google.logging.v2.ListLogsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.ListLogsResponse) + com.google.logging.v2.ListLogsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_ListLogsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_ListLogsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.ListLogsResponse.class, + com.google.logging.v2.ListLogsResponse.Builder.class); + } + + // Construct using com.google.logging.v2.ListLogsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + logNames_ = com.google.protobuf.LazyStringArrayList.emptyList(); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_ListLogsResponse_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.ListLogsResponse getDefaultInstanceForType() { + return com.google.logging.v2.ListLogsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.ListLogsResponse build() { + com.google.logging.v2.ListLogsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.ListLogsResponse buildPartial() { + com.google.logging.v2.ListLogsResponse result = + new com.google.logging.v2.ListLogsResponse(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.logging.v2.ListLogsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + logNames_.makeImmutable(); + result.logNames_ = logNames_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @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.logging.v2.ListLogsResponse) { + return mergeFrom((com.google.logging.v2.ListLogsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.ListLogsResponse other) { + if (other == com.google.logging.v2.ListLogsResponse.getDefaultInstance()) return this; + if (!other.logNames_.isEmpty()) { + if (logNames_.isEmpty()) { + logNames_ = other.logNames_; + bitField0_ |= 0x00000001; + } else { + ensureLogNamesIsMutable(); + logNames_.addAll(other.logNames_); + } + onChanged(); + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureLogNamesIsMutable(); + logNames_.add(s); + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringArrayList logNames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureLogNamesIsMutable() { + if (!logNames_.isModifiable()) { + logNames_ = new com.google.protobuf.LazyStringArrayList(logNames_); + } + bitField0_ |= 0x00000001; + } + + /** + * + * + *
+     * A list of log names. For example,
+     * `"projects/my-project/logs/syslog"` or
+     * `"organizations/123/logs/cloudresourcemanager.googleapis.com%2Factivity"`.
+     * 
+ * + * repeated string log_names = 3; + * + * @return A list containing the logNames. + */ + public com.google.protobuf.ProtocolStringList getLogNamesList() { + logNames_.makeImmutable(); + return logNames_; + } + + /** + * + * + *
+     * A list of log names. For example,
+     * `"projects/my-project/logs/syslog"` or
+     * `"organizations/123/logs/cloudresourcemanager.googleapis.com%2Factivity"`.
+     * 
+ * + * repeated string log_names = 3; + * + * @return The count of logNames. + */ + public int getLogNamesCount() { + return logNames_.size(); + } + + /** + * + * + *
+     * A list of log names. For example,
+     * `"projects/my-project/logs/syslog"` or
+     * `"organizations/123/logs/cloudresourcemanager.googleapis.com%2Factivity"`.
+     * 
+ * + * repeated string log_names = 3; + * + * @param index The index of the element to return. + * @return The logNames at the given index. + */ + public java.lang.String getLogNames(int index) { + return logNames_.get(index); + } + + /** + * + * + *
+     * A list of log names. For example,
+     * `"projects/my-project/logs/syslog"` or
+     * `"organizations/123/logs/cloudresourcemanager.googleapis.com%2Factivity"`.
+     * 
+ * + * repeated string log_names = 3; + * + * @param index The index of the value to return. + * @return The bytes of the logNames at the given index. + */ + public com.google.protobuf.ByteString getLogNamesBytes(int index) { + return logNames_.getByteString(index); + } + + /** + * + * + *
+     * A list of log names. For example,
+     * `"projects/my-project/logs/syslog"` or
+     * `"organizations/123/logs/cloudresourcemanager.googleapis.com%2Factivity"`.
+     * 
+ * + * repeated string log_names = 3; + * + * @param index The index to set the value at. + * @param value The logNames to set. + * @return This builder for chaining. + */ + public Builder setLogNames(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureLogNamesIsMutable(); + logNames_.set(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * A list of log names. For example,
+     * `"projects/my-project/logs/syslog"` or
+     * `"organizations/123/logs/cloudresourcemanager.googleapis.com%2Factivity"`.
+     * 
+ * + * repeated string log_names = 3; + * + * @param value The logNames to add. + * @return This builder for chaining. + */ + public Builder addLogNames(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureLogNamesIsMutable(); + logNames_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * A list of log names. For example,
+     * `"projects/my-project/logs/syslog"` or
+     * `"organizations/123/logs/cloudresourcemanager.googleapis.com%2Factivity"`.
+     * 
+ * + * repeated string log_names = 3; + * + * @param values The logNames to add. + * @return This builder for chaining. + */ + public Builder addAllLogNames(java.lang.Iterable values) { + ensureLogNamesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, logNames_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * A list of log names. For example,
+     * `"projects/my-project/logs/syslog"` or
+     * `"organizations/123/logs/cloudresourcemanager.googleapis.com%2Factivity"`.
+     * 
+ * + * repeated string log_names = 3; + * + * @return This builder for chaining. + */ + public Builder clearLogNames() { + logNames_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + ; + onChanged(); + return this; + } + + /** + * + * + *
+     * A list of log names. For example,
+     * `"projects/my-project/logs/syslog"` or
+     * `"organizations/123/logs/cloudresourcemanager.googleapis.com%2Factivity"`.
+     * 
+ * + * repeated string log_names = 3; + * + * @param value The bytes of the logNames to add. + * @return This builder for chaining. + */ + public Builder addLogNamesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureLogNamesIsMutable(); + logNames_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+     * If there might be more results than those appearing in this response, then
+     * `nextPageToken` is included.  To get the next set of results, call this
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * If there might be more results than those appearing in this response, then
+     * `nextPageToken` is included.  To get the next set of results, call this
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * If there might be more results than those appearing in this response, then
+     * `nextPageToken` is included.  To get the next set of results, call this
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * If there might be more results than those appearing in this response, then
+     * `nextPageToken` is included.  To get the next set of results, call this
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * If there might be more results than those appearing in this response, then
+     * `nextPageToken` is included.  To get the next set of results, call this
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextPageToken_ = value; + bitField0_ |= 0x00000002; + 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.logging.v2.ListLogsResponse) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.ListLogsResponse) + private static final com.google.logging.v2.ListLogsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.ListLogsResponse(); + } + + public static com.google.logging.v2.ListLogsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListLogsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.ListLogsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogsResponseOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogsResponseOrBuilder.java new file mode 100644 index 000000000000..8ed3606e5c2d --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogsResponseOrBuilder.java @@ -0,0 +1,118 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface ListLogsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.ListLogsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A list of log names. For example,
+   * `"projects/my-project/logs/syslog"` or
+   * `"organizations/123/logs/cloudresourcemanager.googleapis.com%2Factivity"`.
+   * 
+ * + * repeated string log_names = 3; + * + * @return A list containing the logNames. + */ + java.util.List getLogNamesList(); + + /** + * + * + *
+   * A list of log names. For example,
+   * `"projects/my-project/logs/syslog"` or
+   * `"organizations/123/logs/cloudresourcemanager.googleapis.com%2Factivity"`.
+   * 
+ * + * repeated string log_names = 3; + * + * @return The count of logNames. + */ + int getLogNamesCount(); + + /** + * + * + *
+   * A list of log names. For example,
+   * `"projects/my-project/logs/syslog"` or
+   * `"organizations/123/logs/cloudresourcemanager.googleapis.com%2Factivity"`.
+   * 
+ * + * repeated string log_names = 3; + * + * @param index The index of the element to return. + * @return The logNames at the given index. + */ + java.lang.String getLogNames(int index); + + /** + * + * + *
+   * A list of log names. For example,
+   * `"projects/my-project/logs/syslog"` or
+   * `"organizations/123/logs/cloudresourcemanager.googleapis.com%2Factivity"`.
+   * 
+ * + * repeated string log_names = 3; + * + * @param index The index of the value to return. + * @return The bytes of the logNames at the given index. + */ + com.google.protobuf.ByteString getLogNamesBytes(int index); + + /** + * + * + *
+   * If there might be more results than those appearing in this response, then
+   * `nextPageToken` is included.  To get the next set of results, call this
+   * method again using the value of `nextPageToken` as `pageToken`.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
+   * If there might be more results than those appearing in this response, then
+   * `nextPageToken` is included.  To get the next set of results, call this
+   * method again using the value of `nextPageToken` as `pageToken`.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListMonitoredResourceDescriptorsRequest.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListMonitoredResourceDescriptorsRequest.java new file mode 100644 index 000000000000..36cc645145f6 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListMonitoredResourceDescriptorsRequest.java @@ -0,0 +1,767 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * The parameters to ListMonitoredResourceDescriptors
+ * 
+ * + * Protobuf type {@code google.logging.v2.ListMonitoredResourceDescriptorsRequest} + */ +public final class ListMonitoredResourceDescriptorsRequest + extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.ListMonitoredResourceDescriptorsRequest) + ListMonitoredResourceDescriptorsRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ListMonitoredResourceDescriptorsRequest.newBuilder() to construct. + private ListMonitoredResourceDescriptorsRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListMonitoredResourceDescriptorsRequest() { + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListMonitoredResourceDescriptorsRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_ListMonitoredResourceDescriptorsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_ListMonitoredResourceDescriptorsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.ListMonitoredResourceDescriptorsRequest.class, + com.google.logging.v2.ListMonitoredResourceDescriptorsRequest.Builder.class); + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 1; + private int pageSize_ = 0; + + /** + * + * + *
+   * Optional. The maximum number of results to return from this request.
+   * Non-positive values are ignored.  The presence of `nextPageToken` in the
+   * response indicates that more results might be available.
+   * 
+ * + * int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + + /** + * + * + *
+   * Optional. If present, then retrieve the next batch of results from the
+   * preceding call to this method.  `pageToken` must be the value of
+   * `nextPageToken` from the previous response.  The values of other method
+   * parameters should be identical to those in the previous call.
+   * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. If present, then retrieve the next batch of results from the
+   * preceding call to this method.  `pageToken` must be the value of
+   * `nextPageToken` from the previous response.  The values of other method
+   * parameters should be identical to those in the previous call.
+   * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (pageSize_ != 0) { + output.writeInt32(1, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, pageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, pageToken_); + } + size += getUnknownFields().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.logging.v2.ListMonitoredResourceDescriptorsRequest)) { + return super.equals(obj); + } + com.google.logging.v2.ListMonitoredResourceDescriptorsRequest other = + (com.google.logging.v2.ListMonitoredResourceDescriptorsRequest) obj; + + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.ListMonitoredResourceDescriptorsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.ListMonitoredResourceDescriptorsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.ListMonitoredResourceDescriptorsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.ListMonitoredResourceDescriptorsRequest 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.logging.v2.ListMonitoredResourceDescriptorsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.ListMonitoredResourceDescriptorsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.ListMonitoredResourceDescriptorsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.ListMonitoredResourceDescriptorsRequest 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.logging.v2.ListMonitoredResourceDescriptorsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.ListMonitoredResourceDescriptorsRequest 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.logging.v2.ListMonitoredResourceDescriptorsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.ListMonitoredResourceDescriptorsRequest 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.logging.v2.ListMonitoredResourceDescriptorsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The parameters to ListMonitoredResourceDescriptors
+   * 
+ * + * Protobuf type {@code google.logging.v2.ListMonitoredResourceDescriptorsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.ListMonitoredResourceDescriptorsRequest) + com.google.logging.v2.ListMonitoredResourceDescriptorsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_ListMonitoredResourceDescriptorsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_ListMonitoredResourceDescriptorsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.ListMonitoredResourceDescriptorsRequest.class, + com.google.logging.v2.ListMonitoredResourceDescriptorsRequest.Builder.class); + } + + // Construct using com.google.logging.v2.ListMonitoredResourceDescriptorsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + pageSize_ = 0; + pageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_ListMonitoredResourceDescriptorsRequest_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.ListMonitoredResourceDescriptorsRequest + getDefaultInstanceForType() { + return com.google.logging.v2.ListMonitoredResourceDescriptorsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.ListMonitoredResourceDescriptorsRequest build() { + com.google.logging.v2.ListMonitoredResourceDescriptorsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.ListMonitoredResourceDescriptorsRequest buildPartial() { + com.google.logging.v2.ListMonitoredResourceDescriptorsRequest result = + new com.google.logging.v2.ListMonitoredResourceDescriptorsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.logging.v2.ListMonitoredResourceDescriptorsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageToken_ = pageToken_; + } + } + + @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.logging.v2.ListMonitoredResourceDescriptorsRequest) { + return mergeFrom((com.google.logging.v2.ListMonitoredResourceDescriptorsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.ListMonitoredResourceDescriptorsRequest other) { + if (other + == com.google.logging.v2.ListMonitoredResourceDescriptorsRequest.getDefaultInstance()) + return this; + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int pageSize_; + + /** + * + * + *
+     * Optional. The maximum number of results to return from this request.
+     * Non-positive values are ignored.  The presence of `nextPageToken` in the
+     * response indicates that more results might be available.
+     * 
+ * + * int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + /** + * + * + *
+     * Optional. The maximum number of results to return from this request.
+     * Non-positive values are ignored.  The presence of `nextPageToken` in the
+     * response indicates that more results might be available.
+     * 
+ * + * int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The maximum number of results to return from this request.
+     * Non-positive values are ignored.  The presence of `nextPageToken` in the
+     * response indicates that more results might be available.
+     * 
+ * + * int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000001); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method.  `pageToken` must be the value of
+     * `nextPageToken` from the previous response.  The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method.  `pageToken` must be the value of
+     * `nextPageToken` from the previous response.  The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method.  `pageToken` must be the value of
+     * `nextPageToken` from the previous response.  The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method.  `pageToken` must be the value of
+     * `nextPageToken` from the previous response.  The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method.  `pageToken` must be the value of
+     * `nextPageToken` from the previous response.  The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000002; + 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.logging.v2.ListMonitoredResourceDescriptorsRequest) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.ListMonitoredResourceDescriptorsRequest) + private static final com.google.logging.v2.ListMonitoredResourceDescriptorsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.ListMonitoredResourceDescriptorsRequest(); + } + + public static com.google.logging.v2.ListMonitoredResourceDescriptorsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListMonitoredResourceDescriptorsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.ListMonitoredResourceDescriptorsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListMonitoredResourceDescriptorsRequestOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListMonitoredResourceDescriptorsRequestOrBuilder.java new file mode 100644 index 000000000000..f730f7ef6be8 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListMonitoredResourceDescriptorsRequestOrBuilder.java @@ -0,0 +1,73 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface ListMonitoredResourceDescriptorsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.ListMonitoredResourceDescriptorsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. The maximum number of results to return from this request.
+   * Non-positive values are ignored.  The presence of `nextPageToken` in the
+   * response indicates that more results might be available.
+   * 
+ * + * int32 page_size = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. If present, then retrieve the next batch of results from the
+   * preceding call to this method.  `pageToken` must be the value of
+   * `nextPageToken` from the previous response.  The values of other method
+   * parameters should be identical to those in the previous call.
+   * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
+   * Optional. If present, then retrieve the next batch of results from the
+   * preceding call to this method.  `pageToken` must be the value of
+   * `nextPageToken` from the previous response.  The values of other method
+   * parameters should be identical to those in the previous call.
+   * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListMonitoredResourceDescriptorsResponse.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListMonitoredResourceDescriptorsResponse.java new file mode 100644 index 000000000000..8b202f9a2ba3 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListMonitoredResourceDescriptorsResponse.java @@ -0,0 +1,1185 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * Result returned from ListMonitoredResourceDescriptors.
+ * 
+ * + * Protobuf type {@code google.logging.v2.ListMonitoredResourceDescriptorsResponse} + */ +public final class ListMonitoredResourceDescriptorsResponse + extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.ListMonitoredResourceDescriptorsResponse) + ListMonitoredResourceDescriptorsResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ListMonitoredResourceDescriptorsResponse.newBuilder() to construct. + private ListMonitoredResourceDescriptorsResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListMonitoredResourceDescriptorsResponse() { + resourceDescriptors_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListMonitoredResourceDescriptorsResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_ListMonitoredResourceDescriptorsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_ListMonitoredResourceDescriptorsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.ListMonitoredResourceDescriptorsResponse.class, + com.google.logging.v2.ListMonitoredResourceDescriptorsResponse.Builder.class); + } + + public static final int RESOURCE_DESCRIPTORS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List resourceDescriptors_; + + /** + * + * + *
+   * A list of resource descriptors.
+   * 
+ * + * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; + */ + @java.lang.Override + public java.util.List getResourceDescriptorsList() { + return resourceDescriptors_; + } + + /** + * + * + *
+   * A list of resource descriptors.
+   * 
+ * + * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; + */ + @java.lang.Override + public java.util.List + getResourceDescriptorsOrBuilderList() { + return resourceDescriptors_; + } + + /** + * + * + *
+   * A list of resource descriptors.
+   * 
+ * + * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; + */ + @java.lang.Override + public int getResourceDescriptorsCount() { + return resourceDescriptors_.size(); + } + + /** + * + * + *
+   * A list of resource descriptors.
+   * 
+ * + * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; + */ + @java.lang.Override + public com.google.api.MonitoredResourceDescriptor getResourceDescriptors(int index) { + return resourceDescriptors_.get(index); + } + + /** + * + * + *
+   * A list of resource descriptors.
+   * 
+ * + * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; + */ + @java.lang.Override + public com.google.api.MonitoredResourceDescriptorOrBuilder getResourceDescriptorsOrBuilder( + int index) { + return resourceDescriptors_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+   * If there might be more results than those appearing in this response, then
+   * `nextPageToken` is included.  To get the next set of results, call this
+   * method again using the value of `nextPageToken` as `pageToken`.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * If there might be more results than those appearing in this response, then
+   * `nextPageToken` is included.  To get the next set of results, call this
+   * method again using the value of `nextPageToken` as `pageToken`.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < resourceDescriptors_.size(); i++) { + output.writeMessage(1, resourceDescriptors_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < resourceDescriptors_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(1, resourceDescriptors_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += getUnknownFields().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.logging.v2.ListMonitoredResourceDescriptorsResponse)) { + return super.equals(obj); + } + com.google.logging.v2.ListMonitoredResourceDescriptorsResponse other = + (com.google.logging.v2.ListMonitoredResourceDescriptorsResponse) obj; + + if (!getResourceDescriptorsList().equals(other.getResourceDescriptorsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getResourceDescriptorsCount() > 0) { + hash = (37 * hash) + RESOURCE_DESCRIPTORS_FIELD_NUMBER; + hash = (53 * hash) + getResourceDescriptorsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.ListMonitoredResourceDescriptorsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.ListMonitoredResourceDescriptorsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.ListMonitoredResourceDescriptorsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.ListMonitoredResourceDescriptorsResponse 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.logging.v2.ListMonitoredResourceDescriptorsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.ListMonitoredResourceDescriptorsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.ListMonitoredResourceDescriptorsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.ListMonitoredResourceDescriptorsResponse 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.logging.v2.ListMonitoredResourceDescriptorsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.ListMonitoredResourceDescriptorsResponse 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.logging.v2.ListMonitoredResourceDescriptorsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.ListMonitoredResourceDescriptorsResponse 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.logging.v2.ListMonitoredResourceDescriptorsResponse 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; + } + + /** + * + * + *
+   * Result returned from ListMonitoredResourceDescriptors.
+   * 
+ * + * Protobuf type {@code google.logging.v2.ListMonitoredResourceDescriptorsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.ListMonitoredResourceDescriptorsResponse) + com.google.logging.v2.ListMonitoredResourceDescriptorsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_ListMonitoredResourceDescriptorsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_ListMonitoredResourceDescriptorsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.ListMonitoredResourceDescriptorsResponse.class, + com.google.logging.v2.ListMonitoredResourceDescriptorsResponse.Builder.class); + } + + // Construct using com.google.logging.v2.ListMonitoredResourceDescriptorsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (resourceDescriptorsBuilder_ == null) { + resourceDescriptors_ = java.util.Collections.emptyList(); + } else { + resourceDescriptors_ = null; + resourceDescriptorsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_ListMonitoredResourceDescriptorsResponse_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.ListMonitoredResourceDescriptorsResponse + getDefaultInstanceForType() { + return com.google.logging.v2.ListMonitoredResourceDescriptorsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.ListMonitoredResourceDescriptorsResponse build() { + com.google.logging.v2.ListMonitoredResourceDescriptorsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.ListMonitoredResourceDescriptorsResponse buildPartial() { + com.google.logging.v2.ListMonitoredResourceDescriptorsResponse result = + new com.google.logging.v2.ListMonitoredResourceDescriptorsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.logging.v2.ListMonitoredResourceDescriptorsResponse result) { + if (resourceDescriptorsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + resourceDescriptors_ = java.util.Collections.unmodifiableList(resourceDescriptors_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.resourceDescriptors_ = resourceDescriptors_; + } else { + result.resourceDescriptors_ = resourceDescriptorsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.logging.v2.ListMonitoredResourceDescriptorsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @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.logging.v2.ListMonitoredResourceDescriptorsResponse) { + return mergeFrom((com.google.logging.v2.ListMonitoredResourceDescriptorsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.ListMonitoredResourceDescriptorsResponse other) { + if (other + == com.google.logging.v2.ListMonitoredResourceDescriptorsResponse.getDefaultInstance()) + return this; + if (resourceDescriptorsBuilder_ == null) { + if (!other.resourceDescriptors_.isEmpty()) { + if (resourceDescriptors_.isEmpty()) { + resourceDescriptors_ = other.resourceDescriptors_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureResourceDescriptorsIsMutable(); + resourceDescriptors_.addAll(other.resourceDescriptors_); + } + onChanged(); + } + } else { + if (!other.resourceDescriptors_.isEmpty()) { + if (resourceDescriptorsBuilder_.isEmpty()) { + resourceDescriptorsBuilder_.dispose(); + resourceDescriptorsBuilder_ = null; + resourceDescriptors_ = other.resourceDescriptors_; + bitField0_ = (bitField0_ & ~0x00000001); + resourceDescriptorsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getResourceDescriptorsFieldBuilder() + : null; + } else { + resourceDescriptorsBuilder_.addAllMessages(other.resourceDescriptors_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.api.MonitoredResourceDescriptor m = + input.readMessage( + com.google.api.MonitoredResourceDescriptor.parser(), extensionRegistry); + if (resourceDescriptorsBuilder_ == null) { + ensureResourceDescriptorsIsMutable(); + resourceDescriptors_.add(m); + } else { + resourceDescriptorsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List resourceDescriptors_ = + java.util.Collections.emptyList(); + + private void ensureResourceDescriptorsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + resourceDescriptors_ = + new java.util.ArrayList( + resourceDescriptors_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.MonitoredResourceDescriptor, + com.google.api.MonitoredResourceDescriptor.Builder, + com.google.api.MonitoredResourceDescriptorOrBuilder> + resourceDescriptorsBuilder_; + + /** + * + * + *
+     * A list of resource descriptors.
+     * 
+ * + * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; + */ + public java.util.List getResourceDescriptorsList() { + if (resourceDescriptorsBuilder_ == null) { + return java.util.Collections.unmodifiableList(resourceDescriptors_); + } else { + return resourceDescriptorsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * A list of resource descriptors.
+     * 
+ * + * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; + */ + public int getResourceDescriptorsCount() { + if (resourceDescriptorsBuilder_ == null) { + return resourceDescriptors_.size(); + } else { + return resourceDescriptorsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * A list of resource descriptors.
+     * 
+ * + * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; + */ + public com.google.api.MonitoredResourceDescriptor getResourceDescriptors(int index) { + if (resourceDescriptorsBuilder_ == null) { + return resourceDescriptors_.get(index); + } else { + return resourceDescriptorsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * A list of resource descriptors.
+     * 
+ * + * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; + */ + public Builder setResourceDescriptors( + int index, com.google.api.MonitoredResourceDescriptor value) { + if (resourceDescriptorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResourceDescriptorsIsMutable(); + resourceDescriptors_.set(index, value); + onChanged(); + } else { + resourceDescriptorsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * A list of resource descriptors.
+     * 
+ * + * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; + */ + public Builder setResourceDescriptors( + int index, com.google.api.MonitoredResourceDescriptor.Builder builderForValue) { + if (resourceDescriptorsBuilder_ == null) { + ensureResourceDescriptorsIsMutable(); + resourceDescriptors_.set(index, builderForValue.build()); + onChanged(); + } else { + resourceDescriptorsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of resource descriptors.
+     * 
+ * + * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; + */ + public Builder addResourceDescriptors(com.google.api.MonitoredResourceDescriptor value) { + if (resourceDescriptorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResourceDescriptorsIsMutable(); + resourceDescriptors_.add(value); + onChanged(); + } else { + resourceDescriptorsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * A list of resource descriptors.
+     * 
+ * + * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; + */ + public Builder addResourceDescriptors( + int index, com.google.api.MonitoredResourceDescriptor value) { + if (resourceDescriptorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureResourceDescriptorsIsMutable(); + resourceDescriptors_.add(index, value); + onChanged(); + } else { + resourceDescriptorsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * A list of resource descriptors.
+     * 
+ * + * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; + */ + public Builder addResourceDescriptors( + com.google.api.MonitoredResourceDescriptor.Builder builderForValue) { + if (resourceDescriptorsBuilder_ == null) { + ensureResourceDescriptorsIsMutable(); + resourceDescriptors_.add(builderForValue.build()); + onChanged(); + } else { + resourceDescriptorsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of resource descriptors.
+     * 
+ * + * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; + */ + public Builder addResourceDescriptors( + int index, com.google.api.MonitoredResourceDescriptor.Builder builderForValue) { + if (resourceDescriptorsBuilder_ == null) { + ensureResourceDescriptorsIsMutable(); + resourceDescriptors_.add(index, builderForValue.build()); + onChanged(); + } else { + resourceDescriptorsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of resource descriptors.
+     * 
+ * + * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; + */ + public Builder addAllResourceDescriptors( + java.lang.Iterable values) { + if (resourceDescriptorsBuilder_ == null) { + ensureResourceDescriptorsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, resourceDescriptors_); + onChanged(); + } else { + resourceDescriptorsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * A list of resource descriptors.
+     * 
+ * + * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; + */ + public Builder clearResourceDescriptors() { + if (resourceDescriptorsBuilder_ == null) { + resourceDescriptors_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + resourceDescriptorsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * A list of resource descriptors.
+     * 
+ * + * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; + */ + public Builder removeResourceDescriptors(int index) { + if (resourceDescriptorsBuilder_ == null) { + ensureResourceDescriptorsIsMutable(); + resourceDescriptors_.remove(index); + onChanged(); + } else { + resourceDescriptorsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * A list of resource descriptors.
+     * 
+ * + * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; + */ + public com.google.api.MonitoredResourceDescriptor.Builder getResourceDescriptorsBuilder( + int index) { + return getResourceDescriptorsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * A list of resource descriptors.
+     * 
+ * + * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; + */ + public com.google.api.MonitoredResourceDescriptorOrBuilder getResourceDescriptorsOrBuilder( + int index) { + if (resourceDescriptorsBuilder_ == null) { + return resourceDescriptors_.get(index); + } else { + return resourceDescriptorsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * A list of resource descriptors.
+     * 
+ * + * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; + */ + public java.util.List + getResourceDescriptorsOrBuilderList() { + if (resourceDescriptorsBuilder_ != null) { + return resourceDescriptorsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(resourceDescriptors_); + } + } + + /** + * + * + *
+     * A list of resource descriptors.
+     * 
+ * + * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; + */ + public com.google.api.MonitoredResourceDescriptor.Builder addResourceDescriptorsBuilder() { + return getResourceDescriptorsFieldBuilder() + .addBuilder(com.google.api.MonitoredResourceDescriptor.getDefaultInstance()); + } + + /** + * + * + *
+     * A list of resource descriptors.
+     * 
+ * + * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; + */ + public com.google.api.MonitoredResourceDescriptor.Builder addResourceDescriptorsBuilder( + int index) { + return getResourceDescriptorsFieldBuilder() + .addBuilder(index, com.google.api.MonitoredResourceDescriptor.getDefaultInstance()); + } + + /** + * + * + *
+     * A list of resource descriptors.
+     * 
+ * + * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; + */ + public java.util.List + getResourceDescriptorsBuilderList() { + return getResourceDescriptorsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.MonitoredResourceDescriptor, + com.google.api.MonitoredResourceDescriptor.Builder, + com.google.api.MonitoredResourceDescriptorOrBuilder> + getResourceDescriptorsFieldBuilder() { + if (resourceDescriptorsBuilder_ == null) { + resourceDescriptorsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.MonitoredResourceDescriptor, + com.google.api.MonitoredResourceDescriptor.Builder, + com.google.api.MonitoredResourceDescriptorOrBuilder>( + resourceDescriptors_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + resourceDescriptors_ = null; + } + return resourceDescriptorsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+     * If there might be more results than those appearing in this response, then
+     * `nextPageToken` is included.  To get the next set of results, call this
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * If there might be more results than those appearing in this response, then
+     * `nextPageToken` is included.  To get the next set of results, call this
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * If there might be more results than those appearing in this response, then
+     * `nextPageToken` is included.  To get the next set of results, call this
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * If there might be more results than those appearing in this response, then
+     * `nextPageToken` is included.  To get the next set of results, call this
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * If there might be more results than those appearing in this response, then
+     * `nextPageToken` is included.  To get the next set of results, call this
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextPageToken_ = value; + bitField0_ |= 0x00000002; + 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.logging.v2.ListMonitoredResourceDescriptorsResponse) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.ListMonitoredResourceDescriptorsResponse) + private static final com.google.logging.v2.ListMonitoredResourceDescriptorsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.ListMonitoredResourceDescriptorsResponse(); + } + + public static com.google.logging.v2.ListMonitoredResourceDescriptorsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListMonitoredResourceDescriptorsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.ListMonitoredResourceDescriptorsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListMonitoredResourceDescriptorsResponseOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListMonitoredResourceDescriptorsResponseOrBuilder.java new file mode 100644 index 000000000000..a27d2848044d --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListMonitoredResourceDescriptorsResponseOrBuilder.java @@ -0,0 +1,112 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface ListMonitoredResourceDescriptorsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.ListMonitoredResourceDescriptorsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A list of resource descriptors.
+   * 
+ * + * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; + */ + java.util.List getResourceDescriptorsList(); + + /** + * + * + *
+   * A list of resource descriptors.
+   * 
+ * + * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; + */ + com.google.api.MonitoredResourceDescriptor getResourceDescriptors(int index); + + /** + * + * + *
+   * A list of resource descriptors.
+   * 
+ * + * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; + */ + int getResourceDescriptorsCount(); + + /** + * + * + *
+   * A list of resource descriptors.
+   * 
+ * + * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; + */ + java.util.List + getResourceDescriptorsOrBuilderList(); + + /** + * + * + *
+   * A list of resource descriptors.
+   * 
+ * + * repeated .google.api.MonitoredResourceDescriptor resource_descriptors = 1; + */ + com.google.api.MonitoredResourceDescriptorOrBuilder getResourceDescriptorsOrBuilder(int index); + + /** + * + * + *
+   * If there might be more results than those appearing in this response, then
+   * `nextPageToken` is included.  To get the next set of results, call this
+   * method again using the value of `nextPageToken` as `pageToken`.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
+   * If there might be more results than those appearing in this response, then
+   * `nextPageToken` is included.  To get the next set of results, call this
+   * method again using the value of `nextPageToken` as `pageToken`.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListSinksRequest.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListSinksRequest.java new file mode 100644 index 000000000000..1ec74430adb1 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListSinksRequest.java @@ -0,0 +1,996 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * The parameters to `ListSinks`.
+ * 
+ * + * Protobuf type {@code google.logging.v2.ListSinksRequest} + */ +public final class ListSinksRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.ListSinksRequest) + ListSinksRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ListSinksRequest.newBuilder() to construct. + private ListSinksRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListSinksRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListSinksRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_ListSinksRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_ListSinksRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.ListSinksRequest.class, + com.google.logging.v2.ListSinksRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
+   * Required. The parent resource whose sinks are to be listed:
+   *
+   *     "projects/[PROJECT_ID]"
+   *     "organizations/[ORGANIZATION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+   *     "folders/[FOLDER_ID]"
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The parent resource whose sinks are to be listed:
+   *
+   *     "projects/[PROJECT_ID]"
+   *     "organizations/[ORGANIZATION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+   *     "folders/[FOLDER_ID]"
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + + /** + * + * + *
+   * Optional. If present, then retrieve the next batch of results from the
+   * preceding call to this method. `pageToken` must be the value of
+   * `nextPageToken` from the previous response. The values of other method
+   * parameters should be identical to those in the previous call.
+   * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. If present, then retrieve the next batch of results from the
+   * preceding call to this method. `pageToken` must be the value of
+   * `nextPageToken` from the previous response. The values of other method
+   * parameters should be identical to those in the previous call.
+   * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 3; + private int pageSize_ = 0; + + /** + * + * + *
+   * Optional. The maximum number of results to return from this request.
+   * Non-positive values are ignored. The presence of `nextPageToken` in the
+   * response indicates that more results might be available.
+   * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, pageToken_); + } + if (pageSize_ != 0) { + output.writeInt32(3, pageSize_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, pageToken_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, pageSize_); + } + size += getUnknownFields().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.logging.v2.ListSinksRequest)) { + return super.equals(obj); + } + com.google.logging.v2.ListSinksRequest other = (com.google.logging.v2.ListSinksRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.ListSinksRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.ListSinksRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.ListSinksRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.ListSinksRequest 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.logging.v2.ListSinksRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.ListSinksRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.ListSinksRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.ListSinksRequest 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.logging.v2.ListSinksRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.ListSinksRequest 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.logging.v2.ListSinksRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.ListSinksRequest 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.logging.v2.ListSinksRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The parameters to `ListSinks`.
+   * 
+ * + * Protobuf type {@code google.logging.v2.ListSinksRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.ListSinksRequest) + com.google.logging.v2.ListSinksRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_ListSinksRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_ListSinksRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.ListSinksRequest.class, + com.google.logging.v2.ListSinksRequest.Builder.class); + } + + // Construct using com.google.logging.v2.ListSinksRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageToken_ = ""; + pageSize_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_ListSinksRequest_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.ListSinksRequest getDefaultInstanceForType() { + return com.google.logging.v2.ListSinksRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.ListSinksRequest build() { + com.google.logging.v2.ListSinksRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.ListSinksRequest buildPartial() { + com.google.logging.v2.ListSinksRequest result = + new com.google.logging.v2.ListSinksRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.logging.v2.ListSinksRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageToken_ = pageToken_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageSize_ = pageSize_; + } + } + + @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.logging.v2.ListSinksRequest) { + return mergeFrom((com.google.logging.v2.ListSinksRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.ListSinksRequest other) { + if (other == com.google.logging.v2.ListSinksRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + + /** + * + * + *
+     * Required. The parent resource whose sinks are to be listed:
+     *
+     *     "projects/[PROJECT_ID]"
+     *     "organizations/[ORGANIZATION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+     *     "folders/[FOLDER_ID]"
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The parent resource whose sinks are to be listed:
+     *
+     *     "projects/[PROJECT_ID]"
+     *     "organizations/[ORGANIZATION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+     *     "folders/[FOLDER_ID]"
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The parent resource whose sinks are to be listed:
+     *
+     *     "projects/[PROJECT_ID]"
+     *     "organizations/[ORGANIZATION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+     *     "folders/[FOLDER_ID]"
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The parent resource whose sinks are to be listed:
+     *
+     *     "projects/[PROJECT_ID]"
+     *     "organizations/[ORGANIZATION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+     *     "folders/[FOLDER_ID]"
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The parent resource whose sinks are to be listed:
+     *
+     *     "projects/[PROJECT_ID]"
+     *     "organizations/[ORGANIZATION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+     *     "folders/[FOLDER_ID]"
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method. `pageToken` must be the value of
+     * `nextPageToken` from the previous response. The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method. `pageToken` must be the value of
+     * `nextPageToken` from the previous response. The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method. `pageToken` must be the value of
+     * `nextPageToken` from the previous response. The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method. `pageToken` must be the value of
+     * `nextPageToken` from the previous response. The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method. `pageToken` must be the value of
+     * `nextPageToken` from the previous response. The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int pageSize_; + + /** + * + * + *
+     * Optional. The maximum number of results to return from this request.
+     * Non-positive values are ignored. The presence of `nextPageToken` in the
+     * response indicates that more results might be available.
+     * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + /** + * + * + *
+     * Optional. The maximum number of results to return from this request.
+     * Non-positive values are ignored. The presence of `nextPageToken` in the
+     * response indicates that more results might be available.
+     * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The maximum number of results to return from this request.
+     * Non-positive values are ignored. The presence of `nextPageToken` in the
+     * response indicates that more results might be available.
+     * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000004); + pageSize_ = 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.logging.v2.ListSinksRequest) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.ListSinksRequest) + private static final com.google.logging.v2.ListSinksRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.ListSinksRequest(); + } + + public static com.google.logging.v2.ListSinksRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListSinksRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.ListSinksRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListSinksRequestOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListSinksRequestOrBuilder.java new file mode 100644 index 000000000000..e319319df846 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListSinksRequestOrBuilder.java @@ -0,0 +1,113 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface ListSinksRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.ListSinksRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource whose sinks are to be listed:
+   *
+   *     "projects/[PROJECT_ID]"
+   *     "organizations/[ORGANIZATION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+   *     "folders/[FOLDER_ID]"
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
+   * Required. The parent resource whose sinks are to be listed:
+   *
+   *     "projects/[PROJECT_ID]"
+   *     "organizations/[ORGANIZATION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]"
+   *     "folders/[FOLDER_ID]"
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. If present, then retrieve the next batch of results from the
+   * preceding call to this method. `pageToken` must be the value of
+   * `nextPageToken` from the previous response. The values of other method
+   * parameters should be identical to those in the previous call.
+   * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
+   * Optional. If present, then retrieve the next batch of results from the
+   * preceding call to this method. `pageToken` must be the value of
+   * `nextPageToken` from the previous response. The values of other method
+   * parameters should be identical to those in the previous call.
+   * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Optional. The maximum number of results to return from this request.
+   * Non-positive values are ignored. The presence of `nextPageToken` in the
+   * response indicates that more results might be available.
+   * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListSinksResponse.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListSinksResponse.java new file mode 100644 index 000000000000..b6fc17af1859 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListSinksResponse.java @@ -0,0 +1,1153 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * Result returned from `ListSinks`.
+ * 
+ * + * Protobuf type {@code google.logging.v2.ListSinksResponse} + */ +public final class ListSinksResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.ListSinksResponse) + ListSinksResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ListSinksResponse.newBuilder() to construct. + private ListSinksResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListSinksResponse() { + sinks_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListSinksResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_ListSinksResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_ListSinksResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.ListSinksResponse.class, + com.google.logging.v2.ListSinksResponse.Builder.class); + } + + public static final int SINKS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List sinks_; + + /** + * + * + *
+   * A list of sinks.
+   * 
+ * + * repeated .google.logging.v2.LogSink sinks = 1; + */ + @java.lang.Override + public java.util.List getSinksList() { + return sinks_; + } + + /** + * + * + *
+   * A list of sinks.
+   * 
+ * + * repeated .google.logging.v2.LogSink sinks = 1; + */ + @java.lang.Override + public java.util.List getSinksOrBuilderList() { + return sinks_; + } + + /** + * + * + *
+   * A list of sinks.
+   * 
+ * + * repeated .google.logging.v2.LogSink sinks = 1; + */ + @java.lang.Override + public int getSinksCount() { + return sinks_.size(); + } + + /** + * + * + *
+   * A list of sinks.
+   * 
+ * + * repeated .google.logging.v2.LogSink sinks = 1; + */ + @java.lang.Override + public com.google.logging.v2.LogSink getSinks(int index) { + return sinks_.get(index); + } + + /** + * + * + *
+   * A list of sinks.
+   * 
+ * + * repeated .google.logging.v2.LogSink sinks = 1; + */ + @java.lang.Override + public com.google.logging.v2.LogSinkOrBuilder getSinksOrBuilder(int index) { + return sinks_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+   * If there might be more results than appear in this response, then
+   * `nextPageToken` is included. To get the next set of results, call the same
+   * method again using the value of `nextPageToken` as `pageToken`.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * If there might be more results than appear in this response, then
+   * `nextPageToken` is included. To get the next set of results, call the same
+   * method again using the value of `nextPageToken` as `pageToken`.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < sinks_.size(); i++) { + output.writeMessage(1, sinks_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < sinks_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, sinks_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += getUnknownFields().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.logging.v2.ListSinksResponse)) { + return super.equals(obj); + } + com.google.logging.v2.ListSinksResponse other = (com.google.logging.v2.ListSinksResponse) obj; + + if (!getSinksList().equals(other.getSinksList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getSinksCount() > 0) { + hash = (37 * hash) + SINKS_FIELD_NUMBER; + hash = (53 * hash) + getSinksList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.ListSinksResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.ListSinksResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.ListSinksResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.ListSinksResponse 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.logging.v2.ListSinksResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.ListSinksResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.ListSinksResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.ListSinksResponse 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.logging.v2.ListSinksResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.ListSinksResponse 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.logging.v2.ListSinksResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.ListSinksResponse 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.logging.v2.ListSinksResponse 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; + } + + /** + * + * + *
+   * Result returned from `ListSinks`.
+   * 
+ * + * Protobuf type {@code google.logging.v2.ListSinksResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.ListSinksResponse) + com.google.logging.v2.ListSinksResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_ListSinksResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_ListSinksResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.ListSinksResponse.class, + com.google.logging.v2.ListSinksResponse.Builder.class); + } + + // Construct using com.google.logging.v2.ListSinksResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (sinksBuilder_ == null) { + sinks_ = java.util.Collections.emptyList(); + } else { + sinks_ = null; + sinksBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_ListSinksResponse_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.ListSinksResponse getDefaultInstanceForType() { + return com.google.logging.v2.ListSinksResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.ListSinksResponse build() { + com.google.logging.v2.ListSinksResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.ListSinksResponse buildPartial() { + com.google.logging.v2.ListSinksResponse result = + new com.google.logging.v2.ListSinksResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.logging.v2.ListSinksResponse result) { + if (sinksBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + sinks_ = java.util.Collections.unmodifiableList(sinks_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.sinks_ = sinks_; + } else { + result.sinks_ = sinksBuilder_.build(); + } + } + + private void buildPartial0(com.google.logging.v2.ListSinksResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @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.logging.v2.ListSinksResponse) { + return mergeFrom((com.google.logging.v2.ListSinksResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.ListSinksResponse other) { + if (other == com.google.logging.v2.ListSinksResponse.getDefaultInstance()) return this; + if (sinksBuilder_ == null) { + if (!other.sinks_.isEmpty()) { + if (sinks_.isEmpty()) { + sinks_ = other.sinks_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSinksIsMutable(); + sinks_.addAll(other.sinks_); + } + onChanged(); + } + } else { + if (!other.sinks_.isEmpty()) { + if (sinksBuilder_.isEmpty()) { + sinksBuilder_.dispose(); + sinksBuilder_ = null; + sinks_ = other.sinks_; + bitField0_ = (bitField0_ & ~0x00000001); + sinksBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getSinksFieldBuilder() + : null; + } else { + sinksBuilder_.addAllMessages(other.sinks_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.logging.v2.LogSink m = + input.readMessage(com.google.logging.v2.LogSink.parser(), extensionRegistry); + if (sinksBuilder_ == null) { + ensureSinksIsMutable(); + sinks_.add(m); + } else { + sinksBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List sinks_ = + java.util.Collections.emptyList(); + + private void ensureSinksIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + sinks_ = new java.util.ArrayList(sinks_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.logging.v2.LogSink, + com.google.logging.v2.LogSink.Builder, + com.google.logging.v2.LogSinkOrBuilder> + sinksBuilder_; + + /** + * + * + *
+     * A list of sinks.
+     * 
+ * + * repeated .google.logging.v2.LogSink sinks = 1; + */ + public java.util.List getSinksList() { + if (sinksBuilder_ == null) { + return java.util.Collections.unmodifiableList(sinks_); + } else { + return sinksBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * A list of sinks.
+     * 
+ * + * repeated .google.logging.v2.LogSink sinks = 1; + */ + public int getSinksCount() { + if (sinksBuilder_ == null) { + return sinks_.size(); + } else { + return sinksBuilder_.getCount(); + } + } + + /** + * + * + *
+     * A list of sinks.
+     * 
+ * + * repeated .google.logging.v2.LogSink sinks = 1; + */ + public com.google.logging.v2.LogSink getSinks(int index) { + if (sinksBuilder_ == null) { + return sinks_.get(index); + } else { + return sinksBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * A list of sinks.
+     * 
+ * + * repeated .google.logging.v2.LogSink sinks = 1; + */ + public Builder setSinks(int index, com.google.logging.v2.LogSink value) { + if (sinksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSinksIsMutable(); + sinks_.set(index, value); + onChanged(); + } else { + sinksBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * A list of sinks.
+     * 
+ * + * repeated .google.logging.v2.LogSink sinks = 1; + */ + public Builder setSinks(int index, com.google.logging.v2.LogSink.Builder builderForValue) { + if (sinksBuilder_ == null) { + ensureSinksIsMutable(); + sinks_.set(index, builderForValue.build()); + onChanged(); + } else { + sinksBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of sinks.
+     * 
+ * + * repeated .google.logging.v2.LogSink sinks = 1; + */ + public Builder addSinks(com.google.logging.v2.LogSink value) { + if (sinksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSinksIsMutable(); + sinks_.add(value); + onChanged(); + } else { + sinksBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * A list of sinks.
+     * 
+ * + * repeated .google.logging.v2.LogSink sinks = 1; + */ + public Builder addSinks(int index, com.google.logging.v2.LogSink value) { + if (sinksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSinksIsMutable(); + sinks_.add(index, value); + onChanged(); + } else { + sinksBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * A list of sinks.
+     * 
+ * + * repeated .google.logging.v2.LogSink sinks = 1; + */ + public Builder addSinks(com.google.logging.v2.LogSink.Builder builderForValue) { + if (sinksBuilder_ == null) { + ensureSinksIsMutable(); + sinks_.add(builderForValue.build()); + onChanged(); + } else { + sinksBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of sinks.
+     * 
+ * + * repeated .google.logging.v2.LogSink sinks = 1; + */ + public Builder addSinks(int index, com.google.logging.v2.LogSink.Builder builderForValue) { + if (sinksBuilder_ == null) { + ensureSinksIsMutable(); + sinks_.add(index, builderForValue.build()); + onChanged(); + } else { + sinksBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of sinks.
+     * 
+ * + * repeated .google.logging.v2.LogSink sinks = 1; + */ + public Builder addAllSinks(java.lang.Iterable values) { + if (sinksBuilder_ == null) { + ensureSinksIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, sinks_); + onChanged(); + } else { + sinksBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * A list of sinks.
+     * 
+ * + * repeated .google.logging.v2.LogSink sinks = 1; + */ + public Builder clearSinks() { + if (sinksBuilder_ == null) { + sinks_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + sinksBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * A list of sinks.
+     * 
+ * + * repeated .google.logging.v2.LogSink sinks = 1; + */ + public Builder removeSinks(int index) { + if (sinksBuilder_ == null) { + ensureSinksIsMutable(); + sinks_.remove(index); + onChanged(); + } else { + sinksBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * A list of sinks.
+     * 
+ * + * repeated .google.logging.v2.LogSink sinks = 1; + */ + public com.google.logging.v2.LogSink.Builder getSinksBuilder(int index) { + return getSinksFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * A list of sinks.
+     * 
+ * + * repeated .google.logging.v2.LogSink sinks = 1; + */ + public com.google.logging.v2.LogSinkOrBuilder getSinksOrBuilder(int index) { + if (sinksBuilder_ == null) { + return sinks_.get(index); + } else { + return sinksBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * A list of sinks.
+     * 
+ * + * repeated .google.logging.v2.LogSink sinks = 1; + */ + public java.util.List + getSinksOrBuilderList() { + if (sinksBuilder_ != null) { + return sinksBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(sinks_); + } + } + + /** + * + * + *
+     * A list of sinks.
+     * 
+ * + * repeated .google.logging.v2.LogSink sinks = 1; + */ + public com.google.logging.v2.LogSink.Builder addSinksBuilder() { + return getSinksFieldBuilder().addBuilder(com.google.logging.v2.LogSink.getDefaultInstance()); + } + + /** + * + * + *
+     * A list of sinks.
+     * 
+ * + * repeated .google.logging.v2.LogSink sinks = 1; + */ + public com.google.logging.v2.LogSink.Builder addSinksBuilder(int index) { + return getSinksFieldBuilder() + .addBuilder(index, com.google.logging.v2.LogSink.getDefaultInstance()); + } + + /** + * + * + *
+     * A list of sinks.
+     * 
+ * + * repeated .google.logging.v2.LogSink sinks = 1; + */ + public java.util.List getSinksBuilderList() { + return getSinksFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.logging.v2.LogSink, + com.google.logging.v2.LogSink.Builder, + com.google.logging.v2.LogSinkOrBuilder> + getSinksFieldBuilder() { + if (sinksBuilder_ == null) { + sinksBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.logging.v2.LogSink, + com.google.logging.v2.LogSink.Builder, + com.google.logging.v2.LogSinkOrBuilder>( + sinks_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + sinks_ = null; + } + return sinksBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+     * If there might be more results than appear in this response, then
+     * `nextPageToken` is included. To get the next set of results, call the same
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * If there might be more results than appear in this response, then
+     * `nextPageToken` is included. To get the next set of results, call the same
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * If there might be more results than appear in this response, then
+     * `nextPageToken` is included. To get the next set of results, call the same
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * If there might be more results than appear in this response, then
+     * `nextPageToken` is included. To get the next set of results, call the same
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * If there might be more results than appear in this response, then
+     * `nextPageToken` is included. To get the next set of results, call the same
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextPageToken_ = value; + bitField0_ |= 0x00000002; + 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.logging.v2.ListSinksResponse) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.ListSinksResponse) + private static final com.google.logging.v2.ListSinksResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.ListSinksResponse(); + } + + public static com.google.logging.v2.ListSinksResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListSinksResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.ListSinksResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListSinksResponseOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListSinksResponseOrBuilder.java new file mode 100644 index 000000000000..c2a8c4a1f2db --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListSinksResponseOrBuilder.java @@ -0,0 +1,111 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface ListSinksResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.ListSinksResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A list of sinks.
+   * 
+ * + * repeated .google.logging.v2.LogSink sinks = 1; + */ + java.util.List getSinksList(); + + /** + * + * + *
+   * A list of sinks.
+   * 
+ * + * repeated .google.logging.v2.LogSink sinks = 1; + */ + com.google.logging.v2.LogSink getSinks(int index); + + /** + * + * + *
+   * A list of sinks.
+   * 
+ * + * repeated .google.logging.v2.LogSink sinks = 1; + */ + int getSinksCount(); + + /** + * + * + *
+   * A list of sinks.
+   * 
+ * + * repeated .google.logging.v2.LogSink sinks = 1; + */ + java.util.List getSinksOrBuilderList(); + + /** + * + * + *
+   * A list of sinks.
+   * 
+ * + * repeated .google.logging.v2.LogSink sinks = 1; + */ + com.google.logging.v2.LogSinkOrBuilder getSinksOrBuilder(int index); + + /** + * + * + *
+   * If there might be more results than appear in this response, then
+   * `nextPageToken` is included. To get the next set of results, call the same
+   * method again using the value of `nextPageToken` as `pageToken`.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
+   * If there might be more results than appear in this response, then
+   * `nextPageToken` is included. To get the next set of results, call the same
+   * method again using the value of `nextPageToken` as `pageToken`.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListViewsRequest.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListViewsRequest.java new file mode 100644 index 000000000000..6131239b83c9 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListViewsRequest.java @@ -0,0 +1,965 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * The parameters to `ListViews`.
+ * 
+ * + * Protobuf type {@code google.logging.v2.ListViewsRequest} + */ +public final class ListViewsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.ListViewsRequest) + ListViewsRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ListViewsRequest.newBuilder() to construct. + private ListViewsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListViewsRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListViewsRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_ListViewsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_ListViewsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.ListViewsRequest.class, + com.google.logging.v2.ListViewsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + + /** + * + * + *
+   * Required. The bucket whose views are to be listed:
+   *
+   *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The bucket whose views are to be listed:
+   *
+   *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + + /** + * + * + *
+   * Optional. If present, then retrieve the next batch of results from the
+   * preceding call to this method. `pageToken` must be the value of
+   * `nextPageToken` from the previous response. The values of other method
+   * parameters should be identical to those in the previous call.
+   * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. If present, then retrieve the next batch of results from the
+   * preceding call to this method. `pageToken` must be the value of
+   * `nextPageToken` from the previous response. The values of other method
+   * parameters should be identical to those in the previous call.
+   * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 3; + private int pageSize_ = 0; + + /** + * + * + *
+   * Optional. The maximum number of results to return from this request.
+   *
+   * Non-positive values are ignored. The presence of `nextPageToken` in the
+   * response indicates that more results might be available.
+   * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, pageToken_); + } + if (pageSize_ != 0) { + output.writeInt32(3, pageSize_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, pageToken_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, pageSize_); + } + size += getUnknownFields().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.logging.v2.ListViewsRequest)) { + return super.equals(obj); + } + com.google.logging.v2.ListViewsRequest other = (com.google.logging.v2.ListViewsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.ListViewsRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.ListViewsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.ListViewsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.ListViewsRequest 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.logging.v2.ListViewsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.ListViewsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.ListViewsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.ListViewsRequest 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.logging.v2.ListViewsRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.ListViewsRequest 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.logging.v2.ListViewsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.ListViewsRequest 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.logging.v2.ListViewsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The parameters to `ListViews`.
+   * 
+ * + * Protobuf type {@code google.logging.v2.ListViewsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.ListViewsRequest) + com.google.logging.v2.ListViewsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_ListViewsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_ListViewsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.ListViewsRequest.class, + com.google.logging.v2.ListViewsRequest.Builder.class); + } + + // Construct using com.google.logging.v2.ListViewsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageToken_ = ""; + pageSize_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_ListViewsRequest_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.ListViewsRequest getDefaultInstanceForType() { + return com.google.logging.v2.ListViewsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.ListViewsRequest build() { + com.google.logging.v2.ListViewsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.ListViewsRequest buildPartial() { + com.google.logging.v2.ListViewsRequest result = + new com.google.logging.v2.ListViewsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.logging.v2.ListViewsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageToken_ = pageToken_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageSize_ = pageSize_; + } + } + + @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.logging.v2.ListViewsRequest) { + return mergeFrom((com.google.logging.v2.ListViewsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.ListViewsRequest other) { + if (other == com.google.logging.v2.ListViewsRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + + /** + * + * + *
+     * Required. The bucket whose views are to be listed:
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The bucket whose views are to be listed:
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The bucket whose views are to be listed:
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The bucket whose views are to be listed:
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The bucket whose views are to be listed:
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + + /** + * + * + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method. `pageToken` must be the value of
+     * `nextPageToken` from the previous response. The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method. `pageToken` must be the value of
+     * `nextPageToken` from the previous response. The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method. `pageToken` must be the value of
+     * `nextPageToken` from the previous response. The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method. `pageToken` must be the value of
+     * `nextPageToken` from the previous response. The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. If present, then retrieve the next batch of results from the
+     * preceding call to this method. `pageToken` must be the value of
+     * `nextPageToken` from the previous response. The values of other method
+     * parameters should be identical to those in the previous call.
+     * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private int pageSize_; + + /** + * + * + *
+     * Optional. The maximum number of results to return from this request.
+     *
+     * Non-positive values are ignored. The presence of `nextPageToken` in the
+     * response indicates that more results might be available.
+     * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + /** + * + * + *
+     * Optional. The maximum number of results to return from this request.
+     *
+     * Non-positive values are ignored. The presence of `nextPageToken` in the
+     * response indicates that more results might be available.
+     * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The maximum number of results to return from this request.
+     *
+     * Non-positive values are ignored. The presence of `nextPageToken` in the
+     * response indicates that more results might be available.
+     * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000004); + pageSize_ = 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.logging.v2.ListViewsRequest) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.ListViewsRequest) + private static final com.google.logging.v2.ListViewsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.ListViewsRequest(); + } + + public static com.google.logging.v2.ListViewsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListViewsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.ListViewsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListViewsRequestOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListViewsRequestOrBuilder.java new file mode 100644 index 000000000000..94302e697147 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListViewsRequestOrBuilder.java @@ -0,0 +1,104 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface ListViewsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.ListViewsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The bucket whose views are to be listed:
+   *
+   *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + java.lang.String getParent(); + + /** + * + * + *
+   * Required. The bucket whose views are to be listed:
+   *
+   *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. If present, then retrieve the next batch of results from the
+   * preceding call to this method. `pageToken` must be the value of
+   * `nextPageToken` from the previous response. The values of other method
+   * parameters should be identical to those in the previous call.
+   * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + + /** + * + * + *
+   * Optional. If present, then retrieve the next batch of results from the
+   * preceding call to this method. `pageToken` must be the value of
+   * `nextPageToken` from the previous response. The values of other method
+   * parameters should be identical to those in the previous call.
+   * 
+ * + * string page_token = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Optional. The maximum number of results to return from this request.
+   *
+   * Non-positive values are ignored. The presence of `nextPageToken` in the
+   * response indicates that more results might be available.
+   * 
+ * + * int32 page_size = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListViewsResponse.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListViewsResponse.java new file mode 100644 index 000000000000..d0efca4cb8bf --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListViewsResponse.java @@ -0,0 +1,1153 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * The response from ListViews.
+ * 
+ * + * Protobuf type {@code google.logging.v2.ListViewsResponse} + */ +public final class ListViewsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.ListViewsResponse) + ListViewsResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ListViewsResponse.newBuilder() to construct. + private ListViewsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListViewsResponse() { + views_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListViewsResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_ListViewsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_ListViewsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.ListViewsResponse.class, + com.google.logging.v2.ListViewsResponse.Builder.class); + } + + public static final int VIEWS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List views_; + + /** + * + * + *
+   * A list of views.
+   * 
+ * + * repeated .google.logging.v2.LogView views = 1; + */ + @java.lang.Override + public java.util.List getViewsList() { + return views_; + } + + /** + * + * + *
+   * A list of views.
+   * 
+ * + * repeated .google.logging.v2.LogView views = 1; + */ + @java.lang.Override + public java.util.List getViewsOrBuilderList() { + return views_; + } + + /** + * + * + *
+   * A list of views.
+   * 
+ * + * repeated .google.logging.v2.LogView views = 1; + */ + @java.lang.Override + public int getViewsCount() { + return views_.size(); + } + + /** + * + * + *
+   * A list of views.
+   * 
+ * + * repeated .google.logging.v2.LogView views = 1; + */ + @java.lang.Override + public com.google.logging.v2.LogView getViews(int index) { + return views_.get(index); + } + + /** + * + * + *
+   * A list of views.
+   * 
+ * + * repeated .google.logging.v2.LogView views = 1; + */ + @java.lang.Override + public com.google.logging.v2.LogViewOrBuilder getViewsOrBuilder(int index) { + return views_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+   * If there might be more results than appear in this response, then
+   * `nextPageToken` is included. To get the next set of results, call the same
+   * method again using the value of `nextPageToken` as `pageToken`.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + + /** + * + * + *
+   * If there might be more results than appear in this response, then
+   * `nextPageToken` is included. To get the next set of results, call the same
+   * method again using the value of `nextPageToken` as `pageToken`.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < views_.size(); i++) { + output.writeMessage(1, views_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < views_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, views_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += getUnknownFields().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.logging.v2.ListViewsResponse)) { + return super.equals(obj); + } + com.google.logging.v2.ListViewsResponse other = (com.google.logging.v2.ListViewsResponse) obj; + + if (!getViewsList().equals(other.getViewsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getViewsCount() > 0) { + hash = (37 * hash) + VIEWS_FIELD_NUMBER; + hash = (53 * hash) + getViewsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.ListViewsResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.ListViewsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.ListViewsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.ListViewsResponse 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.logging.v2.ListViewsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.ListViewsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.ListViewsResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.ListViewsResponse 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.logging.v2.ListViewsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.ListViewsResponse 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.logging.v2.ListViewsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.ListViewsResponse 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.logging.v2.ListViewsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The response from ListViews.
+   * 
+ * + * Protobuf type {@code google.logging.v2.ListViewsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.ListViewsResponse) + com.google.logging.v2.ListViewsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_ListViewsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_ListViewsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.ListViewsResponse.class, + com.google.logging.v2.ListViewsResponse.Builder.class); + } + + // Construct using com.google.logging.v2.ListViewsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (viewsBuilder_ == null) { + views_ = java.util.Collections.emptyList(); + } else { + views_ = null; + viewsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_ListViewsResponse_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.ListViewsResponse getDefaultInstanceForType() { + return com.google.logging.v2.ListViewsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.ListViewsResponse build() { + com.google.logging.v2.ListViewsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.ListViewsResponse buildPartial() { + com.google.logging.v2.ListViewsResponse result = + new com.google.logging.v2.ListViewsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.logging.v2.ListViewsResponse result) { + if (viewsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + views_ = java.util.Collections.unmodifiableList(views_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.views_ = views_; + } else { + result.views_ = viewsBuilder_.build(); + } + } + + private void buildPartial0(com.google.logging.v2.ListViewsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + } + + @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.logging.v2.ListViewsResponse) { + return mergeFrom((com.google.logging.v2.ListViewsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.ListViewsResponse other) { + if (other == com.google.logging.v2.ListViewsResponse.getDefaultInstance()) return this; + if (viewsBuilder_ == null) { + if (!other.views_.isEmpty()) { + if (views_.isEmpty()) { + views_ = other.views_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureViewsIsMutable(); + views_.addAll(other.views_); + } + onChanged(); + } + } else { + if (!other.views_.isEmpty()) { + if (viewsBuilder_.isEmpty()) { + viewsBuilder_.dispose(); + viewsBuilder_ = null; + views_ = other.views_; + bitField0_ = (bitField0_ & ~0x00000001); + viewsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getViewsFieldBuilder() + : null; + } else { + viewsBuilder_.addAllMessages(other.views_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.logging.v2.LogView m = + input.readMessage(com.google.logging.v2.LogView.parser(), extensionRegistry); + if (viewsBuilder_ == null) { + ensureViewsIsMutable(); + views_.add(m); + } else { + viewsBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List views_ = + java.util.Collections.emptyList(); + + private void ensureViewsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + views_ = new java.util.ArrayList(views_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.logging.v2.LogView, + com.google.logging.v2.LogView.Builder, + com.google.logging.v2.LogViewOrBuilder> + viewsBuilder_; + + /** + * + * + *
+     * A list of views.
+     * 
+ * + * repeated .google.logging.v2.LogView views = 1; + */ + public java.util.List getViewsList() { + if (viewsBuilder_ == null) { + return java.util.Collections.unmodifiableList(views_); + } else { + return viewsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * A list of views.
+     * 
+ * + * repeated .google.logging.v2.LogView views = 1; + */ + public int getViewsCount() { + if (viewsBuilder_ == null) { + return views_.size(); + } else { + return viewsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * A list of views.
+     * 
+ * + * repeated .google.logging.v2.LogView views = 1; + */ + public com.google.logging.v2.LogView getViews(int index) { + if (viewsBuilder_ == null) { + return views_.get(index); + } else { + return viewsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * A list of views.
+     * 
+ * + * repeated .google.logging.v2.LogView views = 1; + */ + public Builder setViews(int index, com.google.logging.v2.LogView value) { + if (viewsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureViewsIsMutable(); + views_.set(index, value); + onChanged(); + } else { + viewsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * A list of views.
+     * 
+ * + * repeated .google.logging.v2.LogView views = 1; + */ + public Builder setViews(int index, com.google.logging.v2.LogView.Builder builderForValue) { + if (viewsBuilder_ == null) { + ensureViewsIsMutable(); + views_.set(index, builderForValue.build()); + onChanged(); + } else { + viewsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of views.
+     * 
+ * + * repeated .google.logging.v2.LogView views = 1; + */ + public Builder addViews(com.google.logging.v2.LogView value) { + if (viewsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureViewsIsMutable(); + views_.add(value); + onChanged(); + } else { + viewsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * A list of views.
+     * 
+ * + * repeated .google.logging.v2.LogView views = 1; + */ + public Builder addViews(int index, com.google.logging.v2.LogView value) { + if (viewsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureViewsIsMutable(); + views_.add(index, value); + onChanged(); + } else { + viewsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * A list of views.
+     * 
+ * + * repeated .google.logging.v2.LogView views = 1; + */ + public Builder addViews(com.google.logging.v2.LogView.Builder builderForValue) { + if (viewsBuilder_ == null) { + ensureViewsIsMutable(); + views_.add(builderForValue.build()); + onChanged(); + } else { + viewsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of views.
+     * 
+ * + * repeated .google.logging.v2.LogView views = 1; + */ + public Builder addViews(int index, com.google.logging.v2.LogView.Builder builderForValue) { + if (viewsBuilder_ == null) { + ensureViewsIsMutable(); + views_.add(index, builderForValue.build()); + onChanged(); + } else { + viewsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of views.
+     * 
+ * + * repeated .google.logging.v2.LogView views = 1; + */ + public Builder addAllViews(java.lang.Iterable values) { + if (viewsBuilder_ == null) { + ensureViewsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, views_); + onChanged(); + } else { + viewsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * A list of views.
+     * 
+ * + * repeated .google.logging.v2.LogView views = 1; + */ + public Builder clearViews() { + if (viewsBuilder_ == null) { + views_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + viewsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * A list of views.
+     * 
+ * + * repeated .google.logging.v2.LogView views = 1; + */ + public Builder removeViews(int index) { + if (viewsBuilder_ == null) { + ensureViewsIsMutable(); + views_.remove(index); + onChanged(); + } else { + viewsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * A list of views.
+     * 
+ * + * repeated .google.logging.v2.LogView views = 1; + */ + public com.google.logging.v2.LogView.Builder getViewsBuilder(int index) { + return getViewsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * A list of views.
+     * 
+ * + * repeated .google.logging.v2.LogView views = 1; + */ + public com.google.logging.v2.LogViewOrBuilder getViewsOrBuilder(int index) { + if (viewsBuilder_ == null) { + return views_.get(index); + } else { + return viewsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * A list of views.
+     * 
+ * + * repeated .google.logging.v2.LogView views = 1; + */ + public java.util.List + getViewsOrBuilderList() { + if (viewsBuilder_ != null) { + return viewsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(views_); + } + } + + /** + * + * + *
+     * A list of views.
+     * 
+ * + * repeated .google.logging.v2.LogView views = 1; + */ + public com.google.logging.v2.LogView.Builder addViewsBuilder() { + return getViewsFieldBuilder().addBuilder(com.google.logging.v2.LogView.getDefaultInstance()); + } + + /** + * + * + *
+     * A list of views.
+     * 
+ * + * repeated .google.logging.v2.LogView views = 1; + */ + public com.google.logging.v2.LogView.Builder addViewsBuilder(int index) { + return getViewsFieldBuilder() + .addBuilder(index, com.google.logging.v2.LogView.getDefaultInstance()); + } + + /** + * + * + *
+     * A list of views.
+     * 
+ * + * repeated .google.logging.v2.LogView views = 1; + */ + public java.util.List getViewsBuilderList() { + return getViewsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.logging.v2.LogView, + com.google.logging.v2.LogView.Builder, + com.google.logging.v2.LogViewOrBuilder> + getViewsFieldBuilder() { + if (viewsBuilder_ == null) { + viewsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.logging.v2.LogView, + com.google.logging.v2.LogView.Builder, + com.google.logging.v2.LogViewOrBuilder>( + views_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + views_ = null; + } + return viewsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + + /** + * + * + *
+     * If there might be more results than appear in this response, then
+     * `nextPageToken` is included. To get the next set of results, call the same
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * If there might be more results than appear in this response, then
+     * `nextPageToken` is included. To get the next set of results, call the same
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * If there might be more results than appear in this response, then
+     * `nextPageToken` is included. To get the next set of results, call the same
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * If there might be more results than appear in this response, then
+     * `nextPageToken` is included. To get the next set of results, call the same
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * If there might be more results than appear in this response, then
+     * `nextPageToken` is included. To get the next set of results, call the same
+     * method again using the value of `nextPageToken` as `pageToken`.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextPageToken_ = value; + bitField0_ |= 0x00000002; + 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.logging.v2.ListViewsResponse) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.ListViewsResponse) + private static final com.google.logging.v2.ListViewsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.ListViewsResponse(); + } + + public static com.google.logging.v2.ListViewsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListViewsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.ListViewsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListViewsResponseOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListViewsResponseOrBuilder.java new file mode 100644 index 000000000000..4050e8aa1c1d --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListViewsResponseOrBuilder.java @@ -0,0 +1,111 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface ListViewsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.ListViewsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A list of views.
+   * 
+ * + * repeated .google.logging.v2.LogView views = 1; + */ + java.util.List getViewsList(); + + /** + * + * + *
+   * A list of views.
+   * 
+ * + * repeated .google.logging.v2.LogView views = 1; + */ + com.google.logging.v2.LogView getViews(int index); + + /** + * + * + *
+   * A list of views.
+   * 
+ * + * repeated .google.logging.v2.LogView views = 1; + */ + int getViewsCount(); + + /** + * + * + *
+   * A list of views.
+   * 
+ * + * repeated .google.logging.v2.LogView views = 1; + */ + java.util.List getViewsOrBuilderList(); + + /** + * + * + *
+   * A list of views.
+   * 
+ * + * repeated .google.logging.v2.LogView views = 1; + */ + com.google.logging.v2.LogViewOrBuilder getViewsOrBuilder(int index); + + /** + * + * + *
+   * If there might be more results than appear in this response, then
+   * `nextPageToken` is included. To get the next set of results, call the same
+   * method again using the value of `nextPageToken` as `pageToken`.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + + /** + * + * + *
+   * If there might be more results than appear in this response, then
+   * `nextPageToken` is included. To get the next set of results, call the same
+   * method again using the value of `nextPageToken` as `pageToken`.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LocationMetadata.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LocationMetadata.java new file mode 100644 index 000000000000..299051cba0dd --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LocationMetadata.java @@ -0,0 +1,543 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * Cloud Logging specific location metadata.
+ * 
+ * + * Protobuf type {@code google.logging.v2.LocationMetadata} + */ +public final class LocationMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.LocationMetadata) + LocationMetadataOrBuilder { + private static final long serialVersionUID = 0L; + + // Use LocationMetadata.newBuilder() to construct. + private LocationMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private LocationMetadata() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new LocationMetadata(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_LocationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_LocationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.LocationMetadata.class, + com.google.logging.v2.LocationMetadata.Builder.class); + } + + public static final int LOG_ANALYTICS_ENABLED_FIELD_NUMBER = 1; + private boolean logAnalyticsEnabled_ = false; + + /** + * + * + *
+   * Indicates whether or not Log Analytics features are supported in the given
+   * location.
+   * 
+ * + * bool log_analytics_enabled = 1; + * + * @return The logAnalyticsEnabled. + */ + @java.lang.Override + public boolean getLogAnalyticsEnabled() { + return logAnalyticsEnabled_; + } + + 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 (logAnalyticsEnabled_ != false) { + output.writeBool(1, logAnalyticsEnabled_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (logAnalyticsEnabled_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, logAnalyticsEnabled_); + } + size += getUnknownFields().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.logging.v2.LocationMetadata)) { + return super.equals(obj); + } + com.google.logging.v2.LocationMetadata other = (com.google.logging.v2.LocationMetadata) obj; + + if (getLogAnalyticsEnabled() != other.getLogAnalyticsEnabled()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + LOG_ANALYTICS_ENABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getLogAnalyticsEnabled()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.LocationMetadata parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.LocationMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.LocationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.LocationMetadata 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.logging.v2.LocationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.LocationMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.LocationMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.LocationMetadata 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.logging.v2.LocationMetadata parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.LocationMetadata 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.logging.v2.LocationMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.LocationMetadata 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.logging.v2.LocationMetadata 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; + } + + /** + * + * + *
+   * Cloud Logging specific location metadata.
+   * 
+ * + * Protobuf type {@code google.logging.v2.LocationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.LocationMetadata) + com.google.logging.v2.LocationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_LocationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_LocationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.LocationMetadata.class, + com.google.logging.v2.LocationMetadata.Builder.class); + } + + // Construct using com.google.logging.v2.LocationMetadata.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + logAnalyticsEnabled_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_LocationMetadata_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.LocationMetadata getDefaultInstanceForType() { + return com.google.logging.v2.LocationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.LocationMetadata build() { + com.google.logging.v2.LocationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.LocationMetadata buildPartial() { + com.google.logging.v2.LocationMetadata result = + new com.google.logging.v2.LocationMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.logging.v2.LocationMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.logAnalyticsEnabled_ = logAnalyticsEnabled_; + } + } + + @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.logging.v2.LocationMetadata) { + return mergeFrom((com.google.logging.v2.LocationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.LocationMetadata other) { + if (other == com.google.logging.v2.LocationMetadata.getDefaultInstance()) return this; + if (other.getLogAnalyticsEnabled() != false) { + setLogAnalyticsEnabled(other.getLogAnalyticsEnabled()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + logAnalyticsEnabled_ = input.readBool(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private boolean logAnalyticsEnabled_; + + /** + * + * + *
+     * Indicates whether or not Log Analytics features are supported in the given
+     * location.
+     * 
+ * + * bool log_analytics_enabled = 1; + * + * @return The logAnalyticsEnabled. + */ + @java.lang.Override + public boolean getLogAnalyticsEnabled() { + return logAnalyticsEnabled_; + } + + /** + * + * + *
+     * Indicates whether or not Log Analytics features are supported in the given
+     * location.
+     * 
+ * + * bool log_analytics_enabled = 1; + * + * @param value The logAnalyticsEnabled to set. + * @return This builder for chaining. + */ + public Builder setLogAnalyticsEnabled(boolean value) { + + logAnalyticsEnabled_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Indicates whether or not Log Analytics features are supported in the given
+     * location.
+     * 
+ * + * bool log_analytics_enabled = 1; + * + * @return This builder for chaining. + */ + public Builder clearLogAnalyticsEnabled() { + bitField0_ = (bitField0_ & ~0x00000001); + logAnalyticsEnabled_ = 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.logging.v2.LocationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.LocationMetadata) + private static final com.google.logging.v2.LocationMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.LocationMetadata(); + } + + public static com.google.logging.v2.LocationMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LocationMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.LocationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LocationMetadataOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LocationMetadataOrBuilder.java new file mode 100644 index 000000000000..e3ada972e075 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LocationMetadataOrBuilder.java @@ -0,0 +1,40 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface LocationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.LocationMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Indicates whether or not Log Analytics features are supported in the given
+   * location.
+   * 
+ * + * bool log_analytics_enabled = 1; + * + * @return The logAnalyticsEnabled. + */ + boolean getLogAnalyticsEnabled(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LocationName.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LocationName.java new file mode 100644 index 000000000000..0611cebaf8d4 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LocationName.java @@ -0,0 +1,192 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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.logging.v2; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class LocationName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + + @Deprecated + protected LocationName() { + project = null; + location = null; + } + + private LocationName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static LocationName of(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build(); + } + + public static String format(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build().toString(); + } + + public static LocationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION.validatedMatch( + formattedString, "LocationName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (LocationName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION.instantiate("project", project, "location", location); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + LocationName that = ((LocationName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + return h; + } + + /** Builder for projects/{project}/locations/{location}. */ + public static class Builder { + private String project; + private String location; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + private Builder(LocationName locationName) { + this.project = locationName.project; + this.location = locationName.location; + } + + public LocationName build() { + return new LocationName(this); + } + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogBucket.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogBucket.java new file mode 100644 index 000000000000..a223ab69ff8e --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogBucket.java @@ -0,0 +1,3223 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * Describes a repository in which log entries are stored.
+ * 
+ * + * Protobuf type {@code google.logging.v2.LogBucket} + */ +public final class LogBucket extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.LogBucket) + LogBucketOrBuilder { + private static final long serialVersionUID = 0L; + + // Use LogBucket.newBuilder() to construct. + private LogBucket(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private LogBucket() { + name_ = ""; + description_ = ""; + lifecycleState_ = 0; + restrictedFields_ = com.google.protobuf.LazyStringArrayList.emptyList(); + indexConfigs_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new LogBucket(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_LogBucket_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_LogBucket_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.LogBucket.class, com.google.logging.v2.LogBucket.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Output only. The resource name of the bucket.
+   *
+   * For example:
+   *
+   *   `projects/my-project/locations/global/buckets/my-bucket`
+   *
+   * For a list of supported locations, see [Supported
+   * Regions](https://cloud.google.com/logging/docs/region-support)
+   *
+   * For the location of `global` it is unspecified where log entries are
+   * actually stored.
+   *
+   * After a bucket has been created, the location cannot be changed.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * Output only. The resource name of the bucket.
+   *
+   * For example:
+   *
+   *   `projects/my-project/locations/global/buckets/my-bucket`
+   *
+   * For a list of supported locations, see [Supported
+   * Regions](https://cloud.google.com/logging/docs/region-support)
+   *
+   * For the location of `global` it is unspecified where log entries are
+   * actually stored.
+   *
+   * After a bucket has been created, the location cannot be changed.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + + /** + * + * + *
+   * Describes this bucket.
+   * 
+ * + * 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; + } + } + + /** + * + * + *
+   * Describes this bucket.
+   * 
+ * + * 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 CREATE_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp createTime_; + + /** + * + * + *
+   * Output only. The creation timestamp of the bucket. This is not set for any
+   * of the default buckets.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Output only. The creation timestamp of the bucket. This is not set for any
+   * of the default buckets.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + /** + * + * + *
+   * Output only. The creation timestamp of the bucket. This is not set for any
+   * of the default buckets.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp updateTime_; + + /** + * + * + *
+   * Output only. The last update timestamp of the bucket.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Output only. The last update timestamp of the bucket.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + /** + * + * + *
+   * Output only. The last update timestamp of the bucket.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + public static final int RETENTION_DAYS_FIELD_NUMBER = 11; + private int retentionDays_ = 0; + + /** + * + * + *
+   * Logs will be retained by default for this amount of time, after which they
+   * will automatically be deleted. The minimum retention period is 1 day. If
+   * this value is set to zero at bucket creation time, the default time of 30
+   * days will be used.
+   * 
+ * + * int32 retention_days = 11; + * + * @return The retentionDays. + */ + @java.lang.Override + public int getRetentionDays() { + return retentionDays_; + } + + public static final int LOCKED_FIELD_NUMBER = 9; + private boolean locked_ = false; + + /** + * + * + *
+   * Whether the bucket is locked.
+   *
+   * The retention period on a locked bucket cannot be changed. Locked buckets
+   * may only be deleted if they are empty.
+   * 
+ * + * bool locked = 9; + * + * @return The locked. + */ + @java.lang.Override + public boolean getLocked() { + return locked_; + } + + public static final int LIFECYCLE_STATE_FIELD_NUMBER = 12; + private int lifecycleState_ = 0; + + /** + * + * + *
+   * Output only. The bucket lifecycle state.
+   * 
+ * + * + * .google.logging.v2.LifecycleState lifecycle_state = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for lifecycleState. + */ + @java.lang.Override + public int getLifecycleStateValue() { + return lifecycleState_; + } + + /** + * + * + *
+   * Output only. The bucket lifecycle state.
+   * 
+ * + * + * .google.logging.v2.LifecycleState lifecycle_state = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The lifecycleState. + */ + @java.lang.Override + public com.google.logging.v2.LifecycleState getLifecycleState() { + com.google.logging.v2.LifecycleState result = + com.google.logging.v2.LifecycleState.forNumber(lifecycleState_); + return result == null ? com.google.logging.v2.LifecycleState.UNRECOGNIZED : result; + } + + public static final int ANALYTICS_ENABLED_FIELD_NUMBER = 14; + private boolean analyticsEnabled_ = false; + + /** + * + * + *
+   * Whether log analytics is enabled for this bucket.
+   *
+   * Once enabled, log analytics features cannot be disabled.
+   * 
+ * + * bool analytics_enabled = 14; + * + * @return The analyticsEnabled. + */ + @java.lang.Override + public boolean getAnalyticsEnabled() { + return analyticsEnabled_; + } + + public static final int RESTRICTED_FIELDS_FIELD_NUMBER = 15; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList restrictedFields_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+   * Log entry field paths that are denied access in this bucket.
+   *
+   * The following fields and their children are eligible: `textPayload`,
+   * `jsonPayload`, `protoPayload`, `httpRequest`, `labels`, `sourceLocation`.
+   *
+   * Restricting a repeated field will restrict all values. Adding a parent will
+   * block all child fields. (e.g. `foo.bar` will block `foo.bar.baz`)
+   * 
+ * + * repeated string restricted_fields = 15; + * + * @return A list containing the restrictedFields. + */ + public com.google.protobuf.ProtocolStringList getRestrictedFieldsList() { + return restrictedFields_; + } + + /** + * + * + *
+   * Log entry field paths that are denied access in this bucket.
+   *
+   * The following fields and their children are eligible: `textPayload`,
+   * `jsonPayload`, `protoPayload`, `httpRequest`, `labels`, `sourceLocation`.
+   *
+   * Restricting a repeated field will restrict all values. Adding a parent will
+   * block all child fields. (e.g. `foo.bar` will block `foo.bar.baz`)
+   * 
+ * + * repeated string restricted_fields = 15; + * + * @return The count of restrictedFields. + */ + public int getRestrictedFieldsCount() { + return restrictedFields_.size(); + } + + /** + * + * + *
+   * Log entry field paths that are denied access in this bucket.
+   *
+   * The following fields and their children are eligible: `textPayload`,
+   * `jsonPayload`, `protoPayload`, `httpRequest`, `labels`, `sourceLocation`.
+   *
+   * Restricting a repeated field will restrict all values. Adding a parent will
+   * block all child fields. (e.g. `foo.bar` will block `foo.bar.baz`)
+   * 
+ * + * repeated string restricted_fields = 15; + * + * @param index The index of the element to return. + * @return The restrictedFields at the given index. + */ + public java.lang.String getRestrictedFields(int index) { + return restrictedFields_.get(index); + } + + /** + * + * + *
+   * Log entry field paths that are denied access in this bucket.
+   *
+   * The following fields and their children are eligible: `textPayload`,
+   * `jsonPayload`, `protoPayload`, `httpRequest`, `labels`, `sourceLocation`.
+   *
+   * Restricting a repeated field will restrict all values. Adding a parent will
+   * block all child fields. (e.g. `foo.bar` will block `foo.bar.baz`)
+   * 
+ * + * repeated string restricted_fields = 15; + * + * @param index The index of the value to return. + * @return The bytes of the restrictedFields at the given index. + */ + public com.google.protobuf.ByteString getRestrictedFieldsBytes(int index) { + return restrictedFields_.getByteString(index); + } + + public static final int INDEX_CONFIGS_FIELD_NUMBER = 17; + + @SuppressWarnings("serial") + private java.util.List indexConfigs_; + + /** + * + * + *
+   * A list of indexed fields and related configuration data.
+   * 
+ * + * repeated .google.logging.v2.IndexConfig index_configs = 17; + */ + @java.lang.Override + public java.util.List getIndexConfigsList() { + return indexConfigs_; + } + + /** + * + * + *
+   * A list of indexed fields and related configuration data.
+   * 
+ * + * repeated .google.logging.v2.IndexConfig index_configs = 17; + */ + @java.lang.Override + public java.util.List + getIndexConfigsOrBuilderList() { + return indexConfigs_; + } + + /** + * + * + *
+   * A list of indexed fields and related configuration data.
+   * 
+ * + * repeated .google.logging.v2.IndexConfig index_configs = 17; + */ + @java.lang.Override + public int getIndexConfigsCount() { + return indexConfigs_.size(); + } + + /** + * + * + *
+   * A list of indexed fields and related configuration data.
+   * 
+ * + * repeated .google.logging.v2.IndexConfig index_configs = 17; + */ + @java.lang.Override + public com.google.logging.v2.IndexConfig getIndexConfigs(int index) { + return indexConfigs_.get(index); + } + + /** + * + * + *
+   * A list of indexed fields and related configuration data.
+   * 
+ * + * repeated .google.logging.v2.IndexConfig index_configs = 17; + */ + @java.lang.Override + public com.google.logging.v2.IndexConfigOrBuilder getIndexConfigsOrBuilder(int index) { + return indexConfigs_.get(index); + } + + public static final int CMEK_SETTINGS_FIELD_NUMBER = 19; + private com.google.logging.v2.CmekSettings cmekSettings_; + + /** + * + * + *
+   * The CMEK settings of the log bucket. If present, new log entries written to
+   * this log bucket are encrypted using the CMEK key provided in this
+   * configuration. If a log bucket has CMEK settings, the CMEK settings cannot
+   * be disabled later by updating the log bucket. Changing the KMS key is
+   * allowed.
+   * 
+ * + * .google.logging.v2.CmekSettings cmek_settings = 19; + * + * @return Whether the cmekSettings field is set. + */ + @java.lang.Override + public boolean hasCmekSettings() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * The CMEK settings of the log bucket. If present, new log entries written to
+   * this log bucket are encrypted using the CMEK key provided in this
+   * configuration. If a log bucket has CMEK settings, the CMEK settings cannot
+   * be disabled later by updating the log bucket. Changing the KMS key is
+   * allowed.
+   * 
+ * + * .google.logging.v2.CmekSettings cmek_settings = 19; + * + * @return The cmekSettings. + */ + @java.lang.Override + public com.google.logging.v2.CmekSettings getCmekSettings() { + return cmekSettings_ == null + ? com.google.logging.v2.CmekSettings.getDefaultInstance() + : cmekSettings_; + } + + /** + * + * + *
+   * The CMEK settings of the log bucket. If present, new log entries written to
+   * this log bucket are encrypted using the CMEK key provided in this
+   * configuration. If a log bucket has CMEK settings, the CMEK settings cannot
+   * be disabled later by updating the log bucket. Changing the KMS key is
+   * allowed.
+   * 
+ * + * .google.logging.v2.CmekSettings cmek_settings = 19; + */ + @java.lang.Override + public com.google.logging.v2.CmekSettingsOrBuilder getCmekSettingsOrBuilder() { + return cmekSettings_ == null + ? com.google.logging.v2.CmekSettings.getDefaultInstance() + : cmekSettings_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(4, getCreateTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(5, getUpdateTime()); + } + if (locked_ != false) { + output.writeBool(9, locked_); + } + if (retentionDays_ != 0) { + output.writeInt32(11, retentionDays_); + } + if (lifecycleState_ + != com.google.logging.v2.LifecycleState.LIFECYCLE_STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(12, lifecycleState_); + } + if (analyticsEnabled_ != false) { + output.writeBool(14, analyticsEnabled_); + } + for (int i = 0; i < restrictedFields_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 15, restrictedFields_.getRaw(i)); + } + for (int i = 0; i < indexConfigs_.size(); i++) { + output.writeMessage(17, indexConfigs_.get(i)); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(19, getCmekSettings()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getCreateTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getUpdateTime()); + } + if (locked_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(9, locked_); + } + if (retentionDays_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(11, retentionDays_); + } + if (lifecycleState_ + != com.google.logging.v2.LifecycleState.LIFECYCLE_STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(12, lifecycleState_); + } + if (analyticsEnabled_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(14, analyticsEnabled_); + } + { + int dataSize = 0; + for (int i = 0; i < restrictedFields_.size(); i++) { + dataSize += computeStringSizeNoTag(restrictedFields_.getRaw(i)); + } + size += dataSize; + size += 1 * getRestrictedFieldsList().size(); + } + for (int i = 0; i < indexConfigs_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(17, indexConfigs_.get(i)); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(19, getCmekSettings()); + } + size += getUnknownFields().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.logging.v2.LogBucket)) { + return super.equals(obj); + } + com.google.logging.v2.LogBucket other = (com.google.logging.v2.LogBucket) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (getRetentionDays() != other.getRetentionDays()) return false; + if (getLocked() != other.getLocked()) return false; + if (lifecycleState_ != other.lifecycleState_) return false; + if (getAnalyticsEnabled() != other.getAnalyticsEnabled()) return false; + if (!getRestrictedFieldsList().equals(other.getRestrictedFieldsList())) return false; + if (!getIndexConfigsList().equals(other.getIndexConfigsList())) return false; + if (hasCmekSettings() != other.hasCmekSettings()) return false; + if (hasCmekSettings()) { + if (!getCmekSettings().equals(other.getCmekSettings())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + hash = (37 * hash) + RETENTION_DAYS_FIELD_NUMBER; + hash = (53 * hash) + getRetentionDays(); + hash = (37 * hash) + LOCKED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getLocked()); + hash = (37 * hash) + LIFECYCLE_STATE_FIELD_NUMBER; + hash = (53 * hash) + lifecycleState_; + hash = (37 * hash) + ANALYTICS_ENABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAnalyticsEnabled()); + if (getRestrictedFieldsCount() > 0) { + hash = (37 * hash) + RESTRICTED_FIELDS_FIELD_NUMBER; + hash = (53 * hash) + getRestrictedFieldsList().hashCode(); + } + if (getIndexConfigsCount() > 0) { + hash = (37 * hash) + INDEX_CONFIGS_FIELD_NUMBER; + hash = (53 * hash) + getIndexConfigsList().hashCode(); + } + if (hasCmekSettings()) { + hash = (37 * hash) + CMEK_SETTINGS_FIELD_NUMBER; + hash = (53 * hash) + getCmekSettings().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.LogBucket parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.LogBucket parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.LogBucket parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.LogBucket 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.logging.v2.LogBucket parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.LogBucket parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.LogBucket parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.LogBucket 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.logging.v2.LogBucket parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.LogBucket 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.logging.v2.LogBucket parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.LogBucket 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.logging.v2.LogBucket 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; + } + + /** + * + * + *
+   * Describes a repository in which log entries are stored.
+   * 
+ * + * Protobuf type {@code google.logging.v2.LogBucket} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.LogBucket) + com.google.logging.v2.LogBucketOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_LogBucket_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_LogBucket_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.LogBucket.class, com.google.logging.v2.LogBucket.Builder.class); + } + + // Construct using com.google.logging.v2.LogBucket.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getCreateTimeFieldBuilder(); + getUpdateTimeFieldBuilder(); + getIndexConfigsFieldBuilder(); + getCmekSettingsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + description_ = ""; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + retentionDays_ = 0; + locked_ = false; + lifecycleState_ = 0; + analyticsEnabled_ = false; + restrictedFields_ = com.google.protobuf.LazyStringArrayList.emptyList(); + if (indexConfigsBuilder_ == null) { + indexConfigs_ = java.util.Collections.emptyList(); + } else { + indexConfigs_ = null; + indexConfigsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000200); + cmekSettings_ = null; + if (cmekSettingsBuilder_ != null) { + cmekSettingsBuilder_.dispose(); + cmekSettingsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_LogBucket_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.LogBucket getDefaultInstanceForType() { + return com.google.logging.v2.LogBucket.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.LogBucket build() { + com.google.logging.v2.LogBucket result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.LogBucket buildPartial() { + com.google.logging.v2.LogBucket result = new com.google.logging.v2.LogBucket(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.logging.v2.LogBucket result) { + if (indexConfigsBuilder_ == null) { + if (((bitField0_ & 0x00000200) != 0)) { + indexConfigs_ = java.util.Collections.unmodifiableList(indexConfigs_); + bitField0_ = (bitField0_ & ~0x00000200); + } + result.indexConfigs_ = indexConfigs_; + } else { + result.indexConfigs_ = indexConfigsBuilder_.build(); + } + } + + private void buildPartial0(com.google.logging.v2.LogBucket result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.description_ = description_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.retentionDays_ = retentionDays_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.locked_ = locked_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.lifecycleState_ = lifecycleState_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.analyticsEnabled_ = analyticsEnabled_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + restrictedFields_.makeImmutable(); + result.restrictedFields_ = restrictedFields_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.cmekSettings_ = + cmekSettingsBuilder_ == null ? cmekSettings_ : cmekSettingsBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + result.bitField0_ |= to_bitField0_; + } + + @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.logging.v2.LogBucket) { + return mergeFrom((com.google.logging.v2.LogBucket) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.LogBucket other) { + if (other == com.google.logging.v2.LogBucket.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (other.getRetentionDays() != 0) { + setRetentionDays(other.getRetentionDays()); + } + if (other.getLocked() != false) { + setLocked(other.getLocked()); + } + if (other.lifecycleState_ != 0) { + setLifecycleStateValue(other.getLifecycleStateValue()); + } + if (other.getAnalyticsEnabled() != false) { + setAnalyticsEnabled(other.getAnalyticsEnabled()); + } + if (!other.restrictedFields_.isEmpty()) { + if (restrictedFields_.isEmpty()) { + restrictedFields_ = other.restrictedFields_; + bitField0_ |= 0x00000100; + } else { + ensureRestrictedFieldsIsMutable(); + restrictedFields_.addAll(other.restrictedFields_); + } + onChanged(); + } + if (indexConfigsBuilder_ == null) { + if (!other.indexConfigs_.isEmpty()) { + if (indexConfigs_.isEmpty()) { + indexConfigs_ = other.indexConfigs_; + bitField0_ = (bitField0_ & ~0x00000200); + } else { + ensureIndexConfigsIsMutable(); + indexConfigs_.addAll(other.indexConfigs_); + } + onChanged(); + } + } else { + if (!other.indexConfigs_.isEmpty()) { + if (indexConfigsBuilder_.isEmpty()) { + indexConfigsBuilder_.dispose(); + indexConfigsBuilder_ = null; + indexConfigs_ = other.indexConfigs_; + bitField0_ = (bitField0_ & ~0x00000200); + indexConfigsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getIndexConfigsFieldBuilder() + : null; + } else { + indexConfigsBuilder_.addAllMessages(other.indexConfigs_); + } + } + } + if (other.hasCmekSettings()) { + mergeCmekSettings(other.getCmekSettings()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 26: + { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 26 + case 34: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 34 + case 42: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 42 + case 72: + { + locked_ = input.readBool(); + bitField0_ |= 0x00000020; + break; + } // case 72 + case 88: + { + retentionDays_ = input.readInt32(); + bitField0_ |= 0x00000010; + break; + } // case 88 + case 96: + { + lifecycleState_ = input.readEnum(); + bitField0_ |= 0x00000040; + break; + } // case 96 + case 112: + { + analyticsEnabled_ = input.readBool(); + bitField0_ |= 0x00000080; + break; + } // case 112 + case 122: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureRestrictedFieldsIsMutable(); + restrictedFields_.add(s); + break; + } // case 122 + case 138: + { + com.google.logging.v2.IndexConfig m = + input.readMessage( + com.google.logging.v2.IndexConfig.parser(), extensionRegistry); + if (indexConfigsBuilder_ == null) { + ensureIndexConfigsIsMutable(); + indexConfigs_.add(m); + } else { + indexConfigsBuilder_.addMessage(m); + } + break; + } // case 138 + case 154: + { + input.readMessage(getCmekSettingsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000400; + break; + } // case 154 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Output only. The resource name of the bucket.
+     *
+     * For example:
+     *
+     *   `projects/my-project/locations/global/buckets/my-bucket`
+     *
+     * For a list of supported locations, see [Supported
+     * Regions](https://cloud.google.com/logging/docs/region-support)
+     *
+     * For the location of `global` it is unspecified where log entries are
+     * actually stored.
+     *
+     * After a bucket has been created, the location cannot be changed.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Output only. The resource name of the bucket.
+     *
+     * For example:
+     *
+     *   `projects/my-project/locations/global/buckets/my-bucket`
+     *
+     * For a list of supported locations, see [Supported
+     * Regions](https://cloud.google.com/logging/docs/region-support)
+     *
+     * For the location of `global` it is unspecified where log entries are
+     * actually stored.
+     *
+     * After a bucket has been created, the location cannot be changed.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Output only. The resource name of the bucket.
+     *
+     * For example:
+     *
+     *   `projects/my-project/locations/global/buckets/my-bucket`
+     *
+     * For a list of supported locations, see [Supported
+     * Regions](https://cloud.google.com/logging/docs/region-support)
+     *
+     * For the location of `global` it is unspecified where log entries are
+     * actually stored.
+     *
+     * After a bucket has been created, the location cannot be changed.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The resource name of the bucket.
+     *
+     * For example:
+     *
+     *   `projects/my-project/locations/global/buckets/my-bucket`
+     *
+     * For a list of supported locations, see [Supported
+     * Regions](https://cloud.google.com/logging/docs/region-support)
+     *
+     * For the location of `global` it is unspecified where log entries are
+     * actually stored.
+     *
+     * After a bucket has been created, the location cannot be changed.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The resource name of the bucket.
+     *
+     * For example:
+     *
+     *   `projects/my-project/locations/global/buckets/my-bucket`
+     *
+     * For a list of supported locations, see [Supported
+     * Regions](https://cloud.google.com/logging/docs/region-support)
+     *
+     * For the location of `global` it is unspecified where log entries are
+     * actually stored.
+     *
+     * After a bucket has been created, the location cannot be changed.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + + /** + * + * + *
+     * Describes this bucket.
+     * 
+ * + * 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; + } + } + + /** + * + * + *
+     * Describes this bucket.
+     * 
+ * + * 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; + } + } + + /** + * + * + *
+     * Describes this bucket.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Describes this bucket.
+     * 
+ * + * string description = 3; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Describes this bucket.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + + /** + * + * + *
+     * Output only. The creation timestamp of the bucket. This is not set for any
+     * of the default buckets.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Output only. The creation timestamp of the bucket. This is not set for any
+     * of the default buckets.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Output only. The creation timestamp of the bucket. This is not set for any
+     * of the default buckets.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The creation timestamp of the bucket. This is not set for any
+     * of the default buckets.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The creation timestamp of the bucket. This is not set for any
+     * of the default buckets.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + if (createTime_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Output only. The creation timestamp of the bucket. This is not set for any
+     * of the default buckets.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000004); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The creation timestamp of the bucket. This is not set for any
+     * of the default buckets.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Output only. The creation timestamp of the bucket. This is not set for any
+     * of the default buckets.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + + /** + * + * + *
+     * Output only. The creation timestamp of the bucket. This is not set for any
+     * of the default buckets.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + + /** + * + * + *
+     * Output only. The last update timestamp of the bucket.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * Output only. The last update timestamp of the bucket.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Output only. The last update timestamp of the bucket.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + } else { + updateTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The last update timestamp of the bucket.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The last update timestamp of the bucket.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + if (updateTime_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Output only. The last update timestamp of the bucket.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + bitField0_ = (bitField0_ & ~0x00000008); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The last update timestamp of the bucket.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Output only. The last update timestamp of the bucket.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + + /** + * + * + *
+     * Output only. The last update timestamp of the bucket.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private int retentionDays_; + + /** + * + * + *
+     * Logs will be retained by default for this amount of time, after which they
+     * will automatically be deleted. The minimum retention period is 1 day. If
+     * this value is set to zero at bucket creation time, the default time of 30
+     * days will be used.
+     * 
+ * + * int32 retention_days = 11; + * + * @return The retentionDays. + */ + @java.lang.Override + public int getRetentionDays() { + return retentionDays_; + } + + /** + * + * + *
+     * Logs will be retained by default for this amount of time, after which they
+     * will automatically be deleted. The minimum retention period is 1 day. If
+     * this value is set to zero at bucket creation time, the default time of 30
+     * days will be used.
+     * 
+ * + * int32 retention_days = 11; + * + * @param value The retentionDays to set. + * @return This builder for chaining. + */ + public Builder setRetentionDays(int value) { + + retentionDays_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Logs will be retained by default for this amount of time, after which they
+     * will automatically be deleted. The minimum retention period is 1 day. If
+     * this value is set to zero at bucket creation time, the default time of 30
+     * days will be used.
+     * 
+ * + * int32 retention_days = 11; + * + * @return This builder for chaining. + */ + public Builder clearRetentionDays() { + bitField0_ = (bitField0_ & ~0x00000010); + retentionDays_ = 0; + onChanged(); + return this; + } + + private boolean locked_; + + /** + * + * + *
+     * Whether the bucket is locked.
+     *
+     * The retention period on a locked bucket cannot be changed. Locked buckets
+     * may only be deleted if they are empty.
+     * 
+ * + * bool locked = 9; + * + * @return The locked. + */ + @java.lang.Override + public boolean getLocked() { + return locked_; + } + + /** + * + * + *
+     * Whether the bucket is locked.
+     *
+     * The retention period on a locked bucket cannot be changed. Locked buckets
+     * may only be deleted if they are empty.
+     * 
+ * + * bool locked = 9; + * + * @param value The locked to set. + * @return This builder for chaining. + */ + public Builder setLocked(boolean value) { + + locked_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Whether the bucket is locked.
+     *
+     * The retention period on a locked bucket cannot be changed. Locked buckets
+     * may only be deleted if they are empty.
+     * 
+ * + * bool locked = 9; + * + * @return This builder for chaining. + */ + public Builder clearLocked() { + bitField0_ = (bitField0_ & ~0x00000020); + locked_ = false; + onChanged(); + return this; + } + + private int lifecycleState_ = 0; + + /** + * + * + *
+     * Output only. The bucket lifecycle state.
+     * 
+ * + * + * .google.logging.v2.LifecycleState lifecycle_state = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for lifecycleState. + */ + @java.lang.Override + public int getLifecycleStateValue() { + return lifecycleState_; + } + + /** + * + * + *
+     * Output only. The bucket lifecycle state.
+     * 
+ * + * + * .google.logging.v2.LifecycleState lifecycle_state = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for lifecycleState to set. + * @return This builder for chaining. + */ + public Builder setLifecycleStateValue(int value) { + lifecycleState_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The bucket lifecycle state.
+     * 
+ * + * + * .google.logging.v2.LifecycleState lifecycle_state = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The lifecycleState. + */ + @java.lang.Override + public com.google.logging.v2.LifecycleState getLifecycleState() { + com.google.logging.v2.LifecycleState result = + com.google.logging.v2.LifecycleState.forNumber(lifecycleState_); + return result == null ? com.google.logging.v2.LifecycleState.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * Output only. The bucket lifecycle state.
+     * 
+ * + * + * .google.logging.v2.LifecycleState lifecycle_state = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The lifecycleState to set. + * @return This builder for chaining. + */ + public Builder setLifecycleState(com.google.logging.v2.LifecycleState value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000040; + lifecycleState_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The bucket lifecycle state.
+     * 
+ * + * + * .google.logging.v2.LifecycleState lifecycle_state = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearLifecycleState() { + bitField0_ = (bitField0_ & ~0x00000040); + lifecycleState_ = 0; + onChanged(); + return this; + } + + private boolean analyticsEnabled_; + + /** + * + * + *
+     * Whether log analytics is enabled for this bucket.
+     *
+     * Once enabled, log analytics features cannot be disabled.
+     * 
+ * + * bool analytics_enabled = 14; + * + * @return The analyticsEnabled. + */ + @java.lang.Override + public boolean getAnalyticsEnabled() { + return analyticsEnabled_; + } + + /** + * + * + *
+     * Whether log analytics is enabled for this bucket.
+     *
+     * Once enabled, log analytics features cannot be disabled.
+     * 
+ * + * bool analytics_enabled = 14; + * + * @param value The analyticsEnabled to set. + * @return This builder for chaining. + */ + public Builder setAnalyticsEnabled(boolean value) { + + analyticsEnabled_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * Whether log analytics is enabled for this bucket.
+     *
+     * Once enabled, log analytics features cannot be disabled.
+     * 
+ * + * bool analytics_enabled = 14; + * + * @return This builder for chaining. + */ + public Builder clearAnalyticsEnabled() { + bitField0_ = (bitField0_ & ~0x00000080); + analyticsEnabled_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringArrayList restrictedFields_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureRestrictedFieldsIsMutable() { + if (!restrictedFields_.isModifiable()) { + restrictedFields_ = new com.google.protobuf.LazyStringArrayList(restrictedFields_); + } + bitField0_ |= 0x00000100; + } + + /** + * + * + *
+     * Log entry field paths that are denied access in this bucket.
+     *
+     * The following fields and their children are eligible: `textPayload`,
+     * `jsonPayload`, `protoPayload`, `httpRequest`, `labels`, `sourceLocation`.
+     *
+     * Restricting a repeated field will restrict all values. Adding a parent will
+     * block all child fields. (e.g. `foo.bar` will block `foo.bar.baz`)
+     * 
+ * + * repeated string restricted_fields = 15; + * + * @return A list containing the restrictedFields. + */ + public com.google.protobuf.ProtocolStringList getRestrictedFieldsList() { + restrictedFields_.makeImmutable(); + return restrictedFields_; + } + + /** + * + * + *
+     * Log entry field paths that are denied access in this bucket.
+     *
+     * The following fields and their children are eligible: `textPayload`,
+     * `jsonPayload`, `protoPayload`, `httpRequest`, `labels`, `sourceLocation`.
+     *
+     * Restricting a repeated field will restrict all values. Adding a parent will
+     * block all child fields. (e.g. `foo.bar` will block `foo.bar.baz`)
+     * 
+ * + * repeated string restricted_fields = 15; + * + * @return The count of restrictedFields. + */ + public int getRestrictedFieldsCount() { + return restrictedFields_.size(); + } + + /** + * + * + *
+     * Log entry field paths that are denied access in this bucket.
+     *
+     * The following fields and their children are eligible: `textPayload`,
+     * `jsonPayload`, `protoPayload`, `httpRequest`, `labels`, `sourceLocation`.
+     *
+     * Restricting a repeated field will restrict all values. Adding a parent will
+     * block all child fields. (e.g. `foo.bar` will block `foo.bar.baz`)
+     * 
+ * + * repeated string restricted_fields = 15; + * + * @param index The index of the element to return. + * @return The restrictedFields at the given index. + */ + public java.lang.String getRestrictedFields(int index) { + return restrictedFields_.get(index); + } + + /** + * + * + *
+     * Log entry field paths that are denied access in this bucket.
+     *
+     * The following fields and their children are eligible: `textPayload`,
+     * `jsonPayload`, `protoPayload`, `httpRequest`, `labels`, `sourceLocation`.
+     *
+     * Restricting a repeated field will restrict all values. Adding a parent will
+     * block all child fields. (e.g. `foo.bar` will block `foo.bar.baz`)
+     * 
+ * + * repeated string restricted_fields = 15; + * + * @param index The index of the value to return. + * @return The bytes of the restrictedFields at the given index. + */ + public com.google.protobuf.ByteString getRestrictedFieldsBytes(int index) { + return restrictedFields_.getByteString(index); + } + + /** + * + * + *
+     * Log entry field paths that are denied access in this bucket.
+     *
+     * The following fields and their children are eligible: `textPayload`,
+     * `jsonPayload`, `protoPayload`, `httpRequest`, `labels`, `sourceLocation`.
+     *
+     * Restricting a repeated field will restrict all values. Adding a parent will
+     * block all child fields. (e.g. `foo.bar` will block `foo.bar.baz`)
+     * 
+ * + * repeated string restricted_fields = 15; + * + * @param index The index to set the value at. + * @param value The restrictedFields to set. + * @return This builder for chaining. + */ + public Builder setRestrictedFields(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRestrictedFieldsIsMutable(); + restrictedFields_.set(index, value); + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Log entry field paths that are denied access in this bucket.
+     *
+     * The following fields and their children are eligible: `textPayload`,
+     * `jsonPayload`, `protoPayload`, `httpRequest`, `labels`, `sourceLocation`.
+     *
+     * Restricting a repeated field will restrict all values. Adding a parent will
+     * block all child fields. (e.g. `foo.bar` will block `foo.bar.baz`)
+     * 
+ * + * repeated string restricted_fields = 15; + * + * @param value The restrictedFields to add. + * @return This builder for chaining. + */ + public Builder addRestrictedFields(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRestrictedFieldsIsMutable(); + restrictedFields_.add(value); + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Log entry field paths that are denied access in this bucket.
+     *
+     * The following fields and their children are eligible: `textPayload`,
+     * `jsonPayload`, `protoPayload`, `httpRequest`, `labels`, `sourceLocation`.
+     *
+     * Restricting a repeated field will restrict all values. Adding a parent will
+     * block all child fields. (e.g. `foo.bar` will block `foo.bar.baz`)
+     * 
+ * + * repeated string restricted_fields = 15; + * + * @param values The restrictedFields to add. + * @return This builder for chaining. + */ + public Builder addAllRestrictedFields(java.lang.Iterable values) { + ensureRestrictedFieldsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, restrictedFields_); + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Log entry field paths that are denied access in this bucket.
+     *
+     * The following fields and their children are eligible: `textPayload`,
+     * `jsonPayload`, `protoPayload`, `httpRequest`, `labels`, `sourceLocation`.
+     *
+     * Restricting a repeated field will restrict all values. Adding a parent will
+     * block all child fields. (e.g. `foo.bar` will block `foo.bar.baz`)
+     * 
+ * + * repeated string restricted_fields = 15; + * + * @return This builder for chaining. + */ + public Builder clearRestrictedFields() { + restrictedFields_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000100); + ; + onChanged(); + return this; + } + + /** + * + * + *
+     * Log entry field paths that are denied access in this bucket.
+     *
+     * The following fields and their children are eligible: `textPayload`,
+     * `jsonPayload`, `protoPayload`, `httpRequest`, `labels`, `sourceLocation`.
+     *
+     * Restricting a repeated field will restrict all values. Adding a parent will
+     * block all child fields. (e.g. `foo.bar` will block `foo.bar.baz`)
+     * 
+ * + * repeated string restricted_fields = 15; + * + * @param value The bytes of the restrictedFields to add. + * @return This builder for chaining. + */ + public Builder addRestrictedFieldsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureRestrictedFieldsIsMutable(); + restrictedFields_.add(value); + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + private java.util.List indexConfigs_ = + java.util.Collections.emptyList(); + + private void ensureIndexConfigsIsMutable() { + if (!((bitField0_ & 0x00000200) != 0)) { + indexConfigs_ = new java.util.ArrayList(indexConfigs_); + bitField0_ |= 0x00000200; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.logging.v2.IndexConfig, + com.google.logging.v2.IndexConfig.Builder, + com.google.logging.v2.IndexConfigOrBuilder> + indexConfigsBuilder_; + + /** + * + * + *
+     * A list of indexed fields and related configuration data.
+     * 
+ * + * repeated .google.logging.v2.IndexConfig index_configs = 17; + */ + public java.util.List getIndexConfigsList() { + if (indexConfigsBuilder_ == null) { + return java.util.Collections.unmodifiableList(indexConfigs_); + } else { + return indexConfigsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * A list of indexed fields and related configuration data.
+     * 
+ * + * repeated .google.logging.v2.IndexConfig index_configs = 17; + */ + public int getIndexConfigsCount() { + if (indexConfigsBuilder_ == null) { + return indexConfigs_.size(); + } else { + return indexConfigsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * A list of indexed fields and related configuration data.
+     * 
+ * + * repeated .google.logging.v2.IndexConfig index_configs = 17; + */ + public com.google.logging.v2.IndexConfig getIndexConfigs(int index) { + if (indexConfigsBuilder_ == null) { + return indexConfigs_.get(index); + } else { + return indexConfigsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * A list of indexed fields and related configuration data.
+     * 
+ * + * repeated .google.logging.v2.IndexConfig index_configs = 17; + */ + public Builder setIndexConfigs(int index, com.google.logging.v2.IndexConfig value) { + if (indexConfigsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIndexConfigsIsMutable(); + indexConfigs_.set(index, value); + onChanged(); + } else { + indexConfigsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * A list of indexed fields and related configuration data.
+     * 
+ * + * repeated .google.logging.v2.IndexConfig index_configs = 17; + */ + public Builder setIndexConfigs( + int index, com.google.logging.v2.IndexConfig.Builder builderForValue) { + if (indexConfigsBuilder_ == null) { + ensureIndexConfigsIsMutable(); + indexConfigs_.set(index, builderForValue.build()); + onChanged(); + } else { + indexConfigsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of indexed fields and related configuration data.
+     * 
+ * + * repeated .google.logging.v2.IndexConfig index_configs = 17; + */ + public Builder addIndexConfigs(com.google.logging.v2.IndexConfig value) { + if (indexConfigsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIndexConfigsIsMutable(); + indexConfigs_.add(value); + onChanged(); + } else { + indexConfigsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * A list of indexed fields and related configuration data.
+     * 
+ * + * repeated .google.logging.v2.IndexConfig index_configs = 17; + */ + public Builder addIndexConfigs(int index, com.google.logging.v2.IndexConfig value) { + if (indexConfigsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureIndexConfigsIsMutable(); + indexConfigs_.add(index, value); + onChanged(); + } else { + indexConfigsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * A list of indexed fields and related configuration data.
+     * 
+ * + * repeated .google.logging.v2.IndexConfig index_configs = 17; + */ + public Builder addIndexConfigs(com.google.logging.v2.IndexConfig.Builder builderForValue) { + if (indexConfigsBuilder_ == null) { + ensureIndexConfigsIsMutable(); + indexConfigs_.add(builderForValue.build()); + onChanged(); + } else { + indexConfigsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of indexed fields and related configuration data.
+     * 
+ * + * repeated .google.logging.v2.IndexConfig index_configs = 17; + */ + public Builder addIndexConfigs( + int index, com.google.logging.v2.IndexConfig.Builder builderForValue) { + if (indexConfigsBuilder_ == null) { + ensureIndexConfigsIsMutable(); + indexConfigs_.add(index, builderForValue.build()); + onChanged(); + } else { + indexConfigsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of indexed fields and related configuration data.
+     * 
+ * + * repeated .google.logging.v2.IndexConfig index_configs = 17; + */ + public Builder addAllIndexConfigs( + java.lang.Iterable values) { + if (indexConfigsBuilder_ == null) { + ensureIndexConfigsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, indexConfigs_); + onChanged(); + } else { + indexConfigsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * A list of indexed fields and related configuration data.
+     * 
+ * + * repeated .google.logging.v2.IndexConfig index_configs = 17; + */ + public Builder clearIndexConfigs() { + if (indexConfigsBuilder_ == null) { + indexConfigs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000200); + onChanged(); + } else { + indexConfigsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * A list of indexed fields and related configuration data.
+     * 
+ * + * repeated .google.logging.v2.IndexConfig index_configs = 17; + */ + public Builder removeIndexConfigs(int index) { + if (indexConfigsBuilder_ == null) { + ensureIndexConfigsIsMutable(); + indexConfigs_.remove(index); + onChanged(); + } else { + indexConfigsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * A list of indexed fields and related configuration data.
+     * 
+ * + * repeated .google.logging.v2.IndexConfig index_configs = 17; + */ + public com.google.logging.v2.IndexConfig.Builder getIndexConfigsBuilder(int index) { + return getIndexConfigsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * A list of indexed fields and related configuration data.
+     * 
+ * + * repeated .google.logging.v2.IndexConfig index_configs = 17; + */ + public com.google.logging.v2.IndexConfigOrBuilder getIndexConfigsOrBuilder(int index) { + if (indexConfigsBuilder_ == null) { + return indexConfigs_.get(index); + } else { + return indexConfigsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * A list of indexed fields and related configuration data.
+     * 
+ * + * repeated .google.logging.v2.IndexConfig index_configs = 17; + */ + public java.util.List + getIndexConfigsOrBuilderList() { + if (indexConfigsBuilder_ != null) { + return indexConfigsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(indexConfigs_); + } + } + + /** + * + * + *
+     * A list of indexed fields and related configuration data.
+     * 
+ * + * repeated .google.logging.v2.IndexConfig index_configs = 17; + */ + public com.google.logging.v2.IndexConfig.Builder addIndexConfigsBuilder() { + return getIndexConfigsFieldBuilder() + .addBuilder(com.google.logging.v2.IndexConfig.getDefaultInstance()); + } + + /** + * + * + *
+     * A list of indexed fields and related configuration data.
+     * 
+ * + * repeated .google.logging.v2.IndexConfig index_configs = 17; + */ + public com.google.logging.v2.IndexConfig.Builder addIndexConfigsBuilder(int index) { + return getIndexConfigsFieldBuilder() + .addBuilder(index, com.google.logging.v2.IndexConfig.getDefaultInstance()); + } + + /** + * + * + *
+     * A list of indexed fields and related configuration data.
+     * 
+ * + * repeated .google.logging.v2.IndexConfig index_configs = 17; + */ + public java.util.List getIndexConfigsBuilderList() { + return getIndexConfigsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.logging.v2.IndexConfig, + com.google.logging.v2.IndexConfig.Builder, + com.google.logging.v2.IndexConfigOrBuilder> + getIndexConfigsFieldBuilder() { + if (indexConfigsBuilder_ == null) { + indexConfigsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.logging.v2.IndexConfig, + com.google.logging.v2.IndexConfig.Builder, + com.google.logging.v2.IndexConfigOrBuilder>( + indexConfigs_, ((bitField0_ & 0x00000200) != 0), getParentForChildren(), isClean()); + indexConfigs_ = null; + } + return indexConfigsBuilder_; + } + + private com.google.logging.v2.CmekSettings cmekSettings_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.CmekSettings, + com.google.logging.v2.CmekSettings.Builder, + com.google.logging.v2.CmekSettingsOrBuilder> + cmekSettingsBuilder_; + + /** + * + * + *
+     * The CMEK settings of the log bucket. If present, new log entries written to
+     * this log bucket are encrypted using the CMEK key provided in this
+     * configuration. If a log bucket has CMEK settings, the CMEK settings cannot
+     * be disabled later by updating the log bucket. Changing the KMS key is
+     * allowed.
+     * 
+ * + * .google.logging.v2.CmekSettings cmek_settings = 19; + * + * @return Whether the cmekSettings field is set. + */ + public boolean hasCmekSettings() { + return ((bitField0_ & 0x00000400) != 0); + } + + /** + * + * + *
+     * The CMEK settings of the log bucket. If present, new log entries written to
+     * this log bucket are encrypted using the CMEK key provided in this
+     * configuration. If a log bucket has CMEK settings, the CMEK settings cannot
+     * be disabled later by updating the log bucket. Changing the KMS key is
+     * allowed.
+     * 
+ * + * .google.logging.v2.CmekSettings cmek_settings = 19; + * + * @return The cmekSettings. + */ + public com.google.logging.v2.CmekSettings getCmekSettings() { + if (cmekSettingsBuilder_ == null) { + return cmekSettings_ == null + ? com.google.logging.v2.CmekSettings.getDefaultInstance() + : cmekSettings_; + } else { + return cmekSettingsBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The CMEK settings of the log bucket. If present, new log entries written to
+     * this log bucket are encrypted using the CMEK key provided in this
+     * configuration. If a log bucket has CMEK settings, the CMEK settings cannot
+     * be disabled later by updating the log bucket. Changing the KMS key is
+     * allowed.
+     * 
+ * + * .google.logging.v2.CmekSettings cmek_settings = 19; + */ + public Builder setCmekSettings(com.google.logging.v2.CmekSettings value) { + if (cmekSettingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + cmekSettings_ = value; + } else { + cmekSettingsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + /** + * + * + *
+     * The CMEK settings of the log bucket. If present, new log entries written to
+     * this log bucket are encrypted using the CMEK key provided in this
+     * configuration. If a log bucket has CMEK settings, the CMEK settings cannot
+     * be disabled later by updating the log bucket. Changing the KMS key is
+     * allowed.
+     * 
+ * + * .google.logging.v2.CmekSettings cmek_settings = 19; + */ + public Builder setCmekSettings(com.google.logging.v2.CmekSettings.Builder builderForValue) { + if (cmekSettingsBuilder_ == null) { + cmekSettings_ = builderForValue.build(); + } else { + cmekSettingsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + /** + * + * + *
+     * The CMEK settings of the log bucket. If present, new log entries written to
+     * this log bucket are encrypted using the CMEK key provided in this
+     * configuration. If a log bucket has CMEK settings, the CMEK settings cannot
+     * be disabled later by updating the log bucket. Changing the KMS key is
+     * allowed.
+     * 
+ * + * .google.logging.v2.CmekSettings cmek_settings = 19; + */ + public Builder mergeCmekSettings(com.google.logging.v2.CmekSettings value) { + if (cmekSettingsBuilder_ == null) { + if (((bitField0_ & 0x00000400) != 0) + && cmekSettings_ != null + && cmekSettings_ != com.google.logging.v2.CmekSettings.getDefaultInstance()) { + getCmekSettingsBuilder().mergeFrom(value); + } else { + cmekSettings_ = value; + } + } else { + cmekSettingsBuilder_.mergeFrom(value); + } + if (cmekSettings_ != null) { + bitField0_ |= 0x00000400; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The CMEK settings of the log bucket. If present, new log entries written to
+     * this log bucket are encrypted using the CMEK key provided in this
+     * configuration. If a log bucket has CMEK settings, the CMEK settings cannot
+     * be disabled later by updating the log bucket. Changing the KMS key is
+     * allowed.
+     * 
+ * + * .google.logging.v2.CmekSettings cmek_settings = 19; + */ + public Builder clearCmekSettings() { + bitField0_ = (bitField0_ & ~0x00000400); + cmekSettings_ = null; + if (cmekSettingsBuilder_ != null) { + cmekSettingsBuilder_.dispose(); + cmekSettingsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * The CMEK settings of the log bucket. If present, new log entries written to
+     * this log bucket are encrypted using the CMEK key provided in this
+     * configuration. If a log bucket has CMEK settings, the CMEK settings cannot
+     * be disabled later by updating the log bucket. Changing the KMS key is
+     * allowed.
+     * 
+ * + * .google.logging.v2.CmekSettings cmek_settings = 19; + */ + public com.google.logging.v2.CmekSettings.Builder getCmekSettingsBuilder() { + bitField0_ |= 0x00000400; + onChanged(); + return getCmekSettingsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The CMEK settings of the log bucket. If present, new log entries written to
+     * this log bucket are encrypted using the CMEK key provided in this
+     * configuration. If a log bucket has CMEK settings, the CMEK settings cannot
+     * be disabled later by updating the log bucket. Changing the KMS key is
+     * allowed.
+     * 
+ * + * .google.logging.v2.CmekSettings cmek_settings = 19; + */ + public com.google.logging.v2.CmekSettingsOrBuilder getCmekSettingsOrBuilder() { + if (cmekSettingsBuilder_ != null) { + return cmekSettingsBuilder_.getMessageOrBuilder(); + } else { + return cmekSettings_ == null + ? com.google.logging.v2.CmekSettings.getDefaultInstance() + : cmekSettings_; + } + } + + /** + * + * + *
+     * The CMEK settings of the log bucket. If present, new log entries written to
+     * this log bucket are encrypted using the CMEK key provided in this
+     * configuration. If a log bucket has CMEK settings, the CMEK settings cannot
+     * be disabled later by updating the log bucket. Changing the KMS key is
+     * allowed.
+     * 
+ * + * .google.logging.v2.CmekSettings cmek_settings = 19; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.CmekSettings, + com.google.logging.v2.CmekSettings.Builder, + com.google.logging.v2.CmekSettingsOrBuilder> + getCmekSettingsFieldBuilder() { + if (cmekSettingsBuilder_ == null) { + cmekSettingsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.CmekSettings, + com.google.logging.v2.CmekSettings.Builder, + com.google.logging.v2.CmekSettingsOrBuilder>( + getCmekSettings(), getParentForChildren(), isClean()); + cmekSettings_ = null; + } + return cmekSettingsBuilder_; + } + + @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.logging.v2.LogBucket) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.LogBucket) + private static final com.google.logging.v2.LogBucket DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.LogBucket(); + } + + public static com.google.logging.v2.LogBucket getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LogBucket parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.LogBucket getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogBucketName.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogBucketName.java new file mode 100644 index 000000000000..c915636c2972 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogBucketName.java @@ -0,0 +1,535 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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.logging.v2; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.pathtemplate.ValidationException; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class LogBucketName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_BUCKET = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/buckets/{bucket}"); + private static final PathTemplate ORGANIZATION_LOCATION_BUCKET = + PathTemplate.createWithoutUrlEncoding( + "organizations/{organization}/locations/{location}/buckets/{bucket}"); + private static final PathTemplate FOLDER_LOCATION_BUCKET = + PathTemplate.createWithoutUrlEncoding( + "folders/{folder}/locations/{location}/buckets/{bucket}"); + private static final PathTemplate BILLING_ACCOUNT_LOCATION_BUCKET = + PathTemplate.createWithoutUrlEncoding( + "billingAccounts/{billing_account}/locations/{location}/buckets/{bucket}"); + private volatile Map fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; + private final String project; + private final String location; + private final String bucket; + private final String organization; + private final String folder; + private final String billingAccount; + + @Deprecated + protected LogBucketName() { + project = null; + location = null; + bucket = null; + organization = null; + folder = null; + billingAccount = null; + } + + private LogBucketName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + bucket = Preconditions.checkNotNull(builder.getBucket()); + organization = null; + folder = null; + billingAccount = null; + pathTemplate = PROJECT_LOCATION_BUCKET; + } + + private LogBucketName(OrganizationLocationBucketBuilder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + location = Preconditions.checkNotNull(builder.getLocation()); + bucket = Preconditions.checkNotNull(builder.getBucket()); + project = null; + folder = null; + billingAccount = null; + pathTemplate = ORGANIZATION_LOCATION_BUCKET; + } + + private LogBucketName(FolderLocationBucketBuilder builder) { + folder = Preconditions.checkNotNull(builder.getFolder()); + location = Preconditions.checkNotNull(builder.getLocation()); + bucket = Preconditions.checkNotNull(builder.getBucket()); + project = null; + organization = null; + billingAccount = null; + pathTemplate = FOLDER_LOCATION_BUCKET; + } + + private LogBucketName(BillingAccountLocationBucketBuilder builder) { + billingAccount = Preconditions.checkNotNull(builder.getBillingAccount()); + location = Preconditions.checkNotNull(builder.getLocation()); + bucket = Preconditions.checkNotNull(builder.getBucket()); + project = null; + organization = null; + folder = null; + pathTemplate = BILLING_ACCOUNT_LOCATION_BUCKET; + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getBucket() { + return bucket; + } + + public String getOrganization() { + return organization; + } + + public String getFolder() { + return folder; + } + + public String getBillingAccount() { + return billingAccount; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public static Builder newProjectLocationBucketBuilder() { + return new Builder(); + } + + public static OrganizationLocationBucketBuilder newOrganizationLocationBucketBuilder() { + return new OrganizationLocationBucketBuilder(); + } + + public static FolderLocationBucketBuilder newFolderLocationBucketBuilder() { + return new FolderLocationBucketBuilder(); + } + + public static BillingAccountLocationBucketBuilder newBillingAccountLocationBucketBuilder() { + return new BillingAccountLocationBucketBuilder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static LogBucketName of(String project, String location, String bucket) { + return newBuilder().setProject(project).setLocation(location).setBucket(bucket).build(); + } + + public static LogBucketName ofProjectLocationBucketName( + String project, String location, String bucket) { + return newBuilder().setProject(project).setLocation(location).setBucket(bucket).build(); + } + + public static LogBucketName ofOrganizationLocationBucketName( + String organization, String location, String bucket) { + return newOrganizationLocationBucketBuilder() + .setOrganization(organization) + .setLocation(location) + .setBucket(bucket) + .build(); + } + + public static LogBucketName ofFolderLocationBucketName( + String folder, String location, String bucket) { + return newFolderLocationBucketBuilder() + .setFolder(folder) + .setLocation(location) + .setBucket(bucket) + .build(); + } + + public static LogBucketName ofBillingAccountLocationBucketName( + String billingAccount, String location, String bucket) { + return newBillingAccountLocationBucketBuilder() + .setBillingAccount(billingAccount) + .setLocation(location) + .setBucket(bucket) + .build(); + } + + public static String format(String project, String location, String bucket) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setBucket(bucket) + .build() + .toString(); + } + + public static String formatProjectLocationBucketName( + String project, String location, String bucket) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setBucket(bucket) + .build() + .toString(); + } + + public static String formatOrganizationLocationBucketName( + String organization, String location, String bucket) { + return newOrganizationLocationBucketBuilder() + .setOrganization(organization) + .setLocation(location) + .setBucket(bucket) + .build() + .toString(); + } + + public static String formatFolderLocationBucketName( + String folder, String location, String bucket) { + return newFolderLocationBucketBuilder() + .setFolder(folder) + .setLocation(location) + .setBucket(bucket) + .build() + .toString(); + } + + public static String formatBillingAccountLocationBucketName( + String billingAccount, String location, String bucket) { + return newBillingAccountLocationBucketBuilder() + .setBillingAccount(billingAccount) + .setLocation(location) + .setBucket(bucket) + .build() + .toString(); + } + + public static LogBucketName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + if (PROJECT_LOCATION_BUCKET.matches(formattedString)) { + Map matchMap = PROJECT_LOCATION_BUCKET.match(formattedString); + return ofProjectLocationBucketName( + matchMap.get("project"), matchMap.get("location"), matchMap.get("bucket")); + } else if (ORGANIZATION_LOCATION_BUCKET.matches(formattedString)) { + Map matchMap = ORGANIZATION_LOCATION_BUCKET.match(formattedString); + return ofOrganizationLocationBucketName( + matchMap.get("organization"), matchMap.get("location"), matchMap.get("bucket")); + } else if (FOLDER_LOCATION_BUCKET.matches(formattedString)) { + Map matchMap = FOLDER_LOCATION_BUCKET.match(formattedString); + return ofFolderLocationBucketName( + matchMap.get("folder"), matchMap.get("location"), matchMap.get("bucket")); + } else if (BILLING_ACCOUNT_LOCATION_BUCKET.matches(formattedString)) { + Map matchMap = BILLING_ACCOUNT_LOCATION_BUCKET.match(formattedString); + return ofBillingAccountLocationBucketName( + matchMap.get("billing_account"), matchMap.get("location"), matchMap.get("bucket")); + } + throw new ValidationException("LogBucketName.parse: formattedString not in valid format"); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (LogBucketName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_BUCKET.matches(formattedString) + || ORGANIZATION_LOCATION_BUCKET.matches(formattedString) + || FOLDER_LOCATION_BUCKET.matches(formattedString) + || BILLING_ACCOUNT_LOCATION_BUCKET.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (bucket != null) { + fieldMapBuilder.put("bucket", bucket); + } + if (organization != null) { + fieldMapBuilder.put("organization", organization); + } + if (folder != null) { + fieldMapBuilder.put("folder", folder); + } + if (billingAccount != null) { + fieldMapBuilder.put("billing_account", billingAccount); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + LogBucketName that = ((LogBucketName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.bucket, that.bucket) + && Objects.equals(this.organization, that.organization) + && Objects.equals(this.folder, that.folder) + && Objects.equals(this.billingAccount, that.billingAccount); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(fixedValue); + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(bucket); + h *= 1000003; + h ^= Objects.hashCode(organization); + h *= 1000003; + h ^= Objects.hashCode(folder); + h *= 1000003; + h ^= Objects.hashCode(billingAccount); + return h; + } + + /** Builder for projects/{project}/locations/{location}/buckets/{bucket}. */ + public static class Builder { + private String project; + private String location; + private String bucket; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getBucket() { + return bucket; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setBucket(String bucket) { + this.bucket = bucket; + return this; + } + + private Builder(LogBucketName logBucketName) { + Preconditions.checkArgument( + Objects.equals(logBucketName.pathTemplate, PROJECT_LOCATION_BUCKET), + "toBuilder is only supported when LogBucketName has the pattern of" + + " projects/{project}/locations/{location}/buckets/{bucket}"); + this.project = logBucketName.project; + this.location = logBucketName.location; + this.bucket = logBucketName.bucket; + } + + public LogBucketName build() { + return new LogBucketName(this); + } + } + + /** Builder for organizations/{organization}/locations/{location}/buckets/{bucket}. */ + public static class OrganizationLocationBucketBuilder { + private String organization; + private String location; + private String bucket; + + protected OrganizationLocationBucketBuilder() {} + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public String getBucket() { + return bucket; + } + + public OrganizationLocationBucketBuilder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public OrganizationLocationBucketBuilder setLocation(String location) { + this.location = location; + return this; + } + + public OrganizationLocationBucketBuilder setBucket(String bucket) { + this.bucket = bucket; + return this; + } + + public LogBucketName build() { + return new LogBucketName(this); + } + } + + /** Builder for folders/{folder}/locations/{location}/buckets/{bucket}. */ + public static class FolderLocationBucketBuilder { + private String folder; + private String location; + private String bucket; + + protected FolderLocationBucketBuilder() {} + + public String getFolder() { + return folder; + } + + public String getLocation() { + return location; + } + + public String getBucket() { + return bucket; + } + + public FolderLocationBucketBuilder setFolder(String folder) { + this.folder = folder; + return this; + } + + public FolderLocationBucketBuilder setLocation(String location) { + this.location = location; + return this; + } + + public FolderLocationBucketBuilder setBucket(String bucket) { + this.bucket = bucket; + return this; + } + + public LogBucketName build() { + return new LogBucketName(this); + } + } + + /** Builder for billingAccounts/{billing_account}/locations/{location}/buckets/{bucket}. */ + public static class BillingAccountLocationBucketBuilder { + private String billingAccount; + private String location; + private String bucket; + + protected BillingAccountLocationBucketBuilder() {} + + public String getBillingAccount() { + return billingAccount; + } + + public String getLocation() { + return location; + } + + public String getBucket() { + return bucket; + } + + public BillingAccountLocationBucketBuilder setBillingAccount(String billingAccount) { + this.billingAccount = billingAccount; + return this; + } + + public BillingAccountLocationBucketBuilder setLocation(String location) { + this.location = location; + return this; + } + + public BillingAccountLocationBucketBuilder setBucket(String bucket) { + this.bucket = bucket; + return this; + } + + public LogBucketName build() { + return new LogBucketName(this); + } + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogBucketOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogBucketOrBuilder.java new file mode 100644 index 000000000000..b76c22af262d --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogBucketOrBuilder.java @@ -0,0 +1,445 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface LogBucketOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.LogBucket) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The resource name of the bucket.
+   *
+   * For example:
+   *
+   *   `projects/my-project/locations/global/buckets/my-bucket`
+   *
+   * For a list of supported locations, see [Supported
+   * Regions](https://cloud.google.com/logging/docs/region-support)
+   *
+   * For the location of `global` it is unspecified where log entries are
+   * actually stored.
+   *
+   * After a bucket has been created, the location cannot be changed.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Output only. The resource name of the bucket.
+   *
+   * For example:
+   *
+   *   `projects/my-project/locations/global/buckets/my-bucket`
+   *
+   * For a list of supported locations, see [Supported
+   * Regions](https://cloud.google.com/logging/docs/region-support)
+   *
+   * For the location of `global` it is unspecified where log entries are
+   * actually stored.
+   *
+   * After a bucket has been created, the location cannot be changed.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Describes this bucket.
+   * 
+ * + * string description = 3; + * + * @return The description. + */ + java.lang.String getDescription(); + + /** + * + * + *
+   * Describes this bucket.
+   * 
+ * + * string description = 3; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Output only. The creation timestamp of the bucket. This is not set for any
+   * of the default buckets.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + + /** + * + * + *
+   * Output only. The creation timestamp of the bucket. This is not set for any
+   * of the default buckets.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + + /** + * + * + *
+   * Output only. The creation timestamp of the bucket. This is not set for any
+   * of the default buckets.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The last update timestamp of the bucket.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + + /** + * + * + *
+   * Output only. The last update timestamp of the bucket.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + + /** + * + * + *
+   * Output only. The last update timestamp of the bucket.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Logs will be retained by default for this amount of time, after which they
+   * will automatically be deleted. The minimum retention period is 1 day. If
+   * this value is set to zero at bucket creation time, the default time of 30
+   * days will be used.
+   * 
+ * + * int32 retention_days = 11; + * + * @return The retentionDays. + */ + int getRetentionDays(); + + /** + * + * + *
+   * Whether the bucket is locked.
+   *
+   * The retention period on a locked bucket cannot be changed. Locked buckets
+   * may only be deleted if they are empty.
+   * 
+ * + * bool locked = 9; + * + * @return The locked. + */ + boolean getLocked(); + + /** + * + * + *
+   * Output only. The bucket lifecycle state.
+   * 
+ * + * + * .google.logging.v2.LifecycleState lifecycle_state = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for lifecycleState. + */ + int getLifecycleStateValue(); + + /** + * + * + *
+   * Output only. The bucket lifecycle state.
+   * 
+ * + * + * .google.logging.v2.LifecycleState lifecycle_state = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The lifecycleState. + */ + com.google.logging.v2.LifecycleState getLifecycleState(); + + /** + * + * + *
+   * Whether log analytics is enabled for this bucket.
+   *
+   * Once enabled, log analytics features cannot be disabled.
+   * 
+ * + * bool analytics_enabled = 14; + * + * @return The analyticsEnabled. + */ + boolean getAnalyticsEnabled(); + + /** + * + * + *
+   * Log entry field paths that are denied access in this bucket.
+   *
+   * The following fields and their children are eligible: `textPayload`,
+   * `jsonPayload`, `protoPayload`, `httpRequest`, `labels`, `sourceLocation`.
+   *
+   * Restricting a repeated field will restrict all values. Adding a parent will
+   * block all child fields. (e.g. `foo.bar` will block `foo.bar.baz`)
+   * 
+ * + * repeated string restricted_fields = 15; + * + * @return A list containing the restrictedFields. + */ + java.util.List getRestrictedFieldsList(); + + /** + * + * + *
+   * Log entry field paths that are denied access in this bucket.
+   *
+   * The following fields and their children are eligible: `textPayload`,
+   * `jsonPayload`, `protoPayload`, `httpRequest`, `labels`, `sourceLocation`.
+   *
+   * Restricting a repeated field will restrict all values. Adding a parent will
+   * block all child fields. (e.g. `foo.bar` will block `foo.bar.baz`)
+   * 
+ * + * repeated string restricted_fields = 15; + * + * @return The count of restrictedFields. + */ + int getRestrictedFieldsCount(); + + /** + * + * + *
+   * Log entry field paths that are denied access in this bucket.
+   *
+   * The following fields and their children are eligible: `textPayload`,
+   * `jsonPayload`, `protoPayload`, `httpRequest`, `labels`, `sourceLocation`.
+   *
+   * Restricting a repeated field will restrict all values. Adding a parent will
+   * block all child fields. (e.g. `foo.bar` will block `foo.bar.baz`)
+   * 
+ * + * repeated string restricted_fields = 15; + * + * @param index The index of the element to return. + * @return The restrictedFields at the given index. + */ + java.lang.String getRestrictedFields(int index); + + /** + * + * + *
+   * Log entry field paths that are denied access in this bucket.
+   *
+   * The following fields and their children are eligible: `textPayload`,
+   * `jsonPayload`, `protoPayload`, `httpRequest`, `labels`, `sourceLocation`.
+   *
+   * Restricting a repeated field will restrict all values. Adding a parent will
+   * block all child fields. (e.g. `foo.bar` will block `foo.bar.baz`)
+   * 
+ * + * repeated string restricted_fields = 15; + * + * @param index The index of the value to return. + * @return The bytes of the restrictedFields at the given index. + */ + com.google.protobuf.ByteString getRestrictedFieldsBytes(int index); + + /** + * + * + *
+   * A list of indexed fields and related configuration data.
+   * 
+ * + * repeated .google.logging.v2.IndexConfig index_configs = 17; + */ + java.util.List getIndexConfigsList(); + + /** + * + * + *
+   * A list of indexed fields and related configuration data.
+   * 
+ * + * repeated .google.logging.v2.IndexConfig index_configs = 17; + */ + com.google.logging.v2.IndexConfig getIndexConfigs(int index); + + /** + * + * + *
+   * A list of indexed fields and related configuration data.
+   * 
+ * + * repeated .google.logging.v2.IndexConfig index_configs = 17; + */ + int getIndexConfigsCount(); + + /** + * + * + *
+   * A list of indexed fields and related configuration data.
+   * 
+ * + * repeated .google.logging.v2.IndexConfig index_configs = 17; + */ + java.util.List + getIndexConfigsOrBuilderList(); + + /** + * + * + *
+   * A list of indexed fields and related configuration data.
+   * 
+ * + * repeated .google.logging.v2.IndexConfig index_configs = 17; + */ + com.google.logging.v2.IndexConfigOrBuilder getIndexConfigsOrBuilder(int index); + + /** + * + * + *
+   * The CMEK settings of the log bucket. If present, new log entries written to
+   * this log bucket are encrypted using the CMEK key provided in this
+   * configuration. If a log bucket has CMEK settings, the CMEK settings cannot
+   * be disabled later by updating the log bucket. Changing the KMS key is
+   * allowed.
+   * 
+ * + * .google.logging.v2.CmekSettings cmek_settings = 19; + * + * @return Whether the cmekSettings field is set. + */ + boolean hasCmekSettings(); + + /** + * + * + *
+   * The CMEK settings of the log bucket. If present, new log entries written to
+   * this log bucket are encrypted using the CMEK key provided in this
+   * configuration. If a log bucket has CMEK settings, the CMEK settings cannot
+   * be disabled later by updating the log bucket. Changing the KMS key is
+   * allowed.
+   * 
+ * + * .google.logging.v2.CmekSettings cmek_settings = 19; + * + * @return The cmekSettings. + */ + com.google.logging.v2.CmekSettings getCmekSettings(); + + /** + * + * + *
+   * The CMEK settings of the log bucket. If present, new log entries written to
+   * this log bucket are encrypted using the CMEK key provided in this
+   * configuration. If a log bucket has CMEK settings, the CMEK settings cannot
+   * be disabled later by updating the log bucket. Changing the KMS key is
+   * allowed.
+   * 
+ * + * .google.logging.v2.CmekSettings cmek_settings = 19; + */ + com.google.logging.v2.CmekSettingsOrBuilder getCmekSettingsOrBuilder(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntry.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntry.java new file mode 100644 index 000000000000..f16da0da7216 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntry.java @@ -0,0 +1,5802 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/log_entry.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * An individual entry in a log.
+ * 
+ * + * Protobuf type {@code google.logging.v2.LogEntry} + */ +public final class LogEntry extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.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() { + logName_ = ""; + severity_ = 0; + insertId_ = ""; + trace_ = ""; + spanId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new LogEntry(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LogEntryProto + .internal_static_google_logging_v2_LogEntry_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 11: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LogEntryProto + .internal_static_google_logging_v2_LogEntry_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.LogEntry.class, com.google.logging.v2.LogEntry.Builder.class); + } + + private int bitField0_; + private int payloadCase_ = 0; + + @SuppressWarnings("serial") + 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), + JSON_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 JSON_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 LOG_NAME_FIELD_NUMBER = 12; + + @SuppressWarnings("serial") + private volatile java.lang.Object logName_ = ""; + + /** + * + * + *
+   * Required. The resource name of the log to which this log entry belongs:
+   *
+   *     "projects/[PROJECT_ID]/logs/[LOG_ID]"
+   *     "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]"
+   *     "folders/[FOLDER_ID]/logs/[LOG_ID]"
+   *
+   * A project number may be used in place of PROJECT_ID. The project number is
+   * translated to its corresponding PROJECT_ID internally and the `log_name`
+   * field will contain PROJECT_ID in queries and exports.
+   *
+   * `[LOG_ID]` must be URL-encoded within `log_name`. Example:
+   * `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`.
+   *
+   * `[LOG_ID]` must be less than 512 characters long and can only include the
+   * following characters: upper and lower case alphanumeric characters,
+   * forward-slash, underscore, hyphen, and period.
+   *
+   * For backward compatibility, if `log_name` begins with a forward-slash, such
+   * as `/projects/...`, then the log entry is ingested as usual, but the
+   * forward-slash is removed. Listing the log entry will not show the leading
+   * slash and filtering for a log name with a leading slash will never return
+   * any results.
+   * 
+ * + * string log_name = 12 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The logName. + */ + @java.lang.Override + public java.lang.String getLogName() { + java.lang.Object ref = logName_; + 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(); + logName_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The resource name of the log to which this log entry belongs:
+   *
+   *     "projects/[PROJECT_ID]/logs/[LOG_ID]"
+   *     "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]"
+   *     "folders/[FOLDER_ID]/logs/[LOG_ID]"
+   *
+   * A project number may be used in place of PROJECT_ID. The project number is
+   * translated to its corresponding PROJECT_ID internally and the `log_name`
+   * field will contain PROJECT_ID in queries and exports.
+   *
+   * `[LOG_ID]` must be URL-encoded within `log_name`. Example:
+   * `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`.
+   *
+   * `[LOG_ID]` must be less than 512 characters long and can only include the
+   * following characters: upper and lower case alphanumeric characters,
+   * forward-slash, underscore, hyphen, and period.
+   *
+   * For backward compatibility, if `log_name` begins with a forward-slash, such
+   * as `/projects/...`, then the log entry is ingested as usual, but the
+   * forward-slash is removed. Listing the log entry will not show the leading
+   * slash and filtering for a log name with a leading slash will never return
+   * any results.
+   * 
+ * + * string log_name = 12 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for logName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLogNameBytes() { + java.lang.Object ref = logName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + logName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RESOURCE_FIELD_NUMBER = 8; + private com.google.api.MonitoredResource resource_; + + /** + * + * + *
+   * Required. The monitored resource that produced this log entry.
+   *
+   * Example: a log entry that reports a database error would be associated with
+   * the monitored resource designating the particular database that reported
+   * the error.
+   * 
+ * + * .google.api.MonitoredResource resource = 8 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the resource field is set. + */ + @java.lang.Override + public boolean hasResource() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Required. The monitored resource that produced this log entry.
+   *
+   * Example: a log entry that reports a database error would be associated with
+   * the monitored resource designating the particular database that reported
+   * the error.
+   * 
+ * + * .google.api.MonitoredResource resource = 8 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The resource. + */ + @java.lang.Override + public com.google.api.MonitoredResource getResource() { + return resource_ == null ? com.google.api.MonitoredResource.getDefaultInstance() : resource_; + } + + /** + * + * + *
+   * Required. The monitored resource that produced this log entry.
+   *
+   * Example: a log entry that reports a database error would be associated with
+   * the monitored resource designating the particular database that reported
+   * the error.
+   * 
+ * + * .google.api.MonitoredResource resource = 8 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.api.MonitoredResourceOrBuilder getResourceOrBuilder() { + return resource_ == null ? com.google.api.MonitoredResource.getDefaultInstance() : resource_; + } + + public static final int PROTO_PAYLOAD_FIELD_NUMBER = 2; + + /** + * + * + *
+   * The log entry payload, represented as a protocol buffer. Some Google
+   * Cloud Platform services use this field for their log entry payloads.
+   *
+   * The following protocol buffer types are supported; user-defined types
+   * are not supported:
+   *
+   *   "type.googleapis.com/google.cloud.audit.AuditLog"
+   *   "type.googleapis.com/google.appengine.logging.v1.RequestLog"
+   * 
+ * + * .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. Some Google
+   * Cloud Platform services use this field for their log entry payloads.
+   *
+   * The following protocol buffer types are supported; user-defined types
+   * are not supported:
+   *
+   *   "type.googleapis.com/google.cloud.audit.AuditLog"
+   *   "type.googleapis.com/google.appengine.logging.v1.RequestLog"
+   * 
+ * + * .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. Some Google
+   * Cloud Platform services use this field for their log entry payloads.
+   *
+   * The following protocol buffer types are supported; user-defined types
+   * are not supported:
+   *
+   *   "type.googleapis.com/google.cloud.audit.AuditLog"
+   *   "type.googleapis.com/google.appengine.logging.v1.RequestLog"
+   * 
+ * + * .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 JSON_PAYLOAD_FIELD_NUMBER = 6; + + /** + * + * + *
+   * The log entry payload, represented as a structure that is
+   * expressed as a JSON object.
+   * 
+ * + * .google.protobuf.Struct json_payload = 6; + * + * @return Whether the jsonPayload field is set. + */ + @java.lang.Override + public boolean hasJsonPayload() { + return payloadCase_ == 6; + } + + /** + * + * + *
+   * The log entry payload, represented as a structure that is
+   * expressed as a JSON object.
+   * 
+ * + * .google.protobuf.Struct json_payload = 6; + * + * @return The jsonPayload. + */ + @java.lang.Override + public com.google.protobuf.Struct getJsonPayload() { + 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 json_payload = 6; + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getJsonPayloadOrBuilder() { + if (payloadCase_ == 6) { + return (com.google.protobuf.Struct) payload_; + } + return com.google.protobuf.Struct.getDefaultInstance(); + } + + public static final int TIMESTAMP_FIELD_NUMBER = 9; + private com.google.protobuf.Timestamp timestamp_; + + /** + * + * + *
+   * Optional. The time the event described by the log entry occurred. This time
+   * is used to compute the log entry's age and to enforce the logs retention
+   * period. If this field is omitted in a new log entry, then Logging assigns
+   * it the current time. Timestamps have nanosecond accuracy, but trailing
+   * zeros in the fractional seconds might be omitted when the timestamp is
+   * displayed.
+   *
+   * Incoming log entries must have timestamps that don't exceed the
+   * [logs retention
+   * period](https://cloud.google.com/logging/quotas#logs_retention_periods) in
+   * the past, and that don't exceed 24 hours in the future. Log entries outside
+   * those time boundaries aren't ingested by Logging.
+   * 
+ * + * .google.protobuf.Timestamp timestamp = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the timestamp field is set. + */ + @java.lang.Override + public boolean hasTimestamp() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Optional. The time the event described by the log entry occurred. This time
+   * is used to compute the log entry's age and to enforce the logs retention
+   * period. If this field is omitted in a new log entry, then Logging assigns
+   * it the current time. Timestamps have nanosecond accuracy, but trailing
+   * zeros in the fractional seconds might be omitted when the timestamp is
+   * displayed.
+   *
+   * Incoming log entries must have timestamps that don't exceed the
+   * [logs retention
+   * period](https://cloud.google.com/logging/quotas#logs_retention_periods) in
+   * the past, and that don't exceed 24 hours in the future. Log entries outside
+   * those time boundaries aren't ingested by Logging.
+   * 
+ * + * .google.protobuf.Timestamp timestamp = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The timestamp. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getTimestamp() { + return timestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : timestamp_; + } + + /** + * + * + *
+   * Optional. The time the event described by the log entry occurred. This time
+   * is used to compute the log entry's age and to enforce the logs retention
+   * period. If this field is omitted in a new log entry, then Logging assigns
+   * it the current time. Timestamps have nanosecond accuracy, but trailing
+   * zeros in the fractional seconds might be omitted when the timestamp is
+   * displayed.
+   *
+   * Incoming log entries must have timestamps that don't exceed the
+   * [logs retention
+   * period](https://cloud.google.com/logging/quotas#logs_retention_periods) in
+   * the past, and that don't exceed 24 hours in the future. Log entries outside
+   * those time boundaries aren't ingested by Logging.
+   * 
+ * + * .google.protobuf.Timestamp timestamp = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getTimestampOrBuilder() { + return timestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : timestamp_; + } + + public static final int RECEIVE_TIMESTAMP_FIELD_NUMBER = 24; + private com.google.protobuf.Timestamp receiveTimestamp_; + + /** + * + * + *
+   * Output only. The time the log entry was received by Logging.
+   * 
+ * + * + * .google.protobuf.Timestamp receive_timestamp = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the receiveTimestamp field is set. + */ + @java.lang.Override + public boolean hasReceiveTimestamp() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * Output only. The time the log entry was received by Logging.
+   * 
+ * + * + * .google.protobuf.Timestamp receive_timestamp = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The receiveTimestamp. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getReceiveTimestamp() { + return receiveTimestamp_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : receiveTimestamp_; + } + + /** + * + * + *
+   * Output only. The time the log entry was received by Logging.
+   * 
+ * + * + * .google.protobuf.Timestamp receive_timestamp = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getReceiveTimestampOrBuilder() { + return receiveTimestamp_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : receiveTimestamp_; + } + + public static final int SEVERITY_FIELD_NUMBER = 10; + private int severity_ = 0; + + /** + * + * + *
+   * Optional. The severity of the log entry. The default value is
+   * `LogSeverity.DEFAULT`.
+   * 
+ * + * .google.logging.type.LogSeverity severity = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for severity. + */ + @java.lang.Override + public int getSeverityValue() { + return severity_; + } + + /** + * + * + *
+   * Optional. The severity of the log entry. The default value is
+   * `LogSeverity.DEFAULT`.
+   * 
+ * + * .google.logging.type.LogSeverity severity = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The severity. + */ + @java.lang.Override + public com.google.logging.type.LogSeverity getSeverity() { + com.google.logging.type.LogSeverity result = + com.google.logging.type.LogSeverity.forNumber(severity_); + return result == null ? com.google.logging.type.LogSeverity.UNRECOGNIZED : result; + } + + public static final int INSERT_ID_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object insertId_ = ""; + + /** + * + * + *
+   * Optional. A unique identifier for the log entry. If you provide a value,
+   * then Logging considers other log entries in the same project, with the same
+   * `timestamp`, and with the same `insert_id` to be duplicates which are
+   * removed in a single query result. However, there are no guarantees of
+   * de-duplication in the export of logs.
+   *
+   * If the `insert_id` is omitted when writing a log entry, the Logging API
+   * assigns its own unique identifier in this field.
+   *
+   * In queries, the `insert_id` is also used to order log entries that have
+   * the same `log_name` and `timestamp` values.
+   * 
+ * + * string insert_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + + /** + * + * + *
+   * Optional. A unique identifier for the log entry. If you provide a value,
+   * then Logging considers other log entries in the same project, with the same
+   * `timestamp`, and with the same `insert_id` to be duplicates which are
+   * removed in a single query result. However, there are no guarantees of
+   * de-duplication in the export of logs.
+   *
+   * If the `insert_id` is omitted when writing a log entry, the Logging API
+   * assigns its own unique identifier in this field.
+   *
+   * In queries, the `insert_id` is also used to order log entries that have
+   * the same `log_name` and `timestamp` values.
+   * 
+ * + * string insert_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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 HTTP_REQUEST_FIELD_NUMBER = 7; + private com.google.logging.type.HttpRequest httpRequest_; + + /** + * + * + *
+   * Optional. Information about the HTTP request associated with this log
+   * entry, if applicable.
+   * 
+ * + * + * .google.logging.type.HttpRequest http_request = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the httpRequest field is set. + */ + @java.lang.Override + public boolean hasHttpRequest() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+   * Optional. Information about the HTTP request associated with this log
+   * entry, if applicable.
+   * 
+ * + * + * .google.logging.type.HttpRequest http_request = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The httpRequest. + */ + @java.lang.Override + public com.google.logging.type.HttpRequest getHttpRequest() { + return httpRequest_ == null + ? com.google.logging.type.HttpRequest.getDefaultInstance() + : httpRequest_; + } + + /** + * + * + *
+   * Optional. Information about the HTTP request associated with this log
+   * entry, if applicable.
+   * 
+ * + * + * .google.logging.type.HttpRequest http_request = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.logging.type.HttpRequestOrBuilder getHttpRequestOrBuilder() { + return httpRequest_ == null + ? com.google.logging.type.HttpRequest.getDefaultInstance() + : httpRequest_; + } + + public static final int LABELS_FIELD_NUMBER = 11; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.logging.v2.LogEntryProto + .internal_static_google_logging_v2_LogEntry_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + + /** + * + * + *
+   * Optional. A map of key, value pairs that provides additional information
+   * about the log entry. The labels can be user-defined or system-defined.
+   *
+   * User-defined labels are arbitrary key, value pairs that you can use to
+   * classify logs.
+   *
+   * System-defined labels are defined by GCP services for platform logs.
+   * They have two components - a service namespace component and the
+   * attribute name. For example: `compute.googleapis.com/resource_name`.
+   *
+   * Cloud Logging truncates label keys that exceed 512 B and label
+   * values that exceed 64 KB upon their associated log entry being
+   * written. The truncation is indicated by an ellipsis at the
+   * end of the character string.
+   * 
+ * + * map<string, string> labels = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + + /** + * + * + *
+   * Optional. A map of key, value pairs that provides additional information
+   * about the log entry. The labels can be user-defined or system-defined.
+   *
+   * User-defined labels are arbitrary key, value pairs that you can use to
+   * classify logs.
+   *
+   * System-defined labels are defined by GCP services for platform logs.
+   * They have two components - a service namespace component and the
+   * attribute name. For example: `compute.googleapis.com/resource_name`.
+   *
+   * Cloud Logging truncates label keys that exceed 512 B and label
+   * values that exceed 64 KB upon their associated log entry being
+   * written. The truncation is indicated by an ellipsis at the
+   * end of the character string.
+   * 
+ * + * map<string, string> labels = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + + /** + * + * + *
+   * Optional. A map of key, value pairs that provides additional information
+   * about the log entry. The labels can be user-defined or system-defined.
+   *
+   * User-defined labels are arbitrary key, value pairs that you can use to
+   * classify logs.
+   *
+   * System-defined labels are defined by GCP services for platform logs.
+   * They have two components - a service namespace component and the
+   * attribute name. For example: `compute.googleapis.com/resource_name`.
+   *
+   * Cloud Logging truncates label keys that exceed 512 B and label
+   * values that exceed 64 KB upon their associated log entry being
+   * written. The truncation is indicated by an ellipsis at the
+   * end of the character string.
+   * 
+ * + * map<string, string> labels = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * + * + *
+   * Optional. A map of key, value pairs that provides additional information
+   * about the log entry. The labels can be user-defined or system-defined.
+   *
+   * User-defined labels are arbitrary key, value pairs that you can use to
+   * classify logs.
+   *
+   * System-defined labels are defined by GCP services for platform logs.
+   * They have two components - a service namespace component and the
+   * attribute name. For example: `compute.googleapis.com/resource_name`.
+   *
+   * Cloud Logging truncates label keys that exceed 512 B and label
+   * values that exceed 64 KB upon their associated log entry being
+   * written. The truncation is indicated by an ellipsis at the
+   * end of the character string.
+   * 
+ * + * map<string, string> labels = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int OPERATION_FIELD_NUMBER = 15; + private com.google.logging.v2.LogEntryOperation operation_; + + /** + * + * + *
+   * Optional. Information about an operation associated with the log entry, if
+   * applicable.
+   * 
+ * + * + * .google.logging.v2.LogEntryOperation operation = 15 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the operation field is set. + */ + @java.lang.Override + public boolean hasOperation() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+   * Optional. Information about an operation associated with the log entry, if
+   * applicable.
+   * 
+ * + * + * .google.logging.v2.LogEntryOperation operation = 15 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The operation. + */ + @java.lang.Override + public com.google.logging.v2.LogEntryOperation getOperation() { + return operation_ == null + ? com.google.logging.v2.LogEntryOperation.getDefaultInstance() + : operation_; + } + + /** + * + * + *
+   * Optional. Information about an operation associated with the log entry, if
+   * applicable.
+   * 
+ * + * + * .google.logging.v2.LogEntryOperation operation = 15 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.logging.v2.LogEntryOperationOrBuilder getOperationOrBuilder() { + return operation_ == null + ? com.google.logging.v2.LogEntryOperation.getDefaultInstance() + : operation_; + } + + public static final int TRACE_FIELD_NUMBER = 22; + + @SuppressWarnings("serial") + private volatile java.lang.Object trace_ = ""; + + /** + * + * + *
+   * Optional. The REST resource name of the trace being written to
+   * [Cloud Trace](https://cloud.google.com/trace) in
+   * association with this log entry. For example, if your trace data is stored
+   * in the Cloud project "my-trace-project" and if the service that is creating
+   * the log entry receives a trace header that includes the trace ID "12345",
+   * then the service should use "projects/my-tracing-project/traces/12345".
+   *
+   * The `trace` field provides the link between logs and traces. By using
+   * this field, you can navigate from a log entry to a trace.
+   * 
+ * + * string trace = 22 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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. The REST resource name of the trace being written to
+   * [Cloud Trace](https://cloud.google.com/trace) in
+   * association with this log entry. For example, if your trace data is stored
+   * in the Cloud project "my-trace-project" and if the service that is creating
+   * the log entry receives a trace header that includes the trace ID "12345",
+   * then the service should use "projects/my-tracing-project/traces/12345".
+   *
+   * The `trace` field provides the link between logs and traces. By using
+   * this field, you can navigate from a log entry to a trace.
+   * 
+ * + * string trace = 22 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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 SPAN_ID_FIELD_NUMBER = 27; + + @SuppressWarnings("serial") + private volatile java.lang.Object spanId_ = ""; + + /** + * + * + *
+   * Optional. The ID of the [Cloud Trace](https://cloud.google.com/trace) span
+   * associated with the current operation in which the log is being written.
+   * For example, if a span has the REST resource name of
+   * "projects/some-project/traces/some-trace/spans/some-span-id", then the
+   * `span_id` field is "some-span-id".
+   *
+   * A
+   * [Span](https://cloud.google.com/trace/docs/reference/v2/rest/v2/projects.traces/batchWrite#Span)
+   * represents a single operation within a trace. Whereas a trace may involve
+   * multiple different microservices running on multiple different machines,
+   * a span generally corresponds to a single logical operation being performed
+   * in a single instance of a microservice on one specific machine. Spans
+   * are the nodes within the tree that is a trace.
+   *
+   * Applications that are [instrumented for
+   * tracing](https://cloud.google.com/trace/docs/setup) will generally assign a
+   * new, unique span ID on each incoming request. It is also common to create
+   * and record additional spans corresponding to internal processing elements
+   * as well as issuing requests to dependencies.
+   *
+   * The span ID is expected to be a 16-character, hexadecimal encoding of an
+   * 8-byte array and should not be zero. It should be unique within the trace
+   * and should, ideally, be generated in a manner that is uniformly random.
+   *
+   * Example values:
+   *
+   *   - `000000000000004a`
+   *   - `7a2190356c3fc94b`
+   *   - `0000f00300090021`
+   *   - `d39223e101960076`
+   * 
+ * + * string span_id = 27 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The spanId. + */ + @java.lang.Override + public java.lang.String getSpanId() { + java.lang.Object ref = spanId_; + 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(); + spanId_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The ID of the [Cloud Trace](https://cloud.google.com/trace) span
+   * associated with the current operation in which the log is being written.
+   * For example, if a span has the REST resource name of
+   * "projects/some-project/traces/some-trace/spans/some-span-id", then the
+   * `span_id` field is "some-span-id".
+   *
+   * A
+   * [Span](https://cloud.google.com/trace/docs/reference/v2/rest/v2/projects.traces/batchWrite#Span)
+   * represents a single operation within a trace. Whereas a trace may involve
+   * multiple different microservices running on multiple different machines,
+   * a span generally corresponds to a single logical operation being performed
+   * in a single instance of a microservice on one specific machine. Spans
+   * are the nodes within the tree that is a trace.
+   *
+   * Applications that are [instrumented for
+   * tracing](https://cloud.google.com/trace/docs/setup) will generally assign a
+   * new, unique span ID on each incoming request. It is also common to create
+   * and record additional spans corresponding to internal processing elements
+   * as well as issuing requests to dependencies.
+   *
+   * The span ID is expected to be a 16-character, hexadecimal encoding of an
+   * 8-byte array and should not be zero. It should be unique within the trace
+   * and should, ideally, be generated in a manner that is uniformly random.
+   *
+   * Example values:
+   *
+   *   - `000000000000004a`
+   *   - `7a2190356c3fc94b`
+   *   - `0000f00300090021`
+   *   - `d39223e101960076`
+   * 
+ * + * string span_id = 27 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for spanId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSpanIdBytes() { + java.lang.Object ref = spanId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + spanId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TRACE_SAMPLED_FIELD_NUMBER = 30; + private boolean traceSampled_ = false; + + /** + * + * + *
+   * Optional. The sampling decision of the trace associated with the log entry.
+   *
+   * True means that the trace resource name in the `trace` field was sampled
+   * for storage in a trace backend. False means that the trace was not sampled
+   * for storage when this log entry was written, or the sampling decision was
+   * unknown at the time. A non-sampled `trace` value is still useful as a
+   * request correlation identifier. The default is False.
+   * 
+ * + * bool trace_sampled = 30 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The traceSampled. + */ + @java.lang.Override + public boolean getTraceSampled() { + return traceSampled_; + } + + public static final int SOURCE_LOCATION_FIELD_NUMBER = 23; + private com.google.logging.v2.LogEntrySourceLocation sourceLocation_; + + /** + * + * + *
+   * Optional. Source code location information associated with the log entry,
+   * if any.
+   * 
+ * + * + * .google.logging.v2.LogEntrySourceLocation source_location = 23 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the sourceLocation field is set. + */ + @java.lang.Override + public boolean hasSourceLocation() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+   * Optional. Source code location information associated with the log entry,
+   * if any.
+   * 
+ * + * + * .google.logging.v2.LogEntrySourceLocation source_location = 23 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The sourceLocation. + */ + @java.lang.Override + public com.google.logging.v2.LogEntrySourceLocation getSourceLocation() { + return sourceLocation_ == null + ? com.google.logging.v2.LogEntrySourceLocation.getDefaultInstance() + : sourceLocation_; + } + + /** + * + * + *
+   * Optional. Source code location information associated with the log entry,
+   * if any.
+   * 
+ * + * + * .google.logging.v2.LogEntrySourceLocation source_location = 23 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.logging.v2.LogEntrySourceLocationOrBuilder getSourceLocationOrBuilder() { + return sourceLocation_ == null + ? com.google.logging.v2.LogEntrySourceLocation.getDefaultInstance() + : sourceLocation_; + } + + public static final int SPLIT_FIELD_NUMBER = 35; + private com.google.logging.v2.LogSplit split_; + + /** + * + * + *
+   * Optional. Information indicating this LogEntry is part of a sequence of
+   * multiple log entries split from a single LogEntry.
+   * 
+ * + * .google.logging.v2.LogSplit split = 35 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the split field is set. + */ + @java.lang.Override + public boolean hasSplit() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
+   * Optional. Information indicating this LogEntry is part of a sequence of
+   * multiple log entries split from a single LogEntry.
+   * 
+ * + * .google.logging.v2.LogSplit split = 35 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The split. + */ + @java.lang.Override + public com.google.logging.v2.LogSplit getSplit() { + return split_ == null ? com.google.logging.v2.LogSplit.getDefaultInstance() : split_; + } + + /** + * + * + *
+   * Optional. Information indicating this LogEntry is part of a sequence of
+   * multiple log entries split from a single LogEntry.
+   * 
+ * + * .google.logging.v2.LogSplit split = 35 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public com.google.logging.v2.LogSplitOrBuilder getSplitOrBuilder() { + return split_ == null ? com.google.logging.v2.LogSplit.getDefaultInstance() : split_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(insertId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, insertId_); + } + if (payloadCase_ == 6) { + output.writeMessage(6, (com.google.protobuf.Struct) payload_); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(7, getHttpRequest()); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(8, getResource()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(9, getTimestamp()); + } + if (severity_ != com.google.logging.type.LogSeverity.DEFAULT.getNumber()) { + output.writeEnum(10, severity_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 11); + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(logName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 12, logName_); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeMessage(15, getOperation()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(trace_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 22, trace_); + } + if (((bitField0_ & 0x00000020) != 0)) { + output.writeMessage(23, getSourceLocation()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(24, getReceiveTimestamp()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(spanId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 27, spanId_); + } + if (traceSampled_ != false) { + output.writeBool(30, traceSampled_); + } + if (((bitField0_ & 0x00000040) != 0)) { + output.writeMessage(35, getSplit()); + } + getUnknownFields().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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(insertId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, insertId_); + } + if (payloadCase_ == 6) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 6, (com.google.protobuf.Struct) payload_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getHttpRequest()); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getResource()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getTimestamp()); + } + if (severity_ != com.google.logging.type.LogSeverity.DEFAULT.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(10, 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(11, labels__); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(logName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(12, logName_); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(15, getOperation()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(trace_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(22, trace_); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(23, getSourceLocation()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(24, getReceiveTimestamp()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(spanId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(27, spanId_); + } + if (traceSampled_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(30, traceSampled_); + } + if (((bitField0_ & 0x00000040) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(35, getSplit()); + } + size += getUnknownFields().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.logging.v2.LogEntry)) { + return super.equals(obj); + } + com.google.logging.v2.LogEntry other = (com.google.logging.v2.LogEntry) obj; + + if (!getLogName().equals(other.getLogName())) return false; + if (hasResource() != other.hasResource()) return false; + if (hasResource()) { + if (!getResource().equals(other.getResource())) return false; + } + if (hasTimestamp() != other.hasTimestamp()) return false; + if (hasTimestamp()) { + if (!getTimestamp().equals(other.getTimestamp())) return false; + } + if (hasReceiveTimestamp() != other.hasReceiveTimestamp()) return false; + if (hasReceiveTimestamp()) { + if (!getReceiveTimestamp().equals(other.getReceiveTimestamp())) return false; + } + if (severity_ != other.severity_) return false; + if (!getInsertId().equals(other.getInsertId())) return false; + if (hasHttpRequest() != other.hasHttpRequest()) return false; + if (hasHttpRequest()) { + if (!getHttpRequest().equals(other.getHttpRequest())) 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 (!getTrace().equals(other.getTrace())) return false; + if (!getSpanId().equals(other.getSpanId())) return false; + if (getTraceSampled() != other.getTraceSampled()) return false; + if (hasSourceLocation() != other.hasSourceLocation()) return false; + if (hasSourceLocation()) { + if (!getSourceLocation().equals(other.getSourceLocation())) return false; + } + if (hasSplit() != other.hasSplit()) return false; + if (hasSplit()) { + if (!getSplit().equals(other.getSplit())) 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 (!getJsonPayload().equals(other.getJsonPayload())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + LOG_NAME_FIELD_NUMBER; + hash = (53 * hash) + getLogName().hashCode(); + if (hasResource()) { + hash = (37 * hash) + RESOURCE_FIELD_NUMBER; + hash = (53 * hash) + getResource().hashCode(); + } + if (hasTimestamp()) { + hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + getTimestamp().hashCode(); + } + if (hasReceiveTimestamp()) { + hash = (37 * hash) + RECEIVE_TIMESTAMP_FIELD_NUMBER; + hash = (53 * hash) + getReceiveTimestamp().hashCode(); + } + hash = (37 * hash) + SEVERITY_FIELD_NUMBER; + hash = (53 * hash) + severity_; + hash = (37 * hash) + INSERT_ID_FIELD_NUMBER; + hash = (53 * hash) + getInsertId().hashCode(); + if (hasHttpRequest()) { + hash = (37 * hash) + HTTP_REQUEST_FIELD_NUMBER; + hash = (53 * hash) + getHttpRequest().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(); + } + hash = (37 * hash) + TRACE_FIELD_NUMBER; + hash = (53 * hash) + getTrace().hashCode(); + hash = (37 * hash) + SPAN_ID_FIELD_NUMBER; + hash = (53 * hash) + getSpanId().hashCode(); + hash = (37 * hash) + TRACE_SAMPLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getTraceSampled()); + if (hasSourceLocation()) { + hash = (37 * hash) + SOURCE_LOCATION_FIELD_NUMBER; + hash = (53 * hash) + getSourceLocation().hashCode(); + } + if (hasSplit()) { + hash = (37 * hash) + SPLIT_FIELD_NUMBER; + hash = (53 * hash) + getSplit().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) + JSON_PAYLOAD_FIELD_NUMBER; + hash = (53 * hash) + getJsonPayload().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.LogEntry parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.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.logging.v2.LogEntry parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.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.logging.v2.LogEntry parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.LogEntry parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.LogEntry parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.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.logging.v2.LogEntry parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.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.logging.v2.LogEntry parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.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.logging.v2.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 entry in a log.
+   * 
+ * + * Protobuf type {@code google.logging.v2.LogEntry} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.LogEntry) + com.google.logging.v2.LogEntryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LogEntryProto + .internal_static_google_logging_v2_LogEntry_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 11: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 11: + return internalGetMutableLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LogEntryProto + .internal_static_google_logging_v2_LogEntry_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.LogEntry.class, com.google.logging.v2.LogEntry.Builder.class); + } + + // Construct using com.google.logging.v2.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) { + getResourceFieldBuilder(); + getTimestampFieldBuilder(); + getReceiveTimestampFieldBuilder(); + getHttpRequestFieldBuilder(); + getOperationFieldBuilder(); + getSourceLocationFieldBuilder(); + getSplitFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + logName_ = ""; + resource_ = null; + if (resourceBuilder_ != null) { + resourceBuilder_.dispose(); + resourceBuilder_ = null; + } + if (protoPayloadBuilder_ != null) { + protoPayloadBuilder_.clear(); + } + if (jsonPayloadBuilder_ != null) { + jsonPayloadBuilder_.clear(); + } + timestamp_ = null; + if (timestampBuilder_ != null) { + timestampBuilder_.dispose(); + timestampBuilder_ = null; + } + receiveTimestamp_ = null; + if (receiveTimestampBuilder_ != null) { + receiveTimestampBuilder_.dispose(); + receiveTimestampBuilder_ = null; + } + severity_ = 0; + insertId_ = ""; + httpRequest_ = null; + if (httpRequestBuilder_ != null) { + httpRequestBuilder_.dispose(); + httpRequestBuilder_ = null; + } + internalGetMutableLabels().clear(); + operation_ = null; + if (operationBuilder_ != null) { + operationBuilder_.dispose(); + operationBuilder_ = null; + } + trace_ = ""; + spanId_ = ""; + traceSampled_ = false; + sourceLocation_ = null; + if (sourceLocationBuilder_ != null) { + sourceLocationBuilder_.dispose(); + sourceLocationBuilder_ = null; + } + split_ = null; + if (splitBuilder_ != null) { + splitBuilder_.dispose(); + splitBuilder_ = null; + } + payloadCase_ = 0; + payload_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LogEntryProto + .internal_static_google_logging_v2_LogEntry_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.LogEntry getDefaultInstanceForType() { + return com.google.logging.v2.LogEntry.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.LogEntry build() { + com.google.logging.v2.LogEntry result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.LogEntry buildPartial() { + com.google.logging.v2.LogEntry result = new com.google.logging.v2.LogEntry(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.logging.v2.LogEntry result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.logName_ = logName_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.resource_ = resourceBuilder_ == null ? resource_ : resourceBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.timestamp_ = timestampBuilder_ == null ? timestamp_ : timestampBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.receiveTimestamp_ = + receiveTimestampBuilder_ == null ? receiveTimestamp_ : receiveTimestampBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.severity_ = severity_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.insertId_ = insertId_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.httpRequest_ = + httpRequestBuilder_ == null ? httpRequest_ : httpRequestBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.operation_ = operationBuilder_ == null ? operation_ : operationBuilder_.build(); + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.trace_ = trace_; + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.spanId_ = spanId_; + } + if (((from_bitField0_ & 0x00004000) != 0)) { + result.traceSampled_ = traceSampled_; + } + if (((from_bitField0_ & 0x00008000) != 0)) { + result.sourceLocation_ = + sourceLocationBuilder_ == null ? sourceLocation_ : sourceLocationBuilder_.build(); + to_bitField0_ |= 0x00000020; + } + if (((from_bitField0_ & 0x00010000) != 0)) { + result.split_ = splitBuilder_ == null ? split_ : splitBuilder_.build(); + to_bitField0_ |= 0x00000040; + } + result.bitField0_ |= to_bitField0_; + } + + private void buildPartialOneofs(com.google.logging.v2.LogEntry result) { + result.payloadCase_ = payloadCase_; + result.payload_ = this.payload_; + if (payloadCase_ == 2 && protoPayloadBuilder_ != null) { + result.payload_ = protoPayloadBuilder_.build(); + } + if (payloadCase_ == 6 && jsonPayloadBuilder_ != null) { + result.payload_ = jsonPayloadBuilder_.build(); + } + } + + @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.logging.v2.LogEntry) { + return mergeFrom((com.google.logging.v2.LogEntry) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.LogEntry other) { + if (other == com.google.logging.v2.LogEntry.getDefaultInstance()) return this; + if (!other.getLogName().isEmpty()) { + logName_ = other.logName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasResource()) { + mergeResource(other.getResource()); + } + if (other.hasTimestamp()) { + mergeTimestamp(other.getTimestamp()); + } + if (other.hasReceiveTimestamp()) { + mergeReceiveTimestamp(other.getReceiveTimestamp()); + } + if (other.severity_ != 0) { + setSeverityValue(other.getSeverityValue()); + } + if (!other.getInsertId().isEmpty()) { + insertId_ = other.insertId_; + bitField0_ |= 0x00000100; + onChanged(); + } + if (other.hasHttpRequest()) { + mergeHttpRequest(other.getHttpRequest()); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + bitField0_ |= 0x00000400; + if (other.hasOperation()) { + mergeOperation(other.getOperation()); + } + if (!other.getTrace().isEmpty()) { + trace_ = other.trace_; + bitField0_ |= 0x00001000; + onChanged(); + } + if (!other.getSpanId().isEmpty()) { + spanId_ = other.spanId_; + bitField0_ |= 0x00002000; + onChanged(); + } + if (other.getTraceSampled() != false) { + setTraceSampled(other.getTraceSampled()); + } + if (other.hasSourceLocation()) { + mergeSourceLocation(other.getSourceLocation()); + } + if (other.hasSplit()) { + mergeSplit(other.getSplit()); + } + switch (other.getPayloadCase()) { + case PROTO_PAYLOAD: + { + mergeProtoPayload(other.getProtoPayload()); + break; + } + case TEXT_PAYLOAD: + { + payloadCase_ = 3; + payload_ = other.payload_; + onChanged(); + break; + } + case JSON_PAYLOAD: + { + mergeJsonPayload(other.getJsonPayload()); + break; + } + case PAYLOAD_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 18: + { + input.readMessage(getProtoPayloadFieldBuilder().getBuilder(), extensionRegistry); + payloadCase_ = 2; + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + payloadCase_ = 3; + payload_ = s; + break; + } // case 26 + case 34: + { + insertId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000100; + break; + } // case 34 + case 50: + { + input.readMessage(getJsonPayloadFieldBuilder().getBuilder(), extensionRegistry); + payloadCase_ = 6; + break; + } // case 50 + case 58: + { + input.readMessage(getHttpRequestFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000200; + break; + } // case 58 + case 66: + { + input.readMessage(getResourceFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 66 + case 74: + { + input.readMessage(getTimestampFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 74 + case 80: + { + severity_ = input.readEnum(); + bitField0_ |= 0x00000080; + break; + } // case 80 + case 90: + { + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableLabels() + .getMutableMap() + .put(labels__.getKey(), labels__.getValue()); + bitField0_ |= 0x00000400; + break; + } // case 90 + case 98: + { + logName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 98 + case 122: + { + input.readMessage(getOperationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000800; + break; + } // case 122 + case 178: + { + trace_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00001000; + break; + } // case 178 + case 186: + { + input.readMessage(getSourceLocationFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00008000; + break; + } // case 186 + case 194: + { + input.readMessage( + getReceiveTimestampFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 194 + case 218: + { + spanId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00002000; + break; + } // case 218 + case 240: + { + traceSampled_ = input.readBool(); + bitField0_ |= 0x00004000; + break; + } // case 240 + case 282: + { + input.readMessage(getSplitFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00010000; + break; + } // case 282 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + 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 logName_ = ""; + + /** + * + * + *
+     * Required. The resource name of the log to which this log entry belongs:
+     *
+     *     "projects/[PROJECT_ID]/logs/[LOG_ID]"
+     *     "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]"
+     *     "folders/[FOLDER_ID]/logs/[LOG_ID]"
+     *
+     * A project number may be used in place of PROJECT_ID. The project number is
+     * translated to its corresponding PROJECT_ID internally and the `log_name`
+     * field will contain PROJECT_ID in queries and exports.
+     *
+     * `[LOG_ID]` must be URL-encoded within `log_name`. Example:
+     * `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`.
+     *
+     * `[LOG_ID]` must be less than 512 characters long and can only include the
+     * following characters: upper and lower case alphanumeric characters,
+     * forward-slash, underscore, hyphen, and period.
+     *
+     * For backward compatibility, if `log_name` begins with a forward-slash, such
+     * as `/projects/...`, then the log entry is ingested as usual, but the
+     * forward-slash is removed. Listing the log entry will not show the leading
+     * slash and filtering for a log name with a leading slash will never return
+     * any results.
+     * 
+ * + * string log_name = 12 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The logName. + */ + public java.lang.String getLogName() { + java.lang.Object ref = logName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + logName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The resource name of the log to which this log entry belongs:
+     *
+     *     "projects/[PROJECT_ID]/logs/[LOG_ID]"
+     *     "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]"
+     *     "folders/[FOLDER_ID]/logs/[LOG_ID]"
+     *
+     * A project number may be used in place of PROJECT_ID. The project number is
+     * translated to its corresponding PROJECT_ID internally and the `log_name`
+     * field will contain PROJECT_ID in queries and exports.
+     *
+     * `[LOG_ID]` must be URL-encoded within `log_name`. Example:
+     * `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`.
+     *
+     * `[LOG_ID]` must be less than 512 characters long and can only include the
+     * following characters: upper and lower case alphanumeric characters,
+     * forward-slash, underscore, hyphen, and period.
+     *
+     * For backward compatibility, if `log_name` begins with a forward-slash, such
+     * as `/projects/...`, then the log entry is ingested as usual, but the
+     * forward-slash is removed. Listing the log entry will not show the leading
+     * slash and filtering for a log name with a leading slash will never return
+     * any results.
+     * 
+ * + * string log_name = 12 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for logName. + */ + public com.google.protobuf.ByteString getLogNameBytes() { + java.lang.Object ref = logName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + logName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The resource name of the log to which this log entry belongs:
+     *
+     *     "projects/[PROJECT_ID]/logs/[LOG_ID]"
+     *     "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]"
+     *     "folders/[FOLDER_ID]/logs/[LOG_ID]"
+     *
+     * A project number may be used in place of PROJECT_ID. The project number is
+     * translated to its corresponding PROJECT_ID internally and the `log_name`
+     * field will contain PROJECT_ID in queries and exports.
+     *
+     * `[LOG_ID]` must be URL-encoded within `log_name`. Example:
+     * `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`.
+     *
+     * `[LOG_ID]` must be less than 512 characters long and can only include the
+     * following characters: upper and lower case alphanumeric characters,
+     * forward-slash, underscore, hyphen, and period.
+     *
+     * For backward compatibility, if `log_name` begins with a forward-slash, such
+     * as `/projects/...`, then the log entry is ingested as usual, but the
+     * forward-slash is removed. Listing the log entry will not show the leading
+     * slash and filtering for a log name with a leading slash will never return
+     * any results.
+     * 
+ * + * string log_name = 12 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The logName to set. + * @return This builder for chaining. + */ + public Builder setLogName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + logName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The resource name of the log to which this log entry belongs:
+     *
+     *     "projects/[PROJECT_ID]/logs/[LOG_ID]"
+     *     "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]"
+     *     "folders/[FOLDER_ID]/logs/[LOG_ID]"
+     *
+     * A project number may be used in place of PROJECT_ID. The project number is
+     * translated to its corresponding PROJECT_ID internally and the `log_name`
+     * field will contain PROJECT_ID in queries and exports.
+     *
+     * `[LOG_ID]` must be URL-encoded within `log_name`. Example:
+     * `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`.
+     *
+     * `[LOG_ID]` must be less than 512 characters long and can only include the
+     * following characters: upper and lower case alphanumeric characters,
+     * forward-slash, underscore, hyphen, and period.
+     *
+     * For backward compatibility, if `log_name` begins with a forward-slash, such
+     * as `/projects/...`, then the log entry is ingested as usual, but the
+     * forward-slash is removed. Listing the log entry will not show the leading
+     * slash and filtering for a log name with a leading slash will never return
+     * any results.
+     * 
+ * + * string log_name = 12 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearLogName() { + logName_ = getDefaultInstance().getLogName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The resource name of the log to which this log entry belongs:
+     *
+     *     "projects/[PROJECT_ID]/logs/[LOG_ID]"
+     *     "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]"
+     *     "folders/[FOLDER_ID]/logs/[LOG_ID]"
+     *
+     * A project number may be used in place of PROJECT_ID. The project number is
+     * translated to its corresponding PROJECT_ID internally and the `log_name`
+     * field will contain PROJECT_ID in queries and exports.
+     *
+     * `[LOG_ID]` must be URL-encoded within `log_name`. Example:
+     * `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`.
+     *
+     * `[LOG_ID]` must be less than 512 characters long and can only include the
+     * following characters: upper and lower case alphanumeric characters,
+     * forward-slash, underscore, hyphen, and period.
+     *
+     * For backward compatibility, if `log_name` begins with a forward-slash, such
+     * as `/projects/...`, then the log entry is ingested as usual, but the
+     * forward-slash is removed. Listing the log entry will not show the leading
+     * slash and filtering for a log name with a leading slash will never return
+     * any results.
+     * 
+ * + * string log_name = 12 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for logName to set. + * @return This builder for chaining. + */ + public Builder setLogNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + logName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.api.MonitoredResource resource_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.MonitoredResource, + com.google.api.MonitoredResource.Builder, + com.google.api.MonitoredResourceOrBuilder> + resourceBuilder_; + + /** + * + * + *
+     * Required. The monitored resource that produced this log entry.
+     *
+     * Example: a log entry that reports a database error would be associated with
+     * the monitored resource designating the particular database that reported
+     * the error.
+     * 
+ * + * .google.api.MonitoredResource resource = 8 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the resource field is set. + */ + public boolean hasResource() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Required. The monitored resource that produced this log entry.
+     *
+     * Example: a log entry that reports a database error would be associated with
+     * the monitored resource designating the particular database that reported
+     * the error.
+     * 
+ * + * .google.api.MonitoredResource resource = 8 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The resource. + */ + public com.google.api.MonitoredResource getResource() { + if (resourceBuilder_ == null) { + return resource_ == null + ? com.google.api.MonitoredResource.getDefaultInstance() + : resource_; + } else { + return resourceBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. The monitored resource that produced this log entry.
+     *
+     * Example: a log entry that reports a database error would be associated with
+     * the monitored resource designating the particular database that reported
+     * the error.
+     * 
+ * + * .google.api.MonitoredResource resource = 8 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setResource(com.google.api.MonitoredResource value) { + if (resourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + resource_ = value; + } else { + resourceBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The monitored resource that produced this log entry.
+     *
+     * Example: a log entry that reports a database error would be associated with
+     * the monitored resource designating the particular database that reported
+     * the error.
+     * 
+ * + * .google.api.MonitoredResource resource = 8 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setResource(com.google.api.MonitoredResource.Builder builderForValue) { + if (resourceBuilder_ == null) { + resource_ = builderForValue.build(); + } else { + resourceBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The monitored resource that produced this log entry.
+     *
+     * Example: a log entry that reports a database error would be associated with
+     * the monitored resource designating the particular database that reported
+     * the error.
+     * 
+ * + * .google.api.MonitoredResource resource = 8 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeResource(com.google.api.MonitoredResource value) { + if (resourceBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && resource_ != null + && resource_ != com.google.api.MonitoredResource.getDefaultInstance()) { + getResourceBuilder().mergeFrom(value); + } else { + resource_ = value; + } + } else { + resourceBuilder_.mergeFrom(value); + } + if (resource_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. The monitored resource that produced this log entry.
+     *
+     * Example: a log entry that reports a database error would be associated with
+     * the monitored resource designating the particular database that reported
+     * the error.
+     * 
+ * + * .google.api.MonitoredResource resource = 8 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearResource() { + bitField0_ = (bitField0_ & ~0x00000002); + resource_ = null; + if (resourceBuilder_ != null) { + resourceBuilder_.dispose(); + resourceBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The monitored resource that produced this log entry.
+     *
+     * Example: a log entry that reports a database error would be associated with
+     * the monitored resource designating the particular database that reported
+     * the error.
+     * 
+ * + * .google.api.MonitoredResource resource = 8 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.api.MonitoredResource.Builder getResourceBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getResourceFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. The monitored resource that produced this log entry.
+     *
+     * Example: a log entry that reports a database error would be associated with
+     * the monitored resource designating the particular database that reported
+     * the error.
+     * 
+ * + * .google.api.MonitoredResource resource = 8 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.api.MonitoredResourceOrBuilder getResourceOrBuilder() { + if (resourceBuilder_ != null) { + return resourceBuilder_.getMessageOrBuilder(); + } else { + return resource_ == null + ? com.google.api.MonitoredResource.getDefaultInstance() + : resource_; + } + } + + /** + * + * + *
+     * Required. The monitored resource that produced this log entry.
+     *
+     * Example: a log entry that reports a database error would be associated with
+     * the monitored resource designating the particular database that reported
+     * the error.
+     * 
+ * + * .google.api.MonitoredResource resource = 8 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.MonitoredResource, + com.google.api.MonitoredResource.Builder, + com.google.api.MonitoredResourceOrBuilder> + getResourceFieldBuilder() { + if (resourceBuilder_ == null) { + resourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.api.MonitoredResource, + com.google.api.MonitoredResource.Builder, + com.google.api.MonitoredResourceOrBuilder>( + getResource(), getParentForChildren(), isClean()); + resource_ = null; + } + return resourceBuilder_; + } + + 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. Some Google
+     * Cloud Platform services use this field for their log entry payloads.
+     *
+     * The following protocol buffer types are supported; user-defined types
+     * are not supported:
+     *
+     *   "type.googleapis.com/google.cloud.audit.AuditLog"
+     *   "type.googleapis.com/google.appengine.logging.v1.RequestLog"
+     * 
+ * + * .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. Some Google
+     * Cloud Platform services use this field for their log entry payloads.
+     *
+     * The following protocol buffer types are supported; user-defined types
+     * are not supported:
+     *
+     *   "type.googleapis.com/google.cloud.audit.AuditLog"
+     *   "type.googleapis.com/google.appengine.logging.v1.RequestLog"
+     * 
+ * + * .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. Some Google
+     * Cloud Platform services use this field for their log entry payloads.
+     *
+     * The following protocol buffer types are supported; user-defined types
+     * are not supported:
+     *
+     *   "type.googleapis.com/google.cloud.audit.AuditLog"
+     *   "type.googleapis.com/google.appengine.logging.v1.RequestLog"
+     * 
+ * + * .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. Some Google
+     * Cloud Platform services use this field for their log entry payloads.
+     *
+     * The following protocol buffer types are supported; user-defined types
+     * are not supported:
+     *
+     *   "type.googleapis.com/google.cloud.audit.AuditLog"
+     *   "type.googleapis.com/google.appengine.logging.v1.RequestLog"
+     * 
+ * + * .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. Some Google
+     * Cloud Platform services use this field for their log entry payloads.
+     *
+     * The following protocol buffer types are supported; user-defined types
+     * are not supported:
+     *
+     *   "type.googleapis.com/google.cloud.audit.AuditLog"
+     *   "type.googleapis.com/google.appengine.logging.v1.RequestLog"
+     * 
+ * + * .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); + } else { + protoPayloadBuilder_.setMessage(value); + } + } + payloadCase_ = 2; + return this; + } + + /** + * + * + *
+     * The log entry payload, represented as a protocol buffer. Some Google
+     * Cloud Platform services use this field for their log entry payloads.
+     *
+     * The following protocol buffer types are supported; user-defined types
+     * are not supported:
+     *
+     *   "type.googleapis.com/google.cloud.audit.AuditLog"
+     *   "type.googleapis.com/google.appengine.logging.v1.RequestLog"
+     * 
+ * + * .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. Some Google
+     * Cloud Platform services use this field for their log entry payloads.
+     *
+     * The following protocol buffer types are supported; user-defined types
+     * are not supported:
+     *
+     *   "type.googleapis.com/google.cloud.audit.AuditLog"
+     *   "type.googleapis.com/google.appengine.logging.v1.RequestLog"
+     * 
+ * + * .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. Some Google
+     * Cloud Platform services use this field for their log entry payloads.
+     *
+     * The following protocol buffer types are supported; user-defined types
+     * are not supported:
+     *
+     *   "type.googleapis.com/google.cloud.audit.AuditLog"
+     *   "type.googleapis.com/google.appengine.logging.v1.RequestLog"
+     * 
+ * + * .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. Some Google
+     * Cloud Platform services use this field for their log entry payloads.
+     *
+     * The following protocol buffer types are supported; user-defined types
+     * are not supported:
+     *
+     *   "type.googleapis.com/google.cloud.audit.AuditLog"
+     *   "type.googleapis.com/google.appengine.logging.v1.RequestLog"
+     * 
+ * + * .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> + jsonPayloadBuilder_; + + /** + * + * + *
+     * The log entry payload, represented as a structure that is
+     * expressed as a JSON object.
+     * 
+ * + * .google.protobuf.Struct json_payload = 6; + * + * @return Whether the jsonPayload field is set. + */ + @java.lang.Override + public boolean hasJsonPayload() { + return payloadCase_ == 6; + } + + /** + * + * + *
+     * The log entry payload, represented as a structure that is
+     * expressed as a JSON object.
+     * 
+ * + * .google.protobuf.Struct json_payload = 6; + * + * @return The jsonPayload. + */ + @java.lang.Override + public com.google.protobuf.Struct getJsonPayload() { + if (jsonPayloadBuilder_ == null) { + if (payloadCase_ == 6) { + return (com.google.protobuf.Struct) payload_; + } + return com.google.protobuf.Struct.getDefaultInstance(); + } else { + if (payloadCase_ == 6) { + return jsonPayloadBuilder_.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 json_payload = 6; + */ + public Builder setJsonPayload(com.google.protobuf.Struct value) { + if (jsonPayloadBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + payload_ = value; + onChanged(); + } else { + jsonPayloadBuilder_.setMessage(value); + } + payloadCase_ = 6; + return this; + } + + /** + * + * + *
+     * The log entry payload, represented as a structure that is
+     * expressed as a JSON object.
+     * 
+ * + * .google.protobuf.Struct json_payload = 6; + */ + public Builder setJsonPayload(com.google.protobuf.Struct.Builder builderForValue) { + if (jsonPayloadBuilder_ == null) { + payload_ = builderForValue.build(); + onChanged(); + } else { + jsonPayloadBuilder_.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 json_payload = 6; + */ + public Builder mergeJsonPayload(com.google.protobuf.Struct value) { + if (jsonPayloadBuilder_ == 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) { + jsonPayloadBuilder_.mergeFrom(value); + } else { + jsonPayloadBuilder_.setMessage(value); + } + } + payloadCase_ = 6; + return this; + } + + /** + * + * + *
+     * The log entry payload, represented as a structure that is
+     * expressed as a JSON object.
+     * 
+ * + * .google.protobuf.Struct json_payload = 6; + */ + public Builder clearJsonPayload() { + if (jsonPayloadBuilder_ == null) { + if (payloadCase_ == 6) { + payloadCase_ = 0; + payload_ = null; + onChanged(); + } + } else { + if (payloadCase_ == 6) { + payloadCase_ = 0; + payload_ = null; + } + jsonPayloadBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * The log entry payload, represented as a structure that is
+     * expressed as a JSON object.
+     * 
+ * + * .google.protobuf.Struct json_payload = 6; + */ + public com.google.protobuf.Struct.Builder getJsonPayloadBuilder() { + return getJsonPayloadFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The log entry payload, represented as a structure that is
+     * expressed as a JSON object.
+     * 
+ * + * .google.protobuf.Struct json_payload = 6; + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getJsonPayloadOrBuilder() { + if ((payloadCase_ == 6) && (jsonPayloadBuilder_ != null)) { + return jsonPayloadBuilder_.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 json_payload = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + getJsonPayloadFieldBuilder() { + if (jsonPayloadBuilder_ == null) { + if (!(payloadCase_ == 6)) { + payload_ = com.google.protobuf.Struct.getDefaultInstance(); + } + jsonPayloadBuilder_ = + 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 jsonPayloadBuilder_; + } + + 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_; + + /** + * + * + *
+     * Optional. The time the event described by the log entry occurred. This time
+     * is used to compute the log entry's age and to enforce the logs retention
+     * period. If this field is omitted in a new log entry, then Logging assigns
+     * it the current time. Timestamps have nanosecond accuracy, but trailing
+     * zeros in the fractional seconds might be omitted when the timestamp is
+     * displayed.
+     *
+     * Incoming log entries must have timestamps that don't exceed the
+     * [logs retention
+     * period](https://cloud.google.com/logging/quotas#logs_retention_periods) in
+     * the past, and that don't exceed 24 hours in the future. Log entries outside
+     * those time boundaries aren't ingested by Logging.
+     * 
+ * + * .google.protobuf.Timestamp timestamp = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the timestamp field is set. + */ + public boolean hasTimestamp() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+     * Optional. The time the event described by the log entry occurred. This time
+     * is used to compute the log entry's age and to enforce the logs retention
+     * period. If this field is omitted in a new log entry, then Logging assigns
+     * it the current time. Timestamps have nanosecond accuracy, but trailing
+     * zeros in the fractional seconds might be omitted when the timestamp is
+     * displayed.
+     *
+     * Incoming log entries must have timestamps that don't exceed the
+     * [logs retention
+     * period](https://cloud.google.com/logging/quotas#logs_retention_periods) in
+     * the past, and that don't exceed 24 hours in the future. Log entries outside
+     * those time boundaries aren't ingested by Logging.
+     * 
+ * + * .google.protobuf.Timestamp timestamp = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @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(); + } + } + + /** + * + * + *
+     * Optional. The time the event described by the log entry occurred. This time
+     * is used to compute the log entry's age and to enforce the logs retention
+     * period. If this field is omitted in a new log entry, then Logging assigns
+     * it the current time. Timestamps have nanosecond accuracy, but trailing
+     * zeros in the fractional seconds might be omitted when the timestamp is
+     * displayed.
+     *
+     * Incoming log entries must have timestamps that don't exceed the
+     * [logs retention
+     * period](https://cloud.google.com/logging/quotas#logs_retention_periods) in
+     * the past, and that don't exceed 24 hours in the future. Log entries outside
+     * those time boundaries aren't ingested by Logging.
+     * 
+ * + * .google.protobuf.Timestamp timestamp = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setTimestamp(com.google.protobuf.Timestamp value) { + if (timestampBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + timestamp_ = value; + } else { + timestampBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The time the event described by the log entry occurred. This time
+     * is used to compute the log entry's age and to enforce the logs retention
+     * period. If this field is omitted in a new log entry, then Logging assigns
+     * it the current time. Timestamps have nanosecond accuracy, but trailing
+     * zeros in the fractional seconds might be omitted when the timestamp is
+     * displayed.
+     *
+     * Incoming log entries must have timestamps that don't exceed the
+     * [logs retention
+     * period](https://cloud.google.com/logging/quotas#logs_retention_periods) in
+     * the past, and that don't exceed 24 hours in the future. Log entries outside
+     * those time boundaries aren't ingested by Logging.
+     * 
+ * + * .google.protobuf.Timestamp timestamp = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setTimestamp(com.google.protobuf.Timestamp.Builder builderForValue) { + if (timestampBuilder_ == null) { + timestamp_ = builderForValue.build(); + } else { + timestampBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The time the event described by the log entry occurred. This time
+     * is used to compute the log entry's age and to enforce the logs retention
+     * period. If this field is omitted in a new log entry, then Logging assigns
+     * it the current time. Timestamps have nanosecond accuracy, but trailing
+     * zeros in the fractional seconds might be omitted when the timestamp is
+     * displayed.
+     *
+     * Incoming log entries must have timestamps that don't exceed the
+     * [logs retention
+     * period](https://cloud.google.com/logging/quotas#logs_retention_periods) in
+     * the past, and that don't exceed 24 hours in the future. Log entries outside
+     * those time boundaries aren't ingested by Logging.
+     * 
+ * + * .google.protobuf.Timestamp timestamp = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeTimestamp(com.google.protobuf.Timestamp value) { + if (timestampBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && timestamp_ != null + && timestamp_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getTimestampBuilder().mergeFrom(value); + } else { + timestamp_ = value; + } + } else { + timestampBuilder_.mergeFrom(value); + } + if (timestamp_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. The time the event described by the log entry occurred. This time
+     * is used to compute the log entry's age and to enforce the logs retention
+     * period. If this field is omitted in a new log entry, then Logging assigns
+     * it the current time. Timestamps have nanosecond accuracy, but trailing
+     * zeros in the fractional seconds might be omitted when the timestamp is
+     * displayed.
+     *
+     * Incoming log entries must have timestamps that don't exceed the
+     * [logs retention
+     * period](https://cloud.google.com/logging/quotas#logs_retention_periods) in
+     * the past, and that don't exceed 24 hours in the future. Log entries outside
+     * those time boundaries aren't ingested by Logging.
+     * 
+ * + * .google.protobuf.Timestamp timestamp = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearTimestamp() { + bitField0_ = (bitField0_ & ~0x00000020); + timestamp_ = null; + if (timestampBuilder_ != null) { + timestampBuilder_.dispose(); + timestampBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The time the event described by the log entry occurred. This time
+     * is used to compute the log entry's age and to enforce the logs retention
+     * period. If this field is omitted in a new log entry, then Logging assigns
+     * it the current time. Timestamps have nanosecond accuracy, but trailing
+     * zeros in the fractional seconds might be omitted when the timestamp is
+     * displayed.
+     *
+     * Incoming log entries must have timestamps that don't exceed the
+     * [logs retention
+     * period](https://cloud.google.com/logging/quotas#logs_retention_periods) in
+     * the past, and that don't exceed 24 hours in the future. Log entries outside
+     * those time boundaries aren't ingested by Logging.
+     * 
+ * + * .google.protobuf.Timestamp timestamp = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.Timestamp.Builder getTimestampBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getTimestampFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. The time the event described by the log entry occurred. This time
+     * is used to compute the log entry's age and to enforce the logs retention
+     * period. If this field is omitted in a new log entry, then Logging assigns
+     * it the current time. Timestamps have nanosecond accuracy, but trailing
+     * zeros in the fractional seconds might be omitted when the timestamp is
+     * displayed.
+     *
+     * Incoming log entries must have timestamps that don't exceed the
+     * [logs retention
+     * period](https://cloud.google.com/logging/quotas#logs_retention_periods) in
+     * the past, and that don't exceed 24 hours in the future. Log entries outside
+     * those time boundaries aren't ingested by Logging.
+     * 
+ * + * .google.protobuf.Timestamp timestamp = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.TimestampOrBuilder getTimestampOrBuilder() { + if (timestampBuilder_ != null) { + return timestampBuilder_.getMessageOrBuilder(); + } else { + return timestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : timestamp_; + } + } + + /** + * + * + *
+     * Optional. The time the event described by the log entry occurred. This time
+     * is used to compute the log entry's age and to enforce the logs retention
+     * period. If this field is omitted in a new log entry, then Logging assigns
+     * it the current time. Timestamps have nanosecond accuracy, but trailing
+     * zeros in the fractional seconds might be omitted when the timestamp is
+     * displayed.
+     *
+     * Incoming log entries must have timestamps that don't exceed the
+     * [logs retention
+     * period](https://cloud.google.com/logging/quotas#logs_retention_periods) in
+     * the past, and that don't exceed 24 hours in the future. Log entries outside
+     * those time boundaries aren't ingested by Logging.
+     * 
+ * + * .google.protobuf.Timestamp timestamp = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + 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 com.google.protobuf.Timestamp receiveTimestamp_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + receiveTimestampBuilder_; + + /** + * + * + *
+     * Output only. The time the log entry was received by Logging.
+     * 
+ * + * + * .google.protobuf.Timestamp receive_timestamp = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the receiveTimestamp field is set. + */ + public boolean hasReceiveTimestamp() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * + * + *
+     * Output only. The time the log entry was received by Logging.
+     * 
+ * + * + * .google.protobuf.Timestamp receive_timestamp = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The receiveTimestamp. + */ + public com.google.protobuf.Timestamp getReceiveTimestamp() { + if (receiveTimestampBuilder_ == null) { + return receiveTimestamp_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : receiveTimestamp_; + } else { + return receiveTimestampBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Output only. The time the log entry was received by Logging.
+     * 
+ * + * + * .google.protobuf.Timestamp receive_timestamp = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setReceiveTimestamp(com.google.protobuf.Timestamp value) { + if (receiveTimestampBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + receiveTimestamp_ = value; + } else { + receiveTimestampBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The time the log entry was received by Logging.
+     * 
+ * + * + * .google.protobuf.Timestamp receive_timestamp = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setReceiveTimestamp(com.google.protobuf.Timestamp.Builder builderForValue) { + if (receiveTimestampBuilder_ == null) { + receiveTimestamp_ = builderForValue.build(); + } else { + receiveTimestampBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The time the log entry was received by Logging.
+     * 
+ * + * + * .google.protobuf.Timestamp receive_timestamp = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeReceiveTimestamp(com.google.protobuf.Timestamp value) { + if (receiveTimestampBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) + && receiveTimestamp_ != null + && receiveTimestamp_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getReceiveTimestampBuilder().mergeFrom(value); + } else { + receiveTimestamp_ = value; + } + } else { + receiveTimestampBuilder_.mergeFrom(value); + } + if (receiveTimestamp_ != null) { + bitField0_ |= 0x00000040; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Output only. The time the log entry was received by Logging.
+     * 
+ * + * + * .google.protobuf.Timestamp receive_timestamp = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearReceiveTimestamp() { + bitField0_ = (bitField0_ & ~0x00000040); + receiveTimestamp_ = null; + if (receiveTimestampBuilder_ != null) { + receiveTimestampBuilder_.dispose(); + receiveTimestampBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The time the log entry was received by Logging.
+     * 
+ * + * + * .google.protobuf.Timestamp receive_timestamp = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getReceiveTimestampBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return getReceiveTimestampFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Output only. The time the log entry was received by Logging.
+     * 
+ * + * + * .google.protobuf.Timestamp receive_timestamp = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getReceiveTimestampOrBuilder() { + if (receiveTimestampBuilder_ != null) { + return receiveTimestampBuilder_.getMessageOrBuilder(); + } else { + return receiveTimestamp_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : receiveTimestamp_; + } + } + + /** + * + * + *
+     * Output only. The time the log entry was received by Logging.
+     * 
+ * + * + * .google.protobuf.Timestamp receive_timestamp = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getReceiveTimestampFieldBuilder() { + if (receiveTimestampBuilder_ == null) { + receiveTimestampBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getReceiveTimestamp(), getParentForChildren(), isClean()); + receiveTimestamp_ = null; + } + return receiveTimestampBuilder_; + } + + private int severity_ = 0; + + /** + * + * + *
+     * Optional. The severity of the log entry. The default value is
+     * `LogSeverity.DEFAULT`.
+     * 
+ * + * + * .google.logging.type.LogSeverity severity = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for severity. + */ + @java.lang.Override + public int getSeverityValue() { + return severity_; + } + + /** + * + * + *
+     * Optional. The severity of the log entry. The default value is
+     * `LogSeverity.DEFAULT`.
+     * 
+ * + * + * .google.logging.type.LogSeverity severity = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @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; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The severity of the log entry. The default value is
+     * `LogSeverity.DEFAULT`.
+     * 
+ * + * + * .google.logging.type.LogSeverity severity = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The severity. + */ + @java.lang.Override + public com.google.logging.type.LogSeverity getSeverity() { + com.google.logging.type.LogSeverity result = + com.google.logging.type.LogSeverity.forNumber(severity_); + return result == null ? com.google.logging.type.LogSeverity.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * Optional. The severity of the log entry. The default value is
+     * `LogSeverity.DEFAULT`.
+     * 
+ * + * + * .google.logging.type.LogSeverity severity = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @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(); + } + bitField0_ |= 0x00000080; + severity_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The severity of the log entry. The default value is
+     * `LogSeverity.DEFAULT`.
+     * 
+ * + * + * .google.logging.type.LogSeverity severity = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearSeverity() { + bitField0_ = (bitField0_ & ~0x00000080); + severity_ = 0; + onChanged(); + return this; + } + + private java.lang.Object insertId_ = ""; + + /** + * + * + *
+     * Optional. A unique identifier for the log entry. If you provide a value,
+     * then Logging considers other log entries in the same project, with the same
+     * `timestamp`, and with the same `insert_id` to be duplicates which are
+     * removed in a single query result. However, there are no guarantees of
+     * de-duplication in the export of logs.
+     *
+     * If the `insert_id` is omitted when writing a log entry, the Logging API
+     * assigns its own unique identifier in this field.
+     *
+     * In queries, the `insert_id` is also used to order log entries that have
+     * the same `log_name` and `timestamp` values.
+     * 
+ * + * string insert_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + + /** + * + * + *
+     * Optional. A unique identifier for the log entry. If you provide a value,
+     * then Logging considers other log entries in the same project, with the same
+     * `timestamp`, and with the same `insert_id` to be duplicates which are
+     * removed in a single query result. However, there are no guarantees of
+     * de-duplication in the export of logs.
+     *
+     * If the `insert_id` is omitted when writing a log entry, the Logging API
+     * assigns its own unique identifier in this field.
+     *
+     * In queries, the `insert_id` is also used to order log entries that have
+     * the same `log_name` and `timestamp` values.
+     * 
+ * + * string insert_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + + /** + * + * + *
+     * Optional. A unique identifier for the log entry. If you provide a value,
+     * then Logging considers other log entries in the same project, with the same
+     * `timestamp`, and with the same `insert_id` to be duplicates which are
+     * removed in a single query result. However, there are no guarantees of
+     * de-duplication in the export of logs.
+     *
+     * If the `insert_id` is omitted when writing a log entry, the Logging API
+     * assigns its own unique identifier in this field.
+     *
+     * In queries, the `insert_id` is also used to order log entries that have
+     * the same `log_name` and `timestamp` values.
+     * 
+ * + * string insert_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. A unique identifier for the log entry. If you provide a value,
+     * then Logging considers other log entries in the same project, with the same
+     * `timestamp`, and with the same `insert_id` to be duplicates which are
+     * removed in a single query result. However, there are no guarantees of
+     * de-duplication in the export of logs.
+     *
+     * If the `insert_id` is omitted when writing a log entry, the Logging API
+     * assigns its own unique identifier in this field.
+     *
+     * In queries, the `insert_id` is also used to order log entries that have
+     * the same `log_name` and `timestamp` values.
+     * 
+ * + * string insert_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearInsertId() { + insertId_ = getDefaultInstance().getInsertId(); + bitField0_ = (bitField0_ & ~0x00000100); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. A unique identifier for the log entry. If you provide a value,
+     * then Logging considers other log entries in the same project, with the same
+     * `timestamp`, and with the same `insert_id` to be duplicates which are
+     * removed in a single query result. However, there are no guarantees of
+     * de-duplication in the export of logs.
+     *
+     * If the `insert_id` is omitted when writing a log entry, the Logging API
+     * assigns its own unique identifier in this field.
+     *
+     * In queries, the `insert_id` is also used to order log entries that have
+     * the same `log_name` and `timestamp` values.
+     * 
+ * + * string insert_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + private com.google.logging.type.HttpRequest httpRequest_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.type.HttpRequest, + com.google.logging.type.HttpRequest.Builder, + com.google.logging.type.HttpRequestOrBuilder> + httpRequestBuilder_; + + /** + * + * + *
+     * Optional. Information about the HTTP request associated with this log
+     * entry, if applicable.
+     * 
+ * + * + * .google.logging.type.HttpRequest http_request = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the httpRequest field is set. + */ + public boolean hasHttpRequest() { + return ((bitField0_ & 0x00000200) != 0); + } + + /** + * + * + *
+     * Optional. Information about the HTTP request associated with this log
+     * entry, if applicable.
+     * 
+ * + * + * .google.logging.type.HttpRequest http_request = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The httpRequest. + */ + public com.google.logging.type.HttpRequest getHttpRequest() { + if (httpRequestBuilder_ == null) { + return httpRequest_ == null + ? com.google.logging.type.HttpRequest.getDefaultInstance() + : httpRequest_; + } else { + return httpRequestBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. Information about the HTTP request associated with this log
+     * entry, if applicable.
+     * 
+ * + * + * .google.logging.type.HttpRequest http_request = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setHttpRequest(com.google.logging.type.HttpRequest value) { + if (httpRequestBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + httpRequest_ = value; + } else { + httpRequestBuilder_.setMessage(value); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Information about the HTTP request associated with this log
+     * entry, if applicable.
+     * 
+ * + * + * .google.logging.type.HttpRequest http_request = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setHttpRequest(com.google.logging.type.HttpRequest.Builder builderForValue) { + if (httpRequestBuilder_ == null) { + httpRequest_ = builderForValue.build(); + } else { + httpRequestBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Information about the HTTP request associated with this log
+     * entry, if applicable.
+     * 
+ * + * + * .google.logging.type.HttpRequest http_request = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeHttpRequest(com.google.logging.type.HttpRequest value) { + if (httpRequestBuilder_ == null) { + if (((bitField0_ & 0x00000200) != 0) + && httpRequest_ != null + && httpRequest_ != com.google.logging.type.HttpRequest.getDefaultInstance()) { + getHttpRequestBuilder().mergeFrom(value); + } else { + httpRequest_ = value; + } + } else { + httpRequestBuilder_.mergeFrom(value); + } + if (httpRequest_ != null) { + bitField0_ |= 0x00000200; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. Information about the HTTP request associated with this log
+     * entry, if applicable.
+     * 
+ * + * + * .google.logging.type.HttpRequest http_request = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearHttpRequest() { + bitField0_ = (bitField0_ & ~0x00000200); + httpRequest_ = null; + if (httpRequestBuilder_ != null) { + httpRequestBuilder_.dispose(); + httpRequestBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Information about the HTTP request associated with this log
+     * entry, if applicable.
+     * 
+ * + * + * .google.logging.type.HttpRequest http_request = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.logging.type.HttpRequest.Builder getHttpRequestBuilder() { + bitField0_ |= 0x00000200; + onChanged(); + return getHttpRequestFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. Information about the HTTP request associated with this log
+     * entry, if applicable.
+     * 
+ * + * + * .google.logging.type.HttpRequest http_request = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.logging.type.HttpRequestOrBuilder getHttpRequestOrBuilder() { + if (httpRequestBuilder_ != null) { + return httpRequestBuilder_.getMessageOrBuilder(); + } else { + return httpRequest_ == null + ? com.google.logging.type.HttpRequest.getDefaultInstance() + : httpRequest_; + } + } + + /** + * + * + *
+     * Optional. Information about the HTTP request associated with this log
+     * entry, if applicable.
+     * 
+ * + * + * .google.logging.type.HttpRequest http_request = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.type.HttpRequest, + com.google.logging.type.HttpRequest.Builder, + com.google.logging.type.HttpRequestOrBuilder> + getHttpRequestFieldBuilder() { + if (httpRequestBuilder_ == null) { + httpRequestBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.type.HttpRequest, + com.google.logging.type.HttpRequest.Builder, + com.google.logging.type.HttpRequestOrBuilder>( + getHttpRequest(), getParentForChildren(), isClean()); + httpRequest_ = null; + } + return httpRequestBuilder_; + } + + 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() { + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + bitField0_ |= 0x00000400; + onChanged(); + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + + /** + * + * + *
+     * Optional. A map of key, value pairs that provides additional information
+     * about the log entry. The labels can be user-defined or system-defined.
+     *
+     * User-defined labels are arbitrary key, value pairs that you can use to
+     * classify logs.
+     *
+     * System-defined labels are defined by GCP services for platform logs.
+     * They have two components - a service namespace component and the
+     * attribute name. For example: `compute.googleapis.com/resource_name`.
+     *
+     * Cloud Logging truncates label keys that exceed 512 B and label
+     * values that exceed 64 KB upon their associated log entry being
+     * written. The truncation is indicated by an ellipsis at the
+     * end of the character string.
+     * 
+ * + * map<string, string> labels = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + + /** + * + * + *
+     * Optional. A map of key, value pairs that provides additional information
+     * about the log entry. The labels can be user-defined or system-defined.
+     *
+     * User-defined labels are arbitrary key, value pairs that you can use to
+     * classify logs.
+     *
+     * System-defined labels are defined by GCP services for platform logs.
+     * They have two components - a service namespace component and the
+     * attribute name. For example: `compute.googleapis.com/resource_name`.
+     *
+     * Cloud Logging truncates label keys that exceed 512 B and label
+     * values that exceed 64 KB upon their associated log entry being
+     * written. The truncation is indicated by an ellipsis at the
+     * end of the character string.
+     * 
+ * + * map<string, string> labels = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + + /** + * + * + *
+     * Optional. A map of key, value pairs that provides additional information
+     * about the log entry. The labels can be user-defined or system-defined.
+     *
+     * User-defined labels are arbitrary key, value pairs that you can use to
+     * classify logs.
+     *
+     * System-defined labels are defined by GCP services for platform logs.
+     * They have two components - a service namespace component and the
+     * attribute name. For example: `compute.googleapis.com/resource_name`.
+     *
+     * Cloud Logging truncates label keys that exceed 512 B and label
+     * values that exceed 64 KB upon their associated log entry being
+     * written. The truncation is indicated by an ellipsis at the
+     * end of the character string.
+     * 
+ * + * map<string, string> labels = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * + * + *
+     * Optional. A map of key, value pairs that provides additional information
+     * about the log entry. The labels can be user-defined or system-defined.
+     *
+     * User-defined labels are arbitrary key, value pairs that you can use to
+     * classify logs.
+     *
+     * System-defined labels are defined by GCP services for platform logs.
+     * They have two components - a service namespace component and the
+     * attribute name. For example: `compute.googleapis.com/resource_name`.
+     *
+     * Cloud Logging truncates label keys that exceed 512 B and label
+     * values that exceed 64 KB upon their associated log entry being
+     * written. The truncation is indicated by an ellipsis at the
+     * end of the character string.
+     * 
+ * + * map<string, string> labels = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + bitField0_ = (bitField0_ & ~0x00000400); + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + + /** + * + * + *
+     * Optional. A map of key, value pairs that provides additional information
+     * about the log entry. The labels can be user-defined or system-defined.
+     *
+     * User-defined labels are arbitrary key, value pairs that you can use to
+     * classify logs.
+     *
+     * System-defined labels are defined by GCP services for platform logs.
+     * They have two components - a service namespace component and the
+     * attribute name. For example: `compute.googleapis.com/resource_name`.
+     *
+     * Cloud Logging truncates label keys that exceed 512 B and label
+     * values that exceed 64 KB upon their associated log entry being
+     * written. The truncation is indicated by an ellipsis at the
+     * end of the character string.
+     * 
+ * + * map<string, string> labels = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + bitField0_ |= 0x00000400; + return internalGetMutableLabels().getMutableMap(); + } + + /** + * + * + *
+     * Optional. A map of key, value pairs that provides additional information
+     * about the log entry. The labels can be user-defined or system-defined.
+     *
+     * User-defined labels are arbitrary key, value pairs that you can use to
+     * classify logs.
+     *
+     * System-defined labels are defined by GCP services for platform logs.
+     * They have two components - a service namespace component and the
+     * attribute name. For example: `compute.googleapis.com/resource_name`.
+     *
+     * Cloud Logging truncates label keys that exceed 512 B and label
+     * values that exceed 64 KB upon their associated log entry being
+     * written. The truncation is indicated by an ellipsis at the
+     * end of the character string.
+     * 
+ * + * map<string, string> labels = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableLabels().getMutableMap().put(key, value); + bitField0_ |= 0x00000400; + return this; + } + + /** + * + * + *
+     * Optional. A map of key, value pairs that provides additional information
+     * about the log entry. The labels can be user-defined or system-defined.
+     *
+     * User-defined labels are arbitrary key, value pairs that you can use to
+     * classify logs.
+     *
+     * System-defined labels are defined by GCP services for platform logs.
+     * They have two components - a service namespace component and the
+     * attribute name. For example: `compute.googleapis.com/resource_name`.
+     *
+     * Cloud Logging truncates label keys that exceed 512 B and label
+     * values that exceed 64 KB upon their associated log entry being
+     * written. The truncation is indicated by an ellipsis at the
+     * end of the character string.
+     * 
+ * + * map<string, string> labels = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + bitField0_ |= 0x00000400; + return this; + } + + private com.google.logging.v2.LogEntryOperation operation_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogEntryOperation, + com.google.logging.v2.LogEntryOperation.Builder, + com.google.logging.v2.LogEntryOperationOrBuilder> + operationBuilder_; + + /** + * + * + *
+     * Optional. Information about an operation associated with the log entry, if
+     * applicable.
+     * 
+ * + * + * .google.logging.v2.LogEntryOperation operation = 15 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the operation field is set. + */ + public boolean hasOperation() { + return ((bitField0_ & 0x00000800) != 0); + } + + /** + * + * + *
+     * Optional. Information about an operation associated with the log entry, if
+     * applicable.
+     * 
+ * + * + * .google.logging.v2.LogEntryOperation operation = 15 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The operation. + */ + public com.google.logging.v2.LogEntryOperation getOperation() { + if (operationBuilder_ == null) { + return operation_ == null + ? com.google.logging.v2.LogEntryOperation.getDefaultInstance() + : operation_; + } else { + return operationBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. Information about an operation associated with the log entry, if
+     * applicable.
+     * 
+ * + * + * .google.logging.v2.LogEntryOperation operation = 15 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setOperation(com.google.logging.v2.LogEntryOperation value) { + if (operationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + operation_ = value; + } else { + operationBuilder_.setMessage(value); + } + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Information about an operation associated with the log entry, if
+     * applicable.
+     * 
+ * + * + * .google.logging.v2.LogEntryOperation operation = 15 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setOperation(com.google.logging.v2.LogEntryOperation.Builder builderForValue) { + if (operationBuilder_ == null) { + operation_ = builderForValue.build(); + } else { + operationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Information about an operation associated with the log entry, if
+     * applicable.
+     * 
+ * + * + * .google.logging.v2.LogEntryOperation operation = 15 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeOperation(com.google.logging.v2.LogEntryOperation value) { + if (operationBuilder_ == null) { + if (((bitField0_ & 0x00000800) != 0) + && operation_ != null + && operation_ != com.google.logging.v2.LogEntryOperation.getDefaultInstance()) { + getOperationBuilder().mergeFrom(value); + } else { + operation_ = value; + } + } else { + operationBuilder_.mergeFrom(value); + } + if (operation_ != null) { + bitField0_ |= 0x00000800; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. Information about an operation associated with the log entry, if
+     * applicable.
+     * 
+ * + * + * .google.logging.v2.LogEntryOperation operation = 15 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearOperation() { + bitField0_ = (bitField0_ & ~0x00000800); + operation_ = null; + if (operationBuilder_ != null) { + operationBuilder_.dispose(); + operationBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Information about an operation associated with the log entry, if
+     * applicable.
+     * 
+ * + * + * .google.logging.v2.LogEntryOperation operation = 15 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.logging.v2.LogEntryOperation.Builder getOperationBuilder() { + bitField0_ |= 0x00000800; + onChanged(); + return getOperationFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. Information about an operation associated with the log entry, if
+     * applicable.
+     * 
+ * + * + * .google.logging.v2.LogEntryOperation operation = 15 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.logging.v2.LogEntryOperationOrBuilder getOperationOrBuilder() { + if (operationBuilder_ != null) { + return operationBuilder_.getMessageOrBuilder(); + } else { + return operation_ == null + ? com.google.logging.v2.LogEntryOperation.getDefaultInstance() + : operation_; + } + } + + /** + * + * + *
+     * Optional. Information about an operation associated with the log entry, if
+     * applicable.
+     * 
+ * + * + * .google.logging.v2.LogEntryOperation operation = 15 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogEntryOperation, + com.google.logging.v2.LogEntryOperation.Builder, + com.google.logging.v2.LogEntryOperationOrBuilder> + getOperationFieldBuilder() { + if (operationBuilder_ == null) { + operationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogEntryOperation, + com.google.logging.v2.LogEntryOperation.Builder, + com.google.logging.v2.LogEntryOperationOrBuilder>( + getOperation(), getParentForChildren(), isClean()); + operation_ = null; + } + return operationBuilder_; + } + + private java.lang.Object trace_ = ""; + + /** + * + * + *
+     * Optional. The REST resource name of the trace being written to
+     * [Cloud Trace](https://cloud.google.com/trace) in
+     * association with this log entry. For example, if your trace data is stored
+     * in the Cloud project "my-trace-project" and if the service that is creating
+     * the log entry receives a trace header that includes the trace ID "12345",
+     * then the service should use "projects/my-tracing-project/traces/12345".
+     *
+     * The `trace` field provides the link between logs and traces. By using
+     * this field, you can navigate from a log entry to a trace.
+     * 
+ * + * string trace = 22 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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. The REST resource name of the trace being written to
+     * [Cloud Trace](https://cloud.google.com/trace) in
+     * association with this log entry. For example, if your trace data is stored
+     * in the Cloud project "my-trace-project" and if the service that is creating
+     * the log entry receives a trace header that includes the trace ID "12345",
+     * then the service should use "projects/my-tracing-project/traces/12345".
+     *
+     * The `trace` field provides the link between logs and traces. By using
+     * this field, you can navigate from a log entry to a trace.
+     * 
+ * + * string trace = 22 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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. The REST resource name of the trace being written to
+     * [Cloud Trace](https://cloud.google.com/trace) in
+     * association with this log entry. For example, if your trace data is stored
+     * in the Cloud project "my-trace-project" and if the service that is creating
+     * the log entry receives a trace header that includes the trace ID "12345",
+     * then the service should use "projects/my-tracing-project/traces/12345".
+     *
+     * The `trace` field provides the link between logs and traces. By using
+     * this field, you can navigate from a log entry to a trace.
+     * 
+ * + * string trace = 22 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The REST resource name of the trace being written to
+     * [Cloud Trace](https://cloud.google.com/trace) in
+     * association with this log entry. For example, if your trace data is stored
+     * in the Cloud project "my-trace-project" and if the service that is creating
+     * the log entry receives a trace header that includes the trace ID "12345",
+     * then the service should use "projects/my-tracing-project/traces/12345".
+     *
+     * The `trace` field provides the link between logs and traces. By using
+     * this field, you can navigate from a log entry to a trace.
+     * 
+ * + * string trace = 22 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearTrace() { + trace_ = getDefaultInstance().getTrace(); + bitField0_ = (bitField0_ & ~0x00001000); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The REST resource name of the trace being written to
+     * [Cloud Trace](https://cloud.google.com/trace) in
+     * association with this log entry. For example, if your trace data is stored
+     * in the Cloud project "my-trace-project" and if the service that is creating
+     * the log entry receives a trace header that includes the trace ID "12345",
+     * then the service should use "projects/my-tracing-project/traces/12345".
+     *
+     * The `trace` field provides the link between logs and traces. By using
+     * this field, you can navigate from a log entry to a trace.
+     * 
+ * + * string trace = 22 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + + private java.lang.Object spanId_ = ""; + + /** + * + * + *
+     * Optional. The ID of the [Cloud Trace](https://cloud.google.com/trace) span
+     * associated with the current operation in which the log is being written.
+     * For example, if a span has the REST resource name of
+     * "projects/some-project/traces/some-trace/spans/some-span-id", then the
+     * `span_id` field is "some-span-id".
+     *
+     * A
+     * [Span](https://cloud.google.com/trace/docs/reference/v2/rest/v2/projects.traces/batchWrite#Span)
+     * represents a single operation within a trace. Whereas a trace may involve
+     * multiple different microservices running on multiple different machines,
+     * a span generally corresponds to a single logical operation being performed
+     * in a single instance of a microservice on one specific machine. Spans
+     * are the nodes within the tree that is a trace.
+     *
+     * Applications that are [instrumented for
+     * tracing](https://cloud.google.com/trace/docs/setup) will generally assign a
+     * new, unique span ID on each incoming request. It is also common to create
+     * and record additional spans corresponding to internal processing elements
+     * as well as issuing requests to dependencies.
+     *
+     * The span ID is expected to be a 16-character, hexadecimal encoding of an
+     * 8-byte array and should not be zero. It should be unique within the trace
+     * and should, ideally, be generated in a manner that is uniformly random.
+     *
+     * Example values:
+     *
+     *   - `000000000000004a`
+     *   - `7a2190356c3fc94b`
+     *   - `0000f00300090021`
+     *   - `d39223e101960076`
+     * 
+ * + * string span_id = 27 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The spanId. + */ + public java.lang.String getSpanId() { + java.lang.Object ref = spanId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + spanId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The ID of the [Cloud Trace](https://cloud.google.com/trace) span
+     * associated with the current operation in which the log is being written.
+     * For example, if a span has the REST resource name of
+     * "projects/some-project/traces/some-trace/spans/some-span-id", then the
+     * `span_id` field is "some-span-id".
+     *
+     * A
+     * [Span](https://cloud.google.com/trace/docs/reference/v2/rest/v2/projects.traces/batchWrite#Span)
+     * represents a single operation within a trace. Whereas a trace may involve
+     * multiple different microservices running on multiple different machines,
+     * a span generally corresponds to a single logical operation being performed
+     * in a single instance of a microservice on one specific machine. Spans
+     * are the nodes within the tree that is a trace.
+     *
+     * Applications that are [instrumented for
+     * tracing](https://cloud.google.com/trace/docs/setup) will generally assign a
+     * new, unique span ID on each incoming request. It is also common to create
+     * and record additional spans corresponding to internal processing elements
+     * as well as issuing requests to dependencies.
+     *
+     * The span ID is expected to be a 16-character, hexadecimal encoding of an
+     * 8-byte array and should not be zero. It should be unique within the trace
+     * and should, ideally, be generated in a manner that is uniformly random.
+     *
+     * Example values:
+     *
+     *   - `000000000000004a`
+     *   - `7a2190356c3fc94b`
+     *   - `0000f00300090021`
+     *   - `d39223e101960076`
+     * 
+ * + * string span_id = 27 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for spanId. + */ + public com.google.protobuf.ByteString getSpanIdBytes() { + java.lang.Object ref = spanId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + spanId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The ID of the [Cloud Trace](https://cloud.google.com/trace) span
+     * associated with the current operation in which the log is being written.
+     * For example, if a span has the REST resource name of
+     * "projects/some-project/traces/some-trace/spans/some-span-id", then the
+     * `span_id` field is "some-span-id".
+     *
+     * A
+     * [Span](https://cloud.google.com/trace/docs/reference/v2/rest/v2/projects.traces/batchWrite#Span)
+     * represents a single operation within a trace. Whereas a trace may involve
+     * multiple different microservices running on multiple different machines,
+     * a span generally corresponds to a single logical operation being performed
+     * in a single instance of a microservice on one specific machine. Spans
+     * are the nodes within the tree that is a trace.
+     *
+     * Applications that are [instrumented for
+     * tracing](https://cloud.google.com/trace/docs/setup) will generally assign a
+     * new, unique span ID on each incoming request. It is also common to create
+     * and record additional spans corresponding to internal processing elements
+     * as well as issuing requests to dependencies.
+     *
+     * The span ID is expected to be a 16-character, hexadecimal encoding of an
+     * 8-byte array and should not be zero. It should be unique within the trace
+     * and should, ideally, be generated in a manner that is uniformly random.
+     *
+     * Example values:
+     *
+     *   - `000000000000004a`
+     *   - `7a2190356c3fc94b`
+     *   - `0000f00300090021`
+     *   - `d39223e101960076`
+     * 
+ * + * string span_id = 27 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The spanId to set. + * @return This builder for chaining. + */ + public Builder setSpanId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + spanId_ = value; + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The ID of the [Cloud Trace](https://cloud.google.com/trace) span
+     * associated with the current operation in which the log is being written.
+     * For example, if a span has the REST resource name of
+     * "projects/some-project/traces/some-trace/spans/some-span-id", then the
+     * `span_id` field is "some-span-id".
+     *
+     * A
+     * [Span](https://cloud.google.com/trace/docs/reference/v2/rest/v2/projects.traces/batchWrite#Span)
+     * represents a single operation within a trace. Whereas a trace may involve
+     * multiple different microservices running on multiple different machines,
+     * a span generally corresponds to a single logical operation being performed
+     * in a single instance of a microservice on one specific machine. Spans
+     * are the nodes within the tree that is a trace.
+     *
+     * Applications that are [instrumented for
+     * tracing](https://cloud.google.com/trace/docs/setup) will generally assign a
+     * new, unique span ID on each incoming request. It is also common to create
+     * and record additional spans corresponding to internal processing elements
+     * as well as issuing requests to dependencies.
+     *
+     * The span ID is expected to be a 16-character, hexadecimal encoding of an
+     * 8-byte array and should not be zero. It should be unique within the trace
+     * and should, ideally, be generated in a manner that is uniformly random.
+     *
+     * Example values:
+     *
+     *   - `000000000000004a`
+     *   - `7a2190356c3fc94b`
+     *   - `0000f00300090021`
+     *   - `d39223e101960076`
+     * 
+ * + * string span_id = 27 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearSpanId() { + spanId_ = getDefaultInstance().getSpanId(); + bitField0_ = (bitField0_ & ~0x00002000); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The ID of the [Cloud Trace](https://cloud.google.com/trace) span
+     * associated with the current operation in which the log is being written.
+     * For example, if a span has the REST resource name of
+     * "projects/some-project/traces/some-trace/spans/some-span-id", then the
+     * `span_id` field is "some-span-id".
+     *
+     * A
+     * [Span](https://cloud.google.com/trace/docs/reference/v2/rest/v2/projects.traces/batchWrite#Span)
+     * represents a single operation within a trace. Whereas a trace may involve
+     * multiple different microservices running on multiple different machines,
+     * a span generally corresponds to a single logical operation being performed
+     * in a single instance of a microservice on one specific machine. Spans
+     * are the nodes within the tree that is a trace.
+     *
+     * Applications that are [instrumented for
+     * tracing](https://cloud.google.com/trace/docs/setup) will generally assign a
+     * new, unique span ID on each incoming request. It is also common to create
+     * and record additional spans corresponding to internal processing elements
+     * as well as issuing requests to dependencies.
+     *
+     * The span ID is expected to be a 16-character, hexadecimal encoding of an
+     * 8-byte array and should not be zero. It should be unique within the trace
+     * and should, ideally, be generated in a manner that is uniformly random.
+     *
+     * Example values:
+     *
+     *   - `000000000000004a`
+     *   - `7a2190356c3fc94b`
+     *   - `0000f00300090021`
+     *   - `d39223e101960076`
+     * 
+ * + * string span_id = 27 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for spanId to set. + * @return This builder for chaining. + */ + public Builder setSpanIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + spanId_ = value; + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + + private boolean traceSampled_; + + /** + * + * + *
+     * Optional. The sampling decision of the trace associated with the log entry.
+     *
+     * True means that the trace resource name in the `trace` field was sampled
+     * for storage in a trace backend. False means that the trace was not sampled
+     * for storage when this log entry was written, or the sampling decision was
+     * unknown at the time. A non-sampled `trace` value is still useful as a
+     * request correlation identifier. The default is False.
+     * 
+ * + * bool trace_sampled = 30 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The traceSampled. + */ + @java.lang.Override + public boolean getTraceSampled() { + return traceSampled_; + } + + /** + * + * + *
+     * Optional. The sampling decision of the trace associated with the log entry.
+     *
+     * True means that the trace resource name in the `trace` field was sampled
+     * for storage in a trace backend. False means that the trace was not sampled
+     * for storage when this log entry was written, or the sampling decision was
+     * unknown at the time. A non-sampled `trace` value is still useful as a
+     * request correlation identifier. The default is False.
+     * 
+ * + * bool trace_sampled = 30 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The traceSampled to set. + * @return This builder for chaining. + */ + public Builder setTraceSampled(boolean value) { + + traceSampled_ = value; + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The sampling decision of the trace associated with the log entry.
+     *
+     * True means that the trace resource name in the `trace` field was sampled
+     * for storage in a trace backend. False means that the trace was not sampled
+     * for storage when this log entry was written, or the sampling decision was
+     * unknown at the time. A non-sampled `trace` value is still useful as a
+     * request correlation identifier. The default is False.
+     * 
+ * + * bool trace_sampled = 30 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearTraceSampled() { + bitField0_ = (bitField0_ & ~0x00004000); + traceSampled_ = false; + onChanged(); + return this; + } + + private com.google.logging.v2.LogEntrySourceLocation sourceLocation_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogEntrySourceLocation, + com.google.logging.v2.LogEntrySourceLocation.Builder, + com.google.logging.v2.LogEntrySourceLocationOrBuilder> + sourceLocationBuilder_; + + /** + * + * + *
+     * Optional. Source code location information associated with the log entry,
+     * if any.
+     * 
+ * + * + * .google.logging.v2.LogEntrySourceLocation source_location = 23 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the sourceLocation field is set. + */ + public boolean hasSourceLocation() { + return ((bitField0_ & 0x00008000) != 0); + } + + /** + * + * + *
+     * Optional. Source code location information associated with the log entry,
+     * if any.
+     * 
+ * + * + * .google.logging.v2.LogEntrySourceLocation source_location = 23 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The sourceLocation. + */ + public com.google.logging.v2.LogEntrySourceLocation getSourceLocation() { + if (sourceLocationBuilder_ == null) { + return sourceLocation_ == null + ? com.google.logging.v2.LogEntrySourceLocation.getDefaultInstance() + : sourceLocation_; + } else { + return sourceLocationBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. Source code location information associated with the log entry,
+     * if any.
+     * 
+ * + * + * .google.logging.v2.LogEntrySourceLocation source_location = 23 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setSourceLocation(com.google.logging.v2.LogEntrySourceLocation value) { + if (sourceLocationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sourceLocation_ = value; + } else { + sourceLocationBuilder_.setMessage(value); + } + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Source code location information associated with the log entry,
+     * if any.
+     * 
+ * + * + * .google.logging.v2.LogEntrySourceLocation source_location = 23 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setSourceLocation( + com.google.logging.v2.LogEntrySourceLocation.Builder builderForValue) { + if (sourceLocationBuilder_ == null) { + sourceLocation_ = builderForValue.build(); + } else { + sourceLocationBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00008000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Source code location information associated with the log entry,
+     * if any.
+     * 
+ * + * + * .google.logging.v2.LogEntrySourceLocation source_location = 23 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeSourceLocation(com.google.logging.v2.LogEntrySourceLocation value) { + if (sourceLocationBuilder_ == null) { + if (((bitField0_ & 0x00008000) != 0) + && sourceLocation_ != null + && sourceLocation_ + != com.google.logging.v2.LogEntrySourceLocation.getDefaultInstance()) { + getSourceLocationBuilder().mergeFrom(value); + } else { + sourceLocation_ = value; + } + } else { + sourceLocationBuilder_.mergeFrom(value); + } + if (sourceLocation_ != null) { + bitField0_ |= 0x00008000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. Source code location information associated with the log entry,
+     * if any.
+     * 
+ * + * + * .google.logging.v2.LogEntrySourceLocation source_location = 23 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearSourceLocation() { + bitField0_ = (bitField0_ & ~0x00008000); + sourceLocation_ = null; + if (sourceLocationBuilder_ != null) { + sourceLocationBuilder_.dispose(); + sourceLocationBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Source code location information associated with the log entry,
+     * if any.
+     * 
+ * + * + * .google.logging.v2.LogEntrySourceLocation source_location = 23 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.logging.v2.LogEntrySourceLocation.Builder getSourceLocationBuilder() { + bitField0_ |= 0x00008000; + onChanged(); + return getSourceLocationFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. Source code location information associated with the log entry,
+     * if any.
+     * 
+ * + * + * .google.logging.v2.LogEntrySourceLocation source_location = 23 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.logging.v2.LogEntrySourceLocationOrBuilder getSourceLocationOrBuilder() { + if (sourceLocationBuilder_ != null) { + return sourceLocationBuilder_.getMessageOrBuilder(); + } else { + return sourceLocation_ == null + ? com.google.logging.v2.LogEntrySourceLocation.getDefaultInstance() + : sourceLocation_; + } + } + + /** + * + * + *
+     * Optional. Source code location information associated with the log entry,
+     * if any.
+     * 
+ * + * + * .google.logging.v2.LogEntrySourceLocation source_location = 23 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogEntrySourceLocation, + com.google.logging.v2.LogEntrySourceLocation.Builder, + com.google.logging.v2.LogEntrySourceLocationOrBuilder> + getSourceLocationFieldBuilder() { + if (sourceLocationBuilder_ == null) { + sourceLocationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogEntrySourceLocation, + com.google.logging.v2.LogEntrySourceLocation.Builder, + com.google.logging.v2.LogEntrySourceLocationOrBuilder>( + getSourceLocation(), getParentForChildren(), isClean()); + sourceLocation_ = null; + } + return sourceLocationBuilder_; + } + + private com.google.logging.v2.LogSplit split_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogSplit, + com.google.logging.v2.LogSplit.Builder, + com.google.logging.v2.LogSplitOrBuilder> + splitBuilder_; + + /** + * + * + *
+     * Optional. Information indicating this LogEntry is part of a sequence of
+     * multiple log entries split from a single LogEntry.
+     * 
+ * + * .google.logging.v2.LogSplit split = 35 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the split field is set. + */ + public boolean hasSplit() { + return ((bitField0_ & 0x00010000) != 0); + } + + /** + * + * + *
+     * Optional. Information indicating this LogEntry is part of a sequence of
+     * multiple log entries split from a single LogEntry.
+     * 
+ * + * .google.logging.v2.LogSplit split = 35 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The split. + */ + public com.google.logging.v2.LogSplit getSplit() { + if (splitBuilder_ == null) { + return split_ == null ? com.google.logging.v2.LogSplit.getDefaultInstance() : split_; + } else { + return splitBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. Information indicating this LogEntry is part of a sequence of
+     * multiple log entries split from a single LogEntry.
+     * 
+ * + * .google.logging.v2.LogSplit split = 35 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setSplit(com.google.logging.v2.LogSplit value) { + if (splitBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + split_ = value; + } else { + splitBuilder_.setMessage(value); + } + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Information indicating this LogEntry is part of a sequence of
+     * multiple log entries split from a single LogEntry.
+     * 
+ * + * .google.logging.v2.LogSplit split = 35 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setSplit(com.google.logging.v2.LogSplit.Builder builderForValue) { + if (splitBuilder_ == null) { + split_ = builderForValue.build(); + } else { + splitBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Information indicating this LogEntry is part of a sequence of
+     * multiple log entries split from a single LogEntry.
+     * 
+ * + * .google.logging.v2.LogSplit split = 35 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeSplit(com.google.logging.v2.LogSplit value) { + if (splitBuilder_ == null) { + if (((bitField0_ & 0x00010000) != 0) + && split_ != null + && split_ != com.google.logging.v2.LogSplit.getDefaultInstance()) { + getSplitBuilder().mergeFrom(value); + } else { + split_ = value; + } + } else { + splitBuilder_.mergeFrom(value); + } + if (split_ != null) { + bitField0_ |= 0x00010000; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. Information indicating this LogEntry is part of a sequence of
+     * multiple log entries split from a single LogEntry.
+     * 
+ * + * .google.logging.v2.LogSplit split = 35 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearSplit() { + bitField0_ = (bitField0_ & ~0x00010000); + split_ = null; + if (splitBuilder_ != null) { + splitBuilder_.dispose(); + splitBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Information indicating this LogEntry is part of a sequence of
+     * multiple log entries split from a single LogEntry.
+     * 
+ * + * .google.logging.v2.LogSplit split = 35 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.logging.v2.LogSplit.Builder getSplitBuilder() { + bitField0_ |= 0x00010000; + onChanged(); + return getSplitFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. Information indicating this LogEntry is part of a sequence of
+     * multiple log entries split from a single LogEntry.
+     * 
+ * + * .google.logging.v2.LogSplit split = 35 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.logging.v2.LogSplitOrBuilder getSplitOrBuilder() { + if (splitBuilder_ != null) { + return splitBuilder_.getMessageOrBuilder(); + } else { + return split_ == null ? com.google.logging.v2.LogSplit.getDefaultInstance() : split_; + } + } + + /** + * + * + *
+     * Optional. Information indicating this LogEntry is part of a sequence of
+     * multiple log entries split from a single LogEntry.
+     * 
+ * + * .google.logging.v2.LogSplit split = 35 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogSplit, + com.google.logging.v2.LogSplit.Builder, + com.google.logging.v2.LogSplitOrBuilder> + getSplitFieldBuilder() { + if (splitBuilder_ == null) { + splitBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogSplit, + com.google.logging.v2.LogSplit.Builder, + com.google.logging.v2.LogSplitOrBuilder>( + getSplit(), getParentForChildren(), isClean()); + split_ = null; + } + return splitBuilder_; + } + + @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.logging.v2.LogEntry) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.LogEntry) + private static final com.google.logging.v2.LogEntry DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.LogEntry(); + } + + public static com.google.logging.v2.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.LogEntry getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntryOperation.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntryOperation.java new file mode 100644 index 000000000000..824affa8e620 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntryOperation.java @@ -0,0 +1,1038 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/log_entry.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * Additional information about a potentially long-running operation with which
+ * a log entry is associated.
+ * 
+ * + * Protobuf type {@code google.logging.v2.LogEntryOperation} + */ +public final class LogEntryOperation extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.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(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LogEntryProto + .internal_static_google_logging_v2_LogEntryOperation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LogEntryProto + .internal_static_google_logging_v2_LogEntryOperation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.LogEntryOperation.class, + com.google.logging.v2.LogEntryOperation.Builder.class); + } + + public static final int ID_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + 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 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + + @SuppressWarnings("serial") + 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 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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_ = false; + + /** + * + * + *
+   * Optional. Set this to True if this is the first log entry in the operation.
+   * 
+ * + * bool first = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The first. + */ + @java.lang.Override + public boolean getFirst() { + return first_; + } + + public static final int LAST_FIELD_NUMBER = 4; + private boolean last_ = false; + + /** + * + * + *
+   * Optional. Set this to True if this is the last log entry in the operation.
+   * 
+ * + * bool last = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, id_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(producer_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, producer_); + } + if (first_ != false) { + output.writeBool(3, first_); + } + if (last_ != false) { + output.writeBool(4, last_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, id_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(producer_)) { + 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 += getUnknownFields().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.logging.v2.LogEntryOperation)) { + return super.equals(obj); + } + com.google.logging.v2.LogEntryOperation other = (com.google.logging.v2.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 (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.LogEntryOperation parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.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.logging.v2.LogEntryOperation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.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.logging.v2.LogEntryOperation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.LogEntryOperation parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.LogEntryOperation parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.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.logging.v2.LogEntryOperation parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.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.logging.v2.LogEntryOperation parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.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.logging.v2.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.logging.v2.LogEntryOperation} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.LogEntryOperation) + com.google.logging.v2.LogEntryOperationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LogEntryProto + .internal_static_google_logging_v2_LogEntryOperation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LogEntryProto + .internal_static_google_logging_v2_LogEntryOperation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.LogEntryOperation.class, + com.google.logging.v2.LogEntryOperation.Builder.class); + } + + // Construct using com.google.logging.v2.LogEntryOperation.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + id_ = ""; + producer_ = ""; + first_ = false; + last_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LogEntryProto + .internal_static_google_logging_v2_LogEntryOperation_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.LogEntryOperation getDefaultInstanceForType() { + return com.google.logging.v2.LogEntryOperation.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.LogEntryOperation build() { + com.google.logging.v2.LogEntryOperation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.LogEntryOperation buildPartial() { + com.google.logging.v2.LogEntryOperation result = + new com.google.logging.v2.LogEntryOperation(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.logging.v2.LogEntryOperation result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.id_ = id_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.producer_ = producer_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.first_ = first_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.last_ = last_; + } + } + + @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.logging.v2.LogEntryOperation) { + return mergeFrom((com.google.logging.v2.LogEntryOperation) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.LogEntryOperation other) { + if (other == com.google.logging.v2.LogEntryOperation.getDefaultInstance()) return this; + if (!other.getId().isEmpty()) { + id_ = other.id_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getProducer().isEmpty()) { + producer_ = other.producer_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.getFirst() != false) { + setFirst(other.getFirst()); + } + if (other.getLast() != false) { + setLast(other.getLast()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + id_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + producer_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + first_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: + { + last_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + 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 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000001; + 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 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearId() { + id_ = getDefaultInstance().getId(); + bitField0_ = (bitField0_ & ~0x00000001); + 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 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000001; + 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 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000002; + 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 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearProducer() { + producer_ = getDefaultInstance().getProducer(); + bitField0_ = (bitField0_ & ~0x00000002); + 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 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private boolean first_; + + /** + * + * + *
+     * Optional. Set this to True if this is the first log entry in the operation.
+     * 
+ * + * bool first = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The first to set. + * @return This builder for chaining. + */ + public Builder setFirst(boolean value) { + + first_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Set this to True if this is the first log entry in the operation.
+     * 
+ * + * bool first = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFirst() { + bitField0_ = (bitField0_ & ~0x00000004); + 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 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The last to set. + * @return This builder for chaining. + */ + public Builder setLast(boolean value) { + + last_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Set this to True if this is the last log entry in the operation.
+     * 
+ * + * bool last = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearLast() { + bitField0_ = (bitField0_ & ~0x00000008); + 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.logging.v2.LogEntryOperation) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.LogEntryOperation) + private static final com.google.logging.v2.LogEntryOperation DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.LogEntryOperation(); + } + + public static com.google.logging.v2.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.LogEntryOperation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntryOperationOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntryOperationOrBuilder.java new file mode 100644 index 000000000000..a36a20a51b4b --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntryOperationOrBuilder.java @@ -0,0 +1,110 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/log_entry.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface LogEntryOperationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.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 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The first. + */ + boolean getFirst(); + + /** + * + * + *
+   * Optional. Set this to True if this is the last log entry in the operation.
+   * 
+ * + * bool last = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The last. + */ + boolean getLast(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntryOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntryOrBuilder.java new file mode 100644 index 000000000000..f12143fccd56 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntryOrBuilder.java @@ -0,0 +1,930 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/log_entry.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface LogEntryOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.LogEntry) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the log to which this log entry belongs:
+   *
+   *     "projects/[PROJECT_ID]/logs/[LOG_ID]"
+   *     "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]"
+   *     "folders/[FOLDER_ID]/logs/[LOG_ID]"
+   *
+   * A project number may be used in place of PROJECT_ID. The project number is
+   * translated to its corresponding PROJECT_ID internally and the `log_name`
+   * field will contain PROJECT_ID in queries and exports.
+   *
+   * `[LOG_ID]` must be URL-encoded within `log_name`. Example:
+   * `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`.
+   *
+   * `[LOG_ID]` must be less than 512 characters long and can only include the
+   * following characters: upper and lower case alphanumeric characters,
+   * forward-slash, underscore, hyphen, and period.
+   *
+   * For backward compatibility, if `log_name` begins with a forward-slash, such
+   * as `/projects/...`, then the log entry is ingested as usual, but the
+   * forward-slash is removed. Listing the log entry will not show the leading
+   * slash and filtering for a log name with a leading slash will never return
+   * any results.
+   * 
+ * + * string log_name = 12 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The logName. + */ + java.lang.String getLogName(); + + /** + * + * + *
+   * Required. The resource name of the log to which this log entry belongs:
+   *
+   *     "projects/[PROJECT_ID]/logs/[LOG_ID]"
+   *     "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]"
+   *     "folders/[FOLDER_ID]/logs/[LOG_ID]"
+   *
+   * A project number may be used in place of PROJECT_ID. The project number is
+   * translated to its corresponding PROJECT_ID internally and the `log_name`
+   * field will contain PROJECT_ID in queries and exports.
+   *
+   * `[LOG_ID]` must be URL-encoded within `log_name`. Example:
+   * `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`.
+   *
+   * `[LOG_ID]` must be less than 512 characters long and can only include the
+   * following characters: upper and lower case alphanumeric characters,
+   * forward-slash, underscore, hyphen, and period.
+   *
+   * For backward compatibility, if `log_name` begins with a forward-slash, such
+   * as `/projects/...`, then the log entry is ingested as usual, but the
+   * forward-slash is removed. Listing the log entry will not show the leading
+   * slash and filtering for a log name with a leading slash will never return
+   * any results.
+   * 
+ * + * string log_name = 12 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for logName. + */ + com.google.protobuf.ByteString getLogNameBytes(); + + /** + * + * + *
+   * Required. The monitored resource that produced this log entry.
+   *
+   * Example: a log entry that reports a database error would be associated with
+   * the monitored resource designating the particular database that reported
+   * the error.
+   * 
+ * + * .google.api.MonitoredResource resource = 8 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the resource field is set. + */ + boolean hasResource(); + + /** + * + * + *
+   * Required. The monitored resource that produced this log entry.
+   *
+   * Example: a log entry that reports a database error would be associated with
+   * the monitored resource designating the particular database that reported
+   * the error.
+   * 
+ * + * .google.api.MonitoredResource resource = 8 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The resource. + */ + com.google.api.MonitoredResource getResource(); + + /** + * + * + *
+   * Required. The monitored resource that produced this log entry.
+   *
+   * Example: a log entry that reports a database error would be associated with
+   * the monitored resource designating the particular database that reported
+   * the error.
+   * 
+ * + * .google.api.MonitoredResource resource = 8 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.api.MonitoredResourceOrBuilder getResourceOrBuilder(); + + /** + * + * + *
+   * The log entry payload, represented as a protocol buffer. Some Google
+   * Cloud Platform services use this field for their log entry payloads.
+   *
+   * The following protocol buffer types are supported; user-defined types
+   * are not supported:
+   *
+   *   "type.googleapis.com/google.cloud.audit.AuditLog"
+   *   "type.googleapis.com/google.appengine.logging.v1.RequestLog"
+   * 
+ * + * .google.protobuf.Any proto_payload = 2; + * + * @return Whether the protoPayload field is set. + */ + boolean hasProtoPayload(); + + /** + * + * + *
+   * The log entry payload, represented as a protocol buffer. Some Google
+   * Cloud Platform services use this field for their log entry payloads.
+   *
+   * The following protocol buffer types are supported; user-defined types
+   * are not supported:
+   *
+   *   "type.googleapis.com/google.cloud.audit.AuditLog"
+   *   "type.googleapis.com/google.appengine.logging.v1.RequestLog"
+   * 
+ * + * .google.protobuf.Any proto_payload = 2; + * + * @return The protoPayload. + */ + com.google.protobuf.Any getProtoPayload(); + + /** + * + * + *
+   * The log entry payload, represented as a protocol buffer. Some Google
+   * Cloud Platform services use this field for their log entry payloads.
+   *
+   * The following protocol buffer types are supported; user-defined types
+   * are not supported:
+   *
+   *   "type.googleapis.com/google.cloud.audit.AuditLog"
+   *   "type.googleapis.com/google.appengine.logging.v1.RequestLog"
+   * 
+ * + * .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 json_payload = 6; + * + * @return Whether the jsonPayload field is set. + */ + boolean hasJsonPayload(); + + /** + * + * + *
+   * The log entry payload, represented as a structure that is
+   * expressed as a JSON object.
+   * 
+ * + * .google.protobuf.Struct json_payload = 6; + * + * @return The jsonPayload. + */ + com.google.protobuf.Struct getJsonPayload(); + + /** + * + * + *
+   * The log entry payload, represented as a structure that is
+   * expressed as a JSON object.
+   * 
+ * + * .google.protobuf.Struct json_payload = 6; + */ + com.google.protobuf.StructOrBuilder getJsonPayloadOrBuilder(); + + /** + * + * + *
+   * Optional. The time the event described by the log entry occurred. This time
+   * is used to compute the log entry's age and to enforce the logs retention
+   * period. If this field is omitted in a new log entry, then Logging assigns
+   * it the current time. Timestamps have nanosecond accuracy, but trailing
+   * zeros in the fractional seconds might be omitted when the timestamp is
+   * displayed.
+   *
+   * Incoming log entries must have timestamps that don't exceed the
+   * [logs retention
+   * period](https://cloud.google.com/logging/quotas#logs_retention_periods) in
+   * the past, and that don't exceed 24 hours in the future. Log entries outside
+   * those time boundaries aren't ingested by Logging.
+   * 
+ * + * .google.protobuf.Timestamp timestamp = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the timestamp field is set. + */ + boolean hasTimestamp(); + + /** + * + * + *
+   * Optional. The time the event described by the log entry occurred. This time
+   * is used to compute the log entry's age and to enforce the logs retention
+   * period. If this field is omitted in a new log entry, then Logging assigns
+   * it the current time. Timestamps have nanosecond accuracy, but trailing
+   * zeros in the fractional seconds might be omitted when the timestamp is
+   * displayed.
+   *
+   * Incoming log entries must have timestamps that don't exceed the
+   * [logs retention
+   * period](https://cloud.google.com/logging/quotas#logs_retention_periods) in
+   * the past, and that don't exceed 24 hours in the future. Log entries outside
+   * those time boundaries aren't ingested by Logging.
+   * 
+ * + * .google.protobuf.Timestamp timestamp = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The timestamp. + */ + com.google.protobuf.Timestamp getTimestamp(); + + /** + * + * + *
+   * Optional. The time the event described by the log entry occurred. This time
+   * is used to compute the log entry's age and to enforce the logs retention
+   * period. If this field is omitted in a new log entry, then Logging assigns
+   * it the current time. Timestamps have nanosecond accuracy, but trailing
+   * zeros in the fractional seconds might be omitted when the timestamp is
+   * displayed.
+   *
+   * Incoming log entries must have timestamps that don't exceed the
+   * [logs retention
+   * period](https://cloud.google.com/logging/quotas#logs_retention_periods) in
+   * the past, and that don't exceed 24 hours in the future. Log entries outside
+   * those time boundaries aren't ingested by Logging.
+   * 
+ * + * .google.protobuf.Timestamp timestamp = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.TimestampOrBuilder getTimestampOrBuilder(); + + /** + * + * + *
+   * Output only. The time the log entry was received by Logging.
+   * 
+ * + * + * .google.protobuf.Timestamp receive_timestamp = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the receiveTimestamp field is set. + */ + boolean hasReceiveTimestamp(); + + /** + * + * + *
+   * Output only. The time the log entry was received by Logging.
+   * 
+ * + * + * .google.protobuf.Timestamp receive_timestamp = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The receiveTimestamp. + */ + com.google.protobuf.Timestamp getReceiveTimestamp(); + + /** + * + * + *
+   * Output only. The time the log entry was received by Logging.
+   * 
+ * + * + * .google.protobuf.Timestamp receive_timestamp = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getReceiveTimestampOrBuilder(); + + /** + * + * + *
+   * Optional. The severity of the log entry. The default value is
+   * `LogSeverity.DEFAULT`.
+   * 
+ * + * .google.logging.type.LogSeverity severity = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for severity. + */ + int getSeverityValue(); + + /** + * + * + *
+   * Optional. The severity of the log entry. The default value is
+   * `LogSeverity.DEFAULT`.
+   * 
+ * + * .google.logging.type.LogSeverity severity = 10 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The severity. + */ + com.google.logging.type.LogSeverity getSeverity(); + + /** + * + * + *
+   * Optional. A unique identifier for the log entry. If you provide a value,
+   * then Logging considers other log entries in the same project, with the same
+   * `timestamp`, and with the same `insert_id` to be duplicates which are
+   * removed in a single query result. However, there are no guarantees of
+   * de-duplication in the export of logs.
+   *
+   * If the `insert_id` is omitted when writing a log entry, the Logging API
+   * assigns its own unique identifier in this field.
+   *
+   * In queries, the `insert_id` is also used to order log entries that have
+   * the same `log_name` and `timestamp` values.
+   * 
+ * + * string insert_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The insertId. + */ + java.lang.String getInsertId(); + + /** + * + * + *
+   * Optional. A unique identifier for the log entry. If you provide a value,
+   * then Logging considers other log entries in the same project, with the same
+   * `timestamp`, and with the same `insert_id` to be duplicates which are
+   * removed in a single query result. However, there are no guarantees of
+   * de-duplication in the export of logs.
+   *
+   * If the `insert_id` is omitted when writing a log entry, the Logging API
+   * assigns its own unique identifier in this field.
+   *
+   * In queries, the `insert_id` is also used to order log entries that have
+   * the same `log_name` and `timestamp` values.
+   * 
+ * + * string insert_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for insertId. + */ + com.google.protobuf.ByteString getInsertIdBytes(); + + /** + * + * + *
+   * Optional. Information about the HTTP request associated with this log
+   * entry, if applicable.
+   * 
+ * + * + * .google.logging.type.HttpRequest http_request = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the httpRequest field is set. + */ + boolean hasHttpRequest(); + + /** + * + * + *
+   * Optional. Information about the HTTP request associated with this log
+   * entry, if applicable.
+   * 
+ * + * + * .google.logging.type.HttpRequest http_request = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The httpRequest. + */ + com.google.logging.type.HttpRequest getHttpRequest(); + + /** + * + * + *
+   * Optional. Information about the HTTP request associated with this log
+   * entry, if applicable.
+   * 
+ * + * + * .google.logging.type.HttpRequest http_request = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.logging.type.HttpRequestOrBuilder getHttpRequestOrBuilder(); + + /** + * + * + *
+   * Optional. A map of key, value pairs that provides additional information
+   * about the log entry. The labels can be user-defined or system-defined.
+   *
+   * User-defined labels are arbitrary key, value pairs that you can use to
+   * classify logs.
+   *
+   * System-defined labels are defined by GCP services for platform logs.
+   * They have two components - a service namespace component and the
+   * attribute name. For example: `compute.googleapis.com/resource_name`.
+   *
+   * Cloud Logging truncates label keys that exceed 512 B and label
+   * values that exceed 64 KB upon their associated log entry being
+   * written. The truncation is indicated by an ellipsis at the
+   * end of the character string.
+   * 
+ * + * map<string, string> labels = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + int getLabelsCount(); + + /** + * + * + *
+   * Optional. A map of key, value pairs that provides additional information
+   * about the log entry. The labels can be user-defined or system-defined.
+   *
+   * User-defined labels are arbitrary key, value pairs that you can use to
+   * classify logs.
+   *
+   * System-defined labels are defined by GCP services for platform logs.
+   * They have two components - a service namespace component and the
+   * attribute name. For example: `compute.googleapis.com/resource_name`.
+   *
+   * Cloud Logging truncates label keys that exceed 512 B and label
+   * values that exceed 64 KB upon their associated log entry being
+   * written. The truncation is indicated by an ellipsis at the
+   * end of the character string.
+   * 
+ * + * map<string, string> labels = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + boolean containsLabels(java.lang.String key); + + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + + /** + * + * + *
+   * Optional. A map of key, value pairs that provides additional information
+   * about the log entry. The labels can be user-defined or system-defined.
+   *
+   * User-defined labels are arbitrary key, value pairs that you can use to
+   * classify logs.
+   *
+   * System-defined labels are defined by GCP services for platform logs.
+   * They have two components - a service namespace component and the
+   * attribute name. For example: `compute.googleapis.com/resource_name`.
+   *
+   * Cloud Logging truncates label keys that exceed 512 B and label
+   * values that exceed 64 KB upon their associated log entry being
+   * written. The truncation is indicated by an ellipsis at the
+   * end of the character string.
+   * 
+ * + * map<string, string> labels = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + java.util.Map getLabelsMap(); + + /** + * + * + *
+   * Optional. A map of key, value pairs that provides additional information
+   * about the log entry. The labels can be user-defined or system-defined.
+   *
+   * User-defined labels are arbitrary key, value pairs that you can use to
+   * classify logs.
+   *
+   * System-defined labels are defined by GCP services for platform logs.
+   * They have two components - a service namespace component and the
+   * attribute name. For example: `compute.googleapis.com/resource_name`.
+   *
+   * Cloud Logging truncates label keys that exceed 512 B and label
+   * values that exceed 64 KB upon their associated log entry being
+   * written. The truncation is indicated by an ellipsis at the
+   * end of the character string.
+   * 
+ * + * map<string, string> labels = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + /* nullable */ + java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + + /** + * + * + *
+   * Optional. A map of key, value pairs that provides additional information
+   * about the log entry. The labels can be user-defined or system-defined.
+   *
+   * User-defined labels are arbitrary key, value pairs that you can use to
+   * classify logs.
+   *
+   * System-defined labels are defined by GCP services for platform logs.
+   * They have two components - a service namespace component and the
+   * attribute name. For example: `compute.googleapis.com/resource_name`.
+   *
+   * Cloud Logging truncates label keys that exceed 512 B and label
+   * values that exceed 64 KB upon their associated log entry being
+   * written. The truncation is indicated by an ellipsis at the
+   * end of the character string.
+   * 
+ * + * map<string, string> labels = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Optional. Information about an operation associated with the log entry, if
+   * applicable.
+   * 
+ * + * + * .google.logging.v2.LogEntryOperation operation = 15 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the operation field is set. + */ + boolean hasOperation(); + + /** + * + * + *
+   * Optional. Information about an operation associated with the log entry, if
+   * applicable.
+   * 
+ * + * + * .google.logging.v2.LogEntryOperation operation = 15 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The operation. + */ + com.google.logging.v2.LogEntryOperation getOperation(); + + /** + * + * + *
+   * Optional. Information about an operation associated with the log entry, if
+   * applicable.
+   * 
+ * + * + * .google.logging.v2.LogEntryOperation operation = 15 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.logging.v2.LogEntryOperationOrBuilder getOperationOrBuilder(); + + /** + * + * + *
+   * Optional. The REST resource name of the trace being written to
+   * [Cloud Trace](https://cloud.google.com/trace) in
+   * association with this log entry. For example, if your trace data is stored
+   * in the Cloud project "my-trace-project" and if the service that is creating
+   * the log entry receives a trace header that includes the trace ID "12345",
+   * then the service should use "projects/my-tracing-project/traces/12345".
+   *
+   * The `trace` field provides the link between logs and traces. By using
+   * this field, you can navigate from a log entry to a trace.
+   * 
+ * + * string trace = 22 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The trace. + */ + java.lang.String getTrace(); + + /** + * + * + *
+   * Optional. The REST resource name of the trace being written to
+   * [Cloud Trace](https://cloud.google.com/trace) in
+   * association with this log entry. For example, if your trace data is stored
+   * in the Cloud project "my-trace-project" and if the service that is creating
+   * the log entry receives a trace header that includes the trace ID "12345",
+   * then the service should use "projects/my-tracing-project/traces/12345".
+   *
+   * The `trace` field provides the link between logs and traces. By using
+   * this field, you can navigate from a log entry to a trace.
+   * 
+ * + * string trace = 22 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for trace. + */ + com.google.protobuf.ByteString getTraceBytes(); + + /** + * + * + *
+   * Optional. The ID of the [Cloud Trace](https://cloud.google.com/trace) span
+   * associated with the current operation in which the log is being written.
+   * For example, if a span has the REST resource name of
+   * "projects/some-project/traces/some-trace/spans/some-span-id", then the
+   * `span_id` field is "some-span-id".
+   *
+   * A
+   * [Span](https://cloud.google.com/trace/docs/reference/v2/rest/v2/projects.traces/batchWrite#Span)
+   * represents a single operation within a trace. Whereas a trace may involve
+   * multiple different microservices running on multiple different machines,
+   * a span generally corresponds to a single logical operation being performed
+   * in a single instance of a microservice on one specific machine. Spans
+   * are the nodes within the tree that is a trace.
+   *
+   * Applications that are [instrumented for
+   * tracing](https://cloud.google.com/trace/docs/setup) will generally assign a
+   * new, unique span ID on each incoming request. It is also common to create
+   * and record additional spans corresponding to internal processing elements
+   * as well as issuing requests to dependencies.
+   *
+   * The span ID is expected to be a 16-character, hexadecimal encoding of an
+   * 8-byte array and should not be zero. It should be unique within the trace
+   * and should, ideally, be generated in a manner that is uniformly random.
+   *
+   * Example values:
+   *
+   *   - `000000000000004a`
+   *   - `7a2190356c3fc94b`
+   *   - `0000f00300090021`
+   *   - `d39223e101960076`
+   * 
+ * + * string span_id = 27 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The spanId. + */ + java.lang.String getSpanId(); + + /** + * + * + *
+   * Optional. The ID of the [Cloud Trace](https://cloud.google.com/trace) span
+   * associated with the current operation in which the log is being written.
+   * For example, if a span has the REST resource name of
+   * "projects/some-project/traces/some-trace/spans/some-span-id", then the
+   * `span_id` field is "some-span-id".
+   *
+   * A
+   * [Span](https://cloud.google.com/trace/docs/reference/v2/rest/v2/projects.traces/batchWrite#Span)
+   * represents a single operation within a trace. Whereas a trace may involve
+   * multiple different microservices running on multiple different machines,
+   * a span generally corresponds to a single logical operation being performed
+   * in a single instance of a microservice on one specific machine. Spans
+   * are the nodes within the tree that is a trace.
+   *
+   * Applications that are [instrumented for
+   * tracing](https://cloud.google.com/trace/docs/setup) will generally assign a
+   * new, unique span ID on each incoming request. It is also common to create
+   * and record additional spans corresponding to internal processing elements
+   * as well as issuing requests to dependencies.
+   *
+   * The span ID is expected to be a 16-character, hexadecimal encoding of an
+   * 8-byte array and should not be zero. It should be unique within the trace
+   * and should, ideally, be generated in a manner that is uniformly random.
+   *
+   * Example values:
+   *
+   *   - `000000000000004a`
+   *   - `7a2190356c3fc94b`
+   *   - `0000f00300090021`
+   *   - `d39223e101960076`
+   * 
+ * + * string span_id = 27 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for spanId. + */ + com.google.protobuf.ByteString getSpanIdBytes(); + + /** + * + * + *
+   * Optional. The sampling decision of the trace associated with the log entry.
+   *
+   * True means that the trace resource name in the `trace` field was sampled
+   * for storage in a trace backend. False means that the trace was not sampled
+   * for storage when this log entry was written, or the sampling decision was
+   * unknown at the time. A non-sampled `trace` value is still useful as a
+   * request correlation identifier. The default is False.
+   * 
+ * + * bool trace_sampled = 30 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The traceSampled. + */ + boolean getTraceSampled(); + + /** + * + * + *
+   * Optional. Source code location information associated with the log entry,
+   * if any.
+   * 
+ * + * + * .google.logging.v2.LogEntrySourceLocation source_location = 23 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the sourceLocation field is set. + */ + boolean hasSourceLocation(); + + /** + * + * + *
+   * Optional. Source code location information associated with the log entry,
+   * if any.
+   * 
+ * + * + * .google.logging.v2.LogEntrySourceLocation source_location = 23 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The sourceLocation. + */ + com.google.logging.v2.LogEntrySourceLocation getSourceLocation(); + + /** + * + * + *
+   * Optional. Source code location information associated with the log entry,
+   * if any.
+   * 
+ * + * + * .google.logging.v2.LogEntrySourceLocation source_location = 23 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.logging.v2.LogEntrySourceLocationOrBuilder getSourceLocationOrBuilder(); + + /** + * + * + *
+   * Optional. Information indicating this LogEntry is part of a sequence of
+   * multiple log entries split from a single LogEntry.
+   * 
+ * + * .google.logging.v2.LogSplit split = 35 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the split field is set. + */ + boolean hasSplit(); + + /** + * + * + *
+   * Optional. Information indicating this LogEntry is part of a sequence of
+   * multiple log entries split from a single LogEntry.
+   * 
+ * + * .google.logging.v2.LogSplit split = 35 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The split. + */ + com.google.logging.v2.LogSplit getSplit(); + + /** + * + * + *
+   * Optional. Information indicating this LogEntry is part of a sequence of
+   * multiple log entries split from a single LogEntry.
+   * 
+ * + * .google.logging.v2.LogSplit split = 35 [(.google.api.field_behavior) = OPTIONAL]; + */ + com.google.logging.v2.LogSplitOrBuilder getSplitOrBuilder(); + + com.google.logging.v2.LogEntry.PayloadCase getPayloadCase(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntryProto.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntryProto.java new file mode 100644 index 000000000000..6bd3e07fbd30 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntryProto.java @@ -0,0 +1,208 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/log_entry.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +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_logging_v2_LogEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_LogEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_LogEntry_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_LogEntry_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_LogEntryOperation_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_LogEntryOperation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_LogEntrySourceLocation_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_LogEntrySourceLocation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_LogSplit_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_LogSplit_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/logging/v2/log_entry.proto\022\021goo" + + "gle.logging.v2\032\037google/api/field_behavio" + + "r.proto\032#google/api/monitored_resource.p" + + "roto\032\031google/api/resource.proto\032&google/" + + "logging/type/http_request.proto\032&google/" + + "logging/type/log_severity.proto\032\031google/" + + "protobuf/any.proto\032\034google/protobuf/stru" + + "ct.proto\032\037google/protobuf/timestamp.proto\"\203\010\n" + + "\010LogEntry\022\025\n" + + "\010log_name\030\014 \001(\tB\003\340A\002\0224\n" + + "\010resource\030\010" + + " \001(\0132\035.google.api.MonitoredResourceB\003\340A\002\022-\n\r" + + "proto_payload\030\002 \001(\0132\024.google.protobuf.AnyH\000\022\026\n" + + "\014text_payload\030\003 \001(\tH\000\022/\n" + + "\014json_payload\030\006 \001(\0132\027.google.protobuf.StructH\000\0222\n" + + "\ttimestamp\030\t \001(\0132\032.google.protobuf.TimestampB\003\340A\001\022:\n" + + "\021receive_timestamp\030\030" + + " \001(\0132\032.google.protobuf.TimestampB\003\340A\003\0227\n" + + "\010severity\030\n" + + " \001(\0162 .google.logging.type.LogSeverityB\003\340A\001\022\026\n" + + "\tinsert_id\030\004 \001(\tB\003\340A\001\022;\n" + + "\014http_request\030\007 \001(\0132" + + " .google.logging.type.HttpRequestB\003\340A\001\022<\n" + + "\006labels\030\013 \003(" + + "\0132\'.google.logging.v2.LogEntry.LabelsEntryB\003\340A\001\022<\n" + + "\toperation\030\017" + + " \001(\0132$.google.logging.v2.LogEntryOperationB\003\340A\001\022\022\n" + + "\005trace\030\026 \001(\tB\003\340A\001\022\024\n" + + "\007span_id\030\033 \001(\tB\003\340A\001\022\032\n\r" + + "trace_sampled\030\036 \001(\010B\003\340A\001\022G\n" + + "\017source_location\030\027" + + " \001(\0132).google.logging.v2.LogEntrySourceLocationB\003\340A\001\022/\n" + + "\005split\030# \001(\0132\033.google.logging.v2.LogSplitB\003\340A\001\032-\n" + + "\013LabelsEntry\022\013\n" + + "\003key\030\001 \001(\t\022\r\n" + + "\005value\030\002 \001(\t:\0028\001:\275\001\352A\271\001\n" + + "\032logging.googleapis.com/Log\022\035projects/{proje" + + "ct}/logs/{log}\022\'organizations/{organizat" + + "ion}/logs/{log}\022\033folders/{folder}/logs/{" + + "log}\022,billingAccounts/{billing_account}/logs/{log}\032\010log_nameB\t\n" + + "\007payload\"b\n" + + "\021LogEntryOperation\022\017\n" + + "\002id\030\001 \001(\tB\003\340A\001\022\025\n" + + "\010producer\030\002 \001(\tB\003\340A\001\022\022\n" + + "\005first\030\003 \001(\010B\003\340A\001\022\021\n" + + "\004last\030\004 \001(\010B\003\340A\001\"U\n" + + "\026LogEntrySourceLocation\022\021\n" + + "\004file\030\001 \001(\tB\003\340A\001\022\021\n" + + "\004line\030\002 \001(\003B\003\340A\001\022\025\n" + + "\010function\030\003 \001(\tB\003\340A\001\"<\n" + + "\010LogSplit\022\013\n" + + "\003uid\030\001 \001(\t\022\r\n" + + "\005index\030\002 \001(\005\022\024\n" + + "\014total_splits\030\003 \001(\005B\263\001\n" + + "\025com.google.logging.v2B\r" + + "LogEntryProtoP\001Z5cloud.google.com/go/logging/apiv2/l" + + "oggingpb;loggingpb\370\001\001\252\002\027Google.Cloud.Log" + + "ging.V2\312\002\027Google\\Cloud\\Logging\\V2\352\002\032Goog" + + "le::Cloud::Logging::V2b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.MonitoredResourceProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.logging.type.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_logging_v2_LogEntry_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_logging_v2_LogEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_LogEntry_descriptor, + new java.lang.String[] { + "LogName", + "Resource", + "ProtoPayload", + "TextPayload", + "JsonPayload", + "Timestamp", + "ReceiveTimestamp", + "Severity", + "InsertId", + "HttpRequest", + "Labels", + "Operation", + "Trace", + "SpanId", + "TraceSampled", + "SourceLocation", + "Split", + "Payload", + }); + internal_static_google_logging_v2_LogEntry_LabelsEntry_descriptor = + internal_static_google_logging_v2_LogEntry_descriptor.getNestedTypes().get(0); + internal_static_google_logging_v2_LogEntry_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_LogEntry_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_logging_v2_LogEntryOperation_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_logging_v2_LogEntryOperation_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_LogEntryOperation_descriptor, + new java.lang.String[] { + "Id", "Producer", "First", "Last", + }); + internal_static_google_logging_v2_LogEntrySourceLocation_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_logging_v2_LogEntrySourceLocation_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_LogEntrySourceLocation_descriptor, + new java.lang.String[] { + "File", "Line", "Function", + }); + internal_static_google_logging_v2_LogSplit_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_logging_v2_LogSplit_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_LogSplit_descriptor, + new java.lang.String[] { + "Uid", "Index", "TotalSplits", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.ResourceProto.resource); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.MonitoredResourceProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.logging.type.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/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntrySourceLocation.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntrySourceLocation.java new file mode 100644 index 000000000000..164f9c0210bd --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntrySourceLocation.java @@ -0,0 +1,967 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/log_entry.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * Additional information about the source code location that produced the log
+ * entry.
+ * 
+ * + * Protobuf type {@code google.logging.v2.LogEntrySourceLocation} + */ +public final class LogEntrySourceLocation extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.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(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LogEntryProto + .internal_static_google_logging_v2_LogEntrySourceLocation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LogEntryProto + .internal_static_google_logging_v2_LogEntrySourceLocation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.LogEntrySourceLocation.class, + com.google.logging.v2.LogEntrySourceLocation.Builder.class); + } + + public static final int FILE_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + 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 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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_ = 0L; + + /** + * + * + *
+   * Optional. Line within the source file. 1-based; 0 indicates no line number
+   * available.
+   * 
+ * + * int64 line = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The line. + */ + @java.lang.Override + public long getLine() { + return line_; + } + + public static final int FUNCTION_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + 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 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(file_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, file_); + } + if (line_ != 0L) { + output.writeInt64(2, line_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(function_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, function_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(file_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, file_); + } + if (line_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, line_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(function_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, function_); + } + size += getUnknownFields().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.logging.v2.LogEntrySourceLocation)) { + return super.equals(obj); + } + com.google.logging.v2.LogEntrySourceLocation other = + (com.google.logging.v2.LogEntrySourceLocation) obj; + + if (!getFile().equals(other.getFile())) return false; + if (getLine() != other.getLine()) return false; + if (!getFunction().equals(other.getFunction())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.LogEntrySourceLocation parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.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.logging.v2.LogEntrySourceLocation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.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.logging.v2.LogEntrySourceLocation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.LogEntrySourceLocation parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.LogEntrySourceLocation parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.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.logging.v2.LogEntrySourceLocation parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.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.logging.v2.LogEntrySourceLocation parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.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.logging.v2.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.logging.v2.LogEntrySourceLocation} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.LogEntrySourceLocation) + com.google.logging.v2.LogEntrySourceLocationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LogEntryProto + .internal_static_google_logging_v2_LogEntrySourceLocation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LogEntryProto + .internal_static_google_logging_v2_LogEntrySourceLocation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.LogEntrySourceLocation.class, + com.google.logging.v2.LogEntrySourceLocation.Builder.class); + } + + // Construct using com.google.logging.v2.LogEntrySourceLocation.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + file_ = ""; + line_ = 0L; + function_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LogEntryProto + .internal_static_google_logging_v2_LogEntrySourceLocation_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.LogEntrySourceLocation getDefaultInstanceForType() { + return com.google.logging.v2.LogEntrySourceLocation.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.LogEntrySourceLocation build() { + com.google.logging.v2.LogEntrySourceLocation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.LogEntrySourceLocation buildPartial() { + com.google.logging.v2.LogEntrySourceLocation result = + new com.google.logging.v2.LogEntrySourceLocation(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.logging.v2.LogEntrySourceLocation result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.file_ = file_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.line_ = line_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.function_ = function_; + } + } + + @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.logging.v2.LogEntrySourceLocation) { + return mergeFrom((com.google.logging.v2.LogEntrySourceLocation) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.LogEntrySourceLocation other) { + if (other == com.google.logging.v2.LogEntrySourceLocation.getDefaultInstance()) return this; + if (!other.getFile().isEmpty()) { + file_ = other.file_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getLine() != 0L) { + setLine(other.getLine()); + } + if (!other.getFunction().isEmpty()) { + function_ = other.function_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + file_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + line_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + function_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + 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 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000001; + 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 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFile() { + file_ = getDefaultInstance().getFile(); + bitField0_ = (bitField0_ & ~0x00000001); + 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 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private long line_; + + /** + * + * + *
+     * Optional. Line within the source file. 1-based; 0 indicates no line number
+     * available.
+     * 
+ * + * int64 line = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The line to set. + * @return This builder for chaining. + */ + public Builder setLine(long value) { + + line_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Line within the source file. 1-based; 0 indicates no line number
+     * available.
+     * 
+ * + * int64 line = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearLine() { + bitField0_ = (bitField0_ & ~0x00000002); + 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 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000004; + 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 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFunction() { + function_ = getDefaultInstance().getFunction(); + bitField0_ = (bitField0_ & ~0x00000004); + 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 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + bitField0_ |= 0x00000004; + 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.logging.v2.LogEntrySourceLocation) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.LogEntrySourceLocation) + private static final com.google.logging.v2.LogEntrySourceLocation DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.LogEntrySourceLocation(); + } + + public static com.google.logging.v2.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.LogEntrySourceLocation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntrySourceLocationOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntrySourceLocationOrBuilder.java new file mode 100644 index 000000000000..f146e30c32b5 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntrySourceLocationOrBuilder.java @@ -0,0 +1,104 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/log_entry.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface LogEntrySourceLocationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.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 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for function. + */ + com.google.protobuf.ByteString getFunctionBytes(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogExclusion.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogExclusion.java new file mode 100644 index 000000000000..883ba15f41bd --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogExclusion.java @@ -0,0 +1,1862 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * Specifies a set of log entries that are filtered out by a sink. If
+ * your Google Cloud resource receives a large volume of log entries, you can
+ * use exclusions to reduce your chargeable logs. Note that exclusions on
+ * organization-level and folder-level sinks don't apply to child resources.
+ * Note also that you cannot modify the _Required sink or exclude logs from it.
+ * 
+ * + * Protobuf type {@code google.logging.v2.LogExclusion} + */ +public final class LogExclusion extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.LogExclusion) + LogExclusionOrBuilder { + private static final long serialVersionUID = 0L; + + // Use LogExclusion.newBuilder() to construct. + private LogExclusion(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private LogExclusion() { + name_ = ""; + description_ = ""; + filter_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new LogExclusion(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_LogExclusion_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_LogExclusion_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.LogExclusion.class, + com.google.logging.v2.LogExclusion.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. A client-assigned identifier, such as
+   * `"load-balancer-exclusion"`. Identifiers are limited to 100 characters and
+   * can include only letters, digits, underscores, hyphens, and periods. First
+   * character has to be alphanumeric.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. A client-assigned identifier, such as
+   * `"load-balancer-exclusion"`. Identifiers are limited to 100 characters and
+   * can include only letters, digits, underscores, hyphens, and periods. First
+   * character has to be alphanumeric.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + + /** + * + * + *
+   * Optional. A description of this exclusion.
+   * 
+ * + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. A description of this exclusion.
+   * 
+ * + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + + /** + * + * + *
+   * Required. An [advanced logs
+   * filter](https://cloud.google.com/logging/docs/view/advanced-queries) that
+   * matches the log entries to be excluded. By using the [sample
+   * function](https://cloud.google.com/logging/docs/view/advanced-queries#sample),
+   * you can exclude less than 100% of the matching log entries.
+   *
+   * For example, the following query matches 99% of low-severity log entries
+   * from Google Cloud Storage buckets:
+   *
+   *   `resource.type=gcs_bucket severity<ERROR sample(insertId, 0.99)`
+   * 
+ * + * string filter = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. An [advanced logs
+   * filter](https://cloud.google.com/logging/docs/view/advanced-queries) that
+   * matches the log entries to be excluded. By using the [sample
+   * function](https://cloud.google.com/logging/docs/view/advanced-queries#sample),
+   * you can exclude less than 100% of the matching log entries.
+   *
+   * For example, the following query matches 99% of low-severity log entries
+   * from Google Cloud Storage buckets:
+   *
+   *   `resource.type=gcs_bucket severity<ERROR sample(insertId, 0.99)`
+   * 
+ * + * string filter = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISABLED_FIELD_NUMBER = 4; + private boolean disabled_ = false; + + /** + * + * + *
+   * Optional. If set to True, then this exclusion is disabled and it does not
+   * exclude any log entries. You can [update an
+   * exclusion][google.logging.v2.ConfigServiceV2.UpdateExclusion] to change the
+   * value of this field.
+   * 
+ * + * bool disabled = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The disabled. + */ + @java.lang.Override + public boolean getDisabled() { + return disabled_; + } + + public static final int CREATE_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp createTime_; + + /** + * + * + *
+   * Output only. The creation timestamp of the exclusion.
+   *
+   * This field may not be present for older exclusions.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Output only. The creation timestamp of the exclusion.
+   *
+   * This field may not be present for older exclusions.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + /** + * + * + *
+   * Output only. The creation timestamp of the exclusion.
+   *
+   * This field may not be present for older exclusions.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 6; + private com.google.protobuf.Timestamp updateTime_; + + /** + * + * + *
+   * Output only. The last update timestamp of the exclusion.
+   *
+   * This field may not be present for older exclusions.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Output only. The last update timestamp of the exclusion.
+   *
+   * This field may not be present for older exclusions.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + /** + * + * + *
+   * Output only. The last update timestamp of the exclusion.
+   *
+   * This field may not be present for older exclusions.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, description_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, filter_); + } + if (disabled_ != false) { + output.writeBool(4, disabled_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(5, getCreateTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(6, getUpdateTime()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, description_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, filter_); + } + if (disabled_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, disabled_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getCreateTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getUpdateTime()); + } + size += getUnknownFields().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.logging.v2.LogExclusion)) { + return super.equals(obj); + } + com.google.logging.v2.LogExclusion other = (com.google.logging.v2.LogExclusion) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (getDisabled() != other.getDisabled()) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + DISABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDisabled()); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.LogExclusion parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.LogExclusion parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.LogExclusion parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.LogExclusion 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.logging.v2.LogExclusion parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.LogExclusion parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.LogExclusion parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.LogExclusion 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.logging.v2.LogExclusion parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.LogExclusion 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.logging.v2.LogExclusion parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.LogExclusion 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.logging.v2.LogExclusion prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * Specifies a set of log entries that are filtered out by a sink. If
+   * your Google Cloud resource receives a large volume of log entries, you can
+   * use exclusions to reduce your chargeable logs. Note that exclusions on
+   * organization-level and folder-level sinks don't apply to child resources.
+   * Note also that you cannot modify the _Required sink or exclude logs from it.
+   * 
+ * + * Protobuf type {@code google.logging.v2.LogExclusion} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.LogExclusion) + com.google.logging.v2.LogExclusionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_LogExclusion_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_LogExclusion_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.LogExclusion.class, + com.google.logging.v2.LogExclusion.Builder.class); + } + + // Construct using com.google.logging.v2.LogExclusion.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getCreateTimeFieldBuilder(); + getUpdateTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + description_ = ""; + filter_ = ""; + disabled_ = false; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_LogExclusion_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.LogExclusion getDefaultInstanceForType() { + return com.google.logging.v2.LogExclusion.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.LogExclusion build() { + com.google.logging.v2.LogExclusion result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.LogExclusion buildPartial() { + com.google.logging.v2.LogExclusion result = new com.google.logging.v2.LogExclusion(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.logging.v2.LogExclusion result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.description_ = description_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.filter_ = filter_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.disabled_ = disabled_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000010) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @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.logging.v2.LogExclusion) { + return mergeFrom((com.google.logging.v2.LogExclusion) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.LogExclusion other) { + if (other == com.google.logging.v2.LogExclusion.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (other.getDisabled() != false) { + setDisabled(other.getDisabled()); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + filter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + disabled_ = input.readBool(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 42: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 50: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. A client-assigned identifier, such as
+     * `"load-balancer-exclusion"`. Identifiers are limited to 100 characters and
+     * can include only letters, digits, underscores, hyphens, and periods. First
+     * character has to be alphanumeric.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. A client-assigned identifier, such as
+     * `"load-balancer-exclusion"`. Identifiers are limited to 100 characters and
+     * can include only letters, digits, underscores, hyphens, and periods. First
+     * character has to be alphanumeric.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. A client-assigned identifier, such as
+     * `"load-balancer-exclusion"`. Identifiers are limited to 100 characters and
+     * can include only letters, digits, underscores, hyphens, and periods. First
+     * character has to be alphanumeric.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. A client-assigned identifier, such as
+     * `"load-balancer-exclusion"`. Identifiers are limited to 100 characters and
+     * can include only letters, digits, underscores, hyphens, and periods. First
+     * character has to be alphanumeric.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. A client-assigned identifier, such as
+     * `"load-balancer-exclusion"`. Identifiers are limited to 100 characters and
+     * can include only letters, digits, underscores, hyphens, and periods. First
+     * character has to be alphanumeric.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + + /** + * + * + *
+     * Optional. A description of this exclusion.
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. A description of this exclusion.
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for description. + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. A description of this exclusion.
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + description_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. A description of this exclusion.
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. A description of this exclusion.
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + description_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + + /** + * + * + *
+     * Required. An [advanced logs
+     * filter](https://cloud.google.com/logging/docs/view/advanced-queries) that
+     * matches the log entries to be excluded. By using the [sample
+     * function](https://cloud.google.com/logging/docs/view/advanced-queries#sample),
+     * you can exclude less than 100% of the matching log entries.
+     *
+     * For example, the following query matches 99% of low-severity log entries
+     * from Google Cloud Storage buckets:
+     *
+     *   `resource.type=gcs_bucket severity<ERROR sample(insertId, 0.99)`
+     * 
+ * + * string filter = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. An [advanced logs
+     * filter](https://cloud.google.com/logging/docs/view/advanced-queries) that
+     * matches the log entries to be excluded. By using the [sample
+     * function](https://cloud.google.com/logging/docs/view/advanced-queries#sample),
+     * you can exclude less than 100% of the matching log entries.
+     *
+     * For example, the following query matches 99% of low-severity log entries
+     * from Google Cloud Storage buckets:
+     *
+     *   `resource.type=gcs_bucket severity<ERROR sample(insertId, 0.99)`
+     * 
+ * + * string filter = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. An [advanced logs
+     * filter](https://cloud.google.com/logging/docs/view/advanced-queries) that
+     * matches the log entries to be excluded. By using the [sample
+     * function](https://cloud.google.com/logging/docs/view/advanced-queries#sample),
+     * you can exclude less than 100% of the matching log entries.
+     *
+     * For example, the following query matches 99% of low-severity log entries
+     * from Google Cloud Storage buckets:
+     *
+     *   `resource.type=gcs_bucket severity<ERROR sample(insertId, 0.99)`
+     * 
+ * + * string filter = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. An [advanced logs
+     * filter](https://cloud.google.com/logging/docs/view/advanced-queries) that
+     * matches the log entries to be excluded. By using the [sample
+     * function](https://cloud.google.com/logging/docs/view/advanced-queries#sample),
+     * you can exclude less than 100% of the matching log entries.
+     *
+     * For example, the following query matches 99% of low-severity log entries
+     * from Google Cloud Storage buckets:
+     *
+     *   `resource.type=gcs_bucket severity<ERROR sample(insertId, 0.99)`
+     * 
+ * + * string filter = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. An [advanced logs
+     * filter](https://cloud.google.com/logging/docs/view/advanced-queries) that
+     * matches the log entries to be excluded. By using the [sample
+     * function](https://cloud.google.com/logging/docs/view/advanced-queries#sample),
+     * you can exclude less than 100% of the matching log entries.
+     *
+     * For example, the following query matches 99% of low-severity log entries
+     * from Google Cloud Storage buckets:
+     *
+     *   `resource.type=gcs_bucket severity<ERROR sample(insertId, 0.99)`
+     * 
+ * + * string filter = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + filter_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private boolean disabled_; + + /** + * + * + *
+     * Optional. If set to True, then this exclusion is disabled and it does not
+     * exclude any log entries. You can [update an
+     * exclusion][google.logging.v2.ConfigServiceV2.UpdateExclusion] to change the
+     * value of this field.
+     * 
+ * + * bool disabled = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The disabled. + */ + @java.lang.Override + public boolean getDisabled() { + return disabled_; + } + + /** + * + * + *
+     * Optional. If set to True, then this exclusion is disabled and it does not
+     * exclude any log entries. You can [update an
+     * exclusion][google.logging.v2.ConfigServiceV2.UpdateExclusion] to change the
+     * value of this field.
+     * 
+ * + * bool disabled = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The disabled to set. + * @return This builder for chaining. + */ + public Builder setDisabled(boolean value) { + + disabled_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. If set to True, then this exclusion is disabled and it does not
+     * exclude any log entries. You can [update an
+     * exclusion][google.logging.v2.ConfigServiceV2.UpdateExclusion] to change the
+     * value of this field.
+     * 
+ * + * bool disabled = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDisabled() { + bitField0_ = (bitField0_ & ~0x00000008); + disabled_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + + /** + * + * + *
+     * Output only. The creation timestamp of the exclusion.
+     *
+     * This field may not be present for older exclusions.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * + *
+     * Output only. The creation timestamp of the exclusion.
+     *
+     * This field may not be present for older exclusions.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Output only. The creation timestamp of the exclusion.
+     *
+     * This field may not be present for older exclusions.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The creation timestamp of the exclusion.
+     *
+     * This field may not be present for older exclusions.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The creation timestamp of the exclusion.
+     *
+     * This field may not be present for older exclusions.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + if (createTime_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Output only. The creation timestamp of the exclusion.
+     *
+     * This field may not be present for older exclusions.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000010); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The creation timestamp of the exclusion.
+     *
+     * This field may not be present for older exclusions.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Output only. The creation timestamp of the exclusion.
+     *
+     * This field may not be present for older exclusions.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + + /** + * + * + *
+     * Output only. The creation timestamp of the exclusion.
+     *
+     * This field may not be present for older exclusions.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + + /** + * + * + *
+     * Output only. The last update timestamp of the exclusion.
+     *
+     * This field may not be present for older exclusions.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+     * Output only. The last update timestamp of the exclusion.
+     *
+     * This field may not be present for older exclusions.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Output only. The last update timestamp of the exclusion.
+     *
+     * This field may not be present for older exclusions.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + } else { + updateTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The last update timestamp of the exclusion.
+     *
+     * This field may not be present for older exclusions.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The last update timestamp of the exclusion.
+     *
+     * This field may not be present for older exclusions.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + if (updateTime_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Output only. The last update timestamp of the exclusion.
+     *
+     * This field may not be present for older exclusions.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + bitField0_ = (bitField0_ & ~0x00000020); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The last update timestamp of the exclusion.
+     *
+     * This field may not be present for older exclusions.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Output only. The last update timestamp of the exclusion.
+     *
+     * This field may not be present for older exclusions.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + + /** + * + * + *
+     * Output only. The last update timestamp of the exclusion.
+     *
+     * This field may not be present for older exclusions.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.logging.v2.LogExclusion) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.LogExclusion) + private static final com.google.logging.v2.LogExclusion DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.LogExclusion(); + } + + public static com.google.logging.v2.LogExclusion getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LogExclusion parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.LogExclusion getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogExclusionName.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogExclusionName.java new file mode 100644 index 000000000000..2e11790ee69a --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogExclusionName.java @@ -0,0 +1,443 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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.logging.v2; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.pathtemplate.ValidationException; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class LogExclusionName implements ResourceName { + private static final PathTemplate PROJECT_EXCLUSION = + PathTemplate.createWithoutUrlEncoding("projects/{project}/exclusions/{exclusion}"); + private static final PathTemplate ORGANIZATION_EXCLUSION = + PathTemplate.createWithoutUrlEncoding("organizations/{organization}/exclusions/{exclusion}"); + private static final PathTemplate FOLDER_EXCLUSION = + PathTemplate.createWithoutUrlEncoding("folders/{folder}/exclusions/{exclusion}"); + private static final PathTemplate BILLING_ACCOUNT_EXCLUSION = + PathTemplate.createWithoutUrlEncoding( + "billingAccounts/{billing_account}/exclusions/{exclusion}"); + private volatile Map fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; + private final String project; + private final String exclusion; + private final String organization; + private final String folder; + private final String billingAccount; + + @Deprecated + protected LogExclusionName() { + project = null; + exclusion = null; + organization = null; + folder = null; + billingAccount = null; + } + + private LogExclusionName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + exclusion = Preconditions.checkNotNull(builder.getExclusion()); + organization = null; + folder = null; + billingAccount = null; + pathTemplate = PROJECT_EXCLUSION; + } + + private LogExclusionName(OrganizationExclusionBuilder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + exclusion = Preconditions.checkNotNull(builder.getExclusion()); + project = null; + folder = null; + billingAccount = null; + pathTemplate = ORGANIZATION_EXCLUSION; + } + + private LogExclusionName(FolderExclusionBuilder builder) { + folder = Preconditions.checkNotNull(builder.getFolder()); + exclusion = Preconditions.checkNotNull(builder.getExclusion()); + project = null; + organization = null; + billingAccount = null; + pathTemplate = FOLDER_EXCLUSION; + } + + private LogExclusionName(BillingAccountExclusionBuilder builder) { + billingAccount = Preconditions.checkNotNull(builder.getBillingAccount()); + exclusion = Preconditions.checkNotNull(builder.getExclusion()); + project = null; + organization = null; + folder = null; + pathTemplate = BILLING_ACCOUNT_EXCLUSION; + } + + public String getProject() { + return project; + } + + public String getExclusion() { + return exclusion; + } + + public String getOrganization() { + return organization; + } + + public String getFolder() { + return folder; + } + + public String getBillingAccount() { + return billingAccount; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public static Builder newProjectExclusionBuilder() { + return new Builder(); + } + + public static OrganizationExclusionBuilder newOrganizationExclusionBuilder() { + return new OrganizationExclusionBuilder(); + } + + public static FolderExclusionBuilder newFolderExclusionBuilder() { + return new FolderExclusionBuilder(); + } + + public static BillingAccountExclusionBuilder newBillingAccountExclusionBuilder() { + return new BillingAccountExclusionBuilder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static LogExclusionName of(String project, String exclusion) { + return newBuilder().setProject(project).setExclusion(exclusion).build(); + } + + public static LogExclusionName ofProjectExclusionName(String project, String exclusion) { + return newBuilder().setProject(project).setExclusion(exclusion).build(); + } + + public static LogExclusionName ofOrganizationExclusionName( + String organization, String exclusion) { + return newOrganizationExclusionBuilder() + .setOrganization(organization) + .setExclusion(exclusion) + .build(); + } + + public static LogExclusionName ofFolderExclusionName(String folder, String exclusion) { + return newFolderExclusionBuilder().setFolder(folder).setExclusion(exclusion).build(); + } + + public static LogExclusionName ofBillingAccountExclusionName( + String billingAccount, String exclusion) { + return newBillingAccountExclusionBuilder() + .setBillingAccount(billingAccount) + .setExclusion(exclusion) + .build(); + } + + public static String format(String project, String exclusion) { + return newBuilder().setProject(project).setExclusion(exclusion).build().toString(); + } + + public static String formatProjectExclusionName(String project, String exclusion) { + return newBuilder().setProject(project).setExclusion(exclusion).build().toString(); + } + + public static String formatOrganizationExclusionName(String organization, String exclusion) { + return newOrganizationExclusionBuilder() + .setOrganization(organization) + .setExclusion(exclusion) + .build() + .toString(); + } + + public static String formatFolderExclusionName(String folder, String exclusion) { + return newFolderExclusionBuilder().setFolder(folder).setExclusion(exclusion).build().toString(); + } + + public static String formatBillingAccountExclusionName(String billingAccount, String exclusion) { + return newBillingAccountExclusionBuilder() + .setBillingAccount(billingAccount) + .setExclusion(exclusion) + .build() + .toString(); + } + + public static LogExclusionName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + if (PROJECT_EXCLUSION.matches(formattedString)) { + Map matchMap = PROJECT_EXCLUSION.match(formattedString); + return ofProjectExclusionName(matchMap.get("project"), matchMap.get("exclusion")); + } else if (ORGANIZATION_EXCLUSION.matches(formattedString)) { + Map matchMap = ORGANIZATION_EXCLUSION.match(formattedString); + return ofOrganizationExclusionName(matchMap.get("organization"), matchMap.get("exclusion")); + } else if (FOLDER_EXCLUSION.matches(formattedString)) { + Map matchMap = FOLDER_EXCLUSION.match(formattedString); + return ofFolderExclusionName(matchMap.get("folder"), matchMap.get("exclusion")); + } else if (BILLING_ACCOUNT_EXCLUSION.matches(formattedString)) { + Map matchMap = BILLING_ACCOUNT_EXCLUSION.match(formattedString); + return ofBillingAccountExclusionName( + matchMap.get("billing_account"), matchMap.get("exclusion")); + } + throw new ValidationException("LogExclusionName.parse: formattedString not in valid format"); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (LogExclusionName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_EXCLUSION.matches(formattedString) + || ORGANIZATION_EXCLUSION.matches(formattedString) + || FOLDER_EXCLUSION.matches(formattedString) + || BILLING_ACCOUNT_EXCLUSION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (exclusion != null) { + fieldMapBuilder.put("exclusion", exclusion); + } + if (organization != null) { + fieldMapBuilder.put("organization", organization); + } + if (folder != null) { + fieldMapBuilder.put("folder", folder); + } + if (billingAccount != null) { + fieldMapBuilder.put("billing_account", billingAccount); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + LogExclusionName that = ((LogExclusionName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.exclusion, that.exclusion) + && Objects.equals(this.organization, that.organization) + && Objects.equals(this.folder, that.folder) + && Objects.equals(this.billingAccount, that.billingAccount); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(fixedValue); + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(exclusion); + h *= 1000003; + h ^= Objects.hashCode(organization); + h *= 1000003; + h ^= Objects.hashCode(folder); + h *= 1000003; + h ^= Objects.hashCode(billingAccount); + return h; + } + + /** Builder for projects/{project}/exclusions/{exclusion}. */ + public static class Builder { + private String project; + private String exclusion; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getExclusion() { + return exclusion; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setExclusion(String exclusion) { + this.exclusion = exclusion; + return this; + } + + private Builder(LogExclusionName logExclusionName) { + Preconditions.checkArgument( + Objects.equals(logExclusionName.pathTemplate, PROJECT_EXCLUSION), + "toBuilder is only supported when LogExclusionName has the pattern of" + + " projects/{project}/exclusions/{exclusion}"); + this.project = logExclusionName.project; + this.exclusion = logExclusionName.exclusion; + } + + public LogExclusionName build() { + return new LogExclusionName(this); + } + } + + /** Builder for organizations/{organization}/exclusions/{exclusion}. */ + public static class OrganizationExclusionBuilder { + private String organization; + private String exclusion; + + protected OrganizationExclusionBuilder() {} + + public String getOrganization() { + return organization; + } + + public String getExclusion() { + return exclusion; + } + + public OrganizationExclusionBuilder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public OrganizationExclusionBuilder setExclusion(String exclusion) { + this.exclusion = exclusion; + return this; + } + + public LogExclusionName build() { + return new LogExclusionName(this); + } + } + + /** Builder for folders/{folder}/exclusions/{exclusion}. */ + public static class FolderExclusionBuilder { + private String folder; + private String exclusion; + + protected FolderExclusionBuilder() {} + + public String getFolder() { + return folder; + } + + public String getExclusion() { + return exclusion; + } + + public FolderExclusionBuilder setFolder(String folder) { + this.folder = folder; + return this; + } + + public FolderExclusionBuilder setExclusion(String exclusion) { + this.exclusion = exclusion; + return this; + } + + public LogExclusionName build() { + return new LogExclusionName(this); + } + } + + /** Builder for billingAccounts/{billing_account}/exclusions/{exclusion}. */ + public static class BillingAccountExclusionBuilder { + private String billingAccount; + private String exclusion; + + protected BillingAccountExclusionBuilder() {} + + public String getBillingAccount() { + return billingAccount; + } + + public String getExclusion() { + return exclusion; + } + + public BillingAccountExclusionBuilder setBillingAccount(String billingAccount) { + this.billingAccount = billingAccount; + return this; + } + + public BillingAccountExclusionBuilder setExclusion(String exclusion) { + this.exclusion = exclusion; + return this; + } + + public LogExclusionName build() { + return new LogExclusionName(this); + } + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogExclusionOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogExclusionOrBuilder.java new file mode 100644 index 000000000000..6923b361c547 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogExclusionOrBuilder.java @@ -0,0 +1,236 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface LogExclusionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.LogExclusion) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. A client-assigned identifier, such as
+   * `"load-balancer-exclusion"`. Identifiers are limited to 100 characters and
+   * can include only letters, digits, underscores, hyphens, and periods. First
+   * character has to be alphanumeric.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Required. A client-assigned identifier, such as
+   * `"load-balancer-exclusion"`. Identifiers are limited to 100 characters and
+   * can include only letters, digits, underscores, hyphens, and periods. First
+   * character has to be alphanumeric.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. A description of this exclusion.
+   * 
+ * + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The description. + */ + java.lang.String getDescription(); + + /** + * + * + *
+   * Optional. A description of this exclusion.
+   * 
+ * + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Required. An [advanced logs
+   * filter](https://cloud.google.com/logging/docs/view/advanced-queries) that
+   * matches the log entries to be excluded. By using the [sample
+   * function](https://cloud.google.com/logging/docs/view/advanced-queries#sample),
+   * you can exclude less than 100% of the matching log entries.
+   *
+   * For example, the following query matches 99% of low-severity log entries
+   * from Google Cloud Storage buckets:
+   *
+   *   `resource.type=gcs_bucket severity<ERROR sample(insertId, 0.99)`
+   * 
+ * + * string filter = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The filter. + */ + java.lang.String getFilter(); + + /** + * + * + *
+   * Required. An [advanced logs
+   * filter](https://cloud.google.com/logging/docs/view/advanced-queries) that
+   * matches the log entries to be excluded. By using the [sample
+   * function](https://cloud.google.com/logging/docs/view/advanced-queries#sample),
+   * you can exclude less than 100% of the matching log entries.
+   *
+   * For example, the following query matches 99% of low-severity log entries
+   * from Google Cloud Storage buckets:
+   *
+   *   `resource.type=gcs_bucket severity<ERROR sample(insertId, 0.99)`
+   * 
+ * + * string filter = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Optional. If set to True, then this exclusion is disabled and it does not
+   * exclude any log entries. You can [update an
+   * exclusion][google.logging.v2.ConfigServiceV2.UpdateExclusion] to change the
+   * value of this field.
+   * 
+ * + * bool disabled = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The disabled. + */ + boolean getDisabled(); + + /** + * + * + *
+   * Output only. The creation timestamp of the exclusion.
+   *
+   * This field may not be present for older exclusions.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + + /** + * + * + *
+   * Output only. The creation timestamp of the exclusion.
+   *
+   * This field may not be present for older exclusions.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + + /** + * + * + *
+   * Output only. The creation timestamp of the exclusion.
+   *
+   * This field may not be present for older exclusions.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The last update timestamp of the exclusion.
+   *
+   * This field may not be present for older exclusions.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + + /** + * + * + *
+   * Output only. The last update timestamp of the exclusion.
+   *
+   * This field may not be present for older exclusions.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + + /** + * + * + *
+   * Output only. The last update timestamp of the exclusion.
+   *
+   * This field may not be present for older exclusions.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogMetric.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogMetric.java new file mode 100644 index 000000000000..d006a5999631 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogMetric.java @@ -0,0 +1,4183 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_metrics.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * Describes a logs-based metric. The value of the metric is the number of log
+ * entries that match a logs filter in a given time interval.
+ *
+ * Logs-based metrics can also be used to extract values from logs and create a
+ * distribution of the values. The distribution records the statistics of the
+ * extracted values along with an optional histogram of the values as specified
+ * by the bucket options.
+ * 
+ * + * Protobuf type {@code google.logging.v2.LogMetric} + */ +public final class LogMetric extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.LogMetric) + LogMetricOrBuilder { + private static final long serialVersionUID = 0L; + + // Use LogMetric.newBuilder() to construct. + private LogMetric(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private LogMetric() { + name_ = ""; + description_ = ""; + filter_ = ""; + bucketName_ = ""; + valueExtractor_ = ""; + version_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new LogMetric(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingMetricsProto + .internal_static_google_logging_v2_LogMetric_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 7: + return internalGetLabelExtractors(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingMetricsProto + .internal_static_google_logging_v2_LogMetric_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.LogMetric.class, com.google.logging.v2.LogMetric.Builder.class); + } + + /** + * + * + *
+   * Logging API version.
+   * 
+ * + * Protobuf enum {@code google.logging.v2.LogMetric.ApiVersion} + */ + public enum ApiVersion implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Logging API v2.
+     * 
+ * + * V2 = 0; + */ + V2(0), + /** + * + * + *
+     * Logging API v1.
+     * 
+ * + * V1 = 1; + */ + V1(1), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Logging API v2.
+     * 
+ * + * V2 = 0; + */ + public static final int V2_VALUE = 0; + + /** + * + * + *
+     * Logging API v1.
+     * 
+ * + * V1 = 1; + */ + public static final int V1_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 ApiVersion 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 ApiVersion forNumber(int value) { + switch (value) { + case 0: + return V2; + case 1: + return V1; + 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 ApiVersion findValueByNumber(int number) { + return ApiVersion.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.logging.v2.LogMetric.getDescriptor().getEnumTypes().get(0); + } + + private static final ApiVersion[] VALUES = values(); + + public static ApiVersion 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 ApiVersion(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.logging.v2.LogMetric.ApiVersion) + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. The client-assigned metric identifier.
+   * Examples: `"error_count"`, `"nginx/requests"`.
+   *
+   * Metric identifiers are limited to 100 characters and can include only the
+   * following characters: `A-Z`, `a-z`, `0-9`, and the special characters
+   * `_-.,+!*',()%/`. The forward-slash character (`/`) denotes a hierarchy of
+   * name pieces, and it cannot be the first character of the name.
+   *
+   * This field is the `[METRIC_ID]` part of a metric resource name in the
+   * format "projects/[PROJECT_ID]/metrics/[METRIC_ID]". Example: If the
+   * resource name of a metric is
+   * `"projects/my-project/metrics/nginx%2Frequests"`, this field's value is
+   * `"nginx/requests"`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The client-assigned metric identifier.
+   * Examples: `"error_count"`, `"nginx/requests"`.
+   *
+   * Metric identifiers are limited to 100 characters and can include only the
+   * following characters: `A-Z`, `a-z`, `0-9`, and the special characters
+   * `_-.,+!*',()%/`. The forward-slash character (`/`) denotes a hierarchy of
+   * name pieces, and it cannot be the first character of the name.
+   *
+   * This field is the `[METRIC_ID]` part of a metric resource name in the
+   * format "projects/[PROJECT_ID]/metrics/[METRIC_ID]". Example: If the
+   * resource name of a metric is
+   * `"projects/my-project/metrics/nginx%2Frequests"`, this field's value is
+   * `"nginx/requests"`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + + /** + * + * + *
+   * Optional. A description of this metric, which is used in documentation.
+   * The maximum length of the description is 8000 characters.
+   * 
+ * + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. A description of this metric, which is used in documentation.
+   * The maximum length of the description is 8000 characters.
+   * 
+ * + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + + /** + * + * + *
+   * Required. An [advanced logs
+   * filter](https://cloud.google.com/logging/docs/view/advanced_filters) which
+   * is used to match log entries. Example:
+   *
+   *     "resource.type=gae_app AND severity>=ERROR"
+   *
+   * The maximum length of the filter is 20000 characters.
+   * 
+ * + * string filter = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. An [advanced logs
+   * filter](https://cloud.google.com/logging/docs/view/advanced_filters) which
+   * is used to match log entries. Example:
+   *
+   *     "resource.type=gae_app AND severity>=ERROR"
+   *
+   * The maximum length of the filter is 20000 characters.
+   * 
+ * + * string filter = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BUCKET_NAME_FIELD_NUMBER = 13; + + @SuppressWarnings("serial") + private volatile java.lang.Object bucketName_ = ""; + + /** + * + * + *
+   * Optional. The resource name of the Log Bucket that owns the Log Metric.
+   * Only Log Buckets in projects are supported. The bucket has to be in the
+   * same project as the metric.
+   *
+   * For example:
+   *
+   *   `projects/my-project/locations/global/buckets/my-bucket`
+   *
+   * If empty, then the Log Metric is considered a non-Bucket Log Metric.
+   * 
+ * + * string bucket_name = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bucketName. + */ + @java.lang.Override + public java.lang.String getBucketName() { + java.lang.Object ref = bucketName_; + 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(); + bucketName_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The resource name of the Log Bucket that owns the Log Metric.
+   * Only Log Buckets in projects are supported. The bucket has to be in the
+   * same project as the metric.
+   *
+   * For example:
+   *
+   *   `projects/my-project/locations/global/buckets/my-bucket`
+   *
+   * If empty, then the Log Metric is considered a non-Bucket Log Metric.
+   * 
+ * + * string bucket_name = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for bucketName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBucketNameBytes() { + java.lang.Object ref = bucketName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + bucketName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISABLED_FIELD_NUMBER = 12; + private boolean disabled_ = false; + + /** + * + * + *
+   * Optional. If set to True, then this metric is disabled and it does not
+   * generate any points.
+   * 
+ * + * bool disabled = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The disabled. + */ + @java.lang.Override + public boolean getDisabled() { + return disabled_; + } + + public static final int METRIC_DESCRIPTOR_FIELD_NUMBER = 5; + private com.google.api.MetricDescriptor metricDescriptor_; + + /** + * + * + *
+   * Optional. The metric descriptor associated with the logs-based metric.
+   * If unspecified, it uses a default metric descriptor with a DELTA metric
+   * kind, INT64 value type, with no labels and a unit of "1". Such a metric
+   * counts the number of log entries matching the `filter` expression.
+   *
+   * The `name`, `type`, and `description` fields in the `metric_descriptor`
+   * are output only, and is constructed using the `name` and `description`
+   * field in the LogMetric.
+   *
+   * To create a logs-based metric that records a distribution of log values, a
+   * DELTA metric kind with a DISTRIBUTION value type must be used along with
+   * a `value_extractor` expression in the LogMetric.
+   *
+   * Each label in the metric descriptor must have a matching label
+   * name as the key and an extractor expression as the value in the
+   * `label_extractors` map.
+   *
+   * The `metric_kind` and `value_type` fields in the `metric_descriptor` cannot
+   * be updated once initially configured. New labels can be added in the
+   * `metric_descriptor`, but existing labels cannot be modified except for
+   * their description.
+   * 
+ * + * + * .google.api.MetricDescriptor metric_descriptor = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the metricDescriptor field is set. + */ + @java.lang.Override + public boolean hasMetricDescriptor() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Optional. The metric descriptor associated with the logs-based metric.
+   * If unspecified, it uses a default metric descriptor with a DELTA metric
+   * kind, INT64 value type, with no labels and a unit of "1". Such a metric
+   * counts the number of log entries matching the `filter` expression.
+   *
+   * The `name`, `type`, and `description` fields in the `metric_descriptor`
+   * are output only, and is constructed using the `name` and `description`
+   * field in the LogMetric.
+   *
+   * To create a logs-based metric that records a distribution of log values, a
+   * DELTA metric kind with a DISTRIBUTION value type must be used along with
+   * a `value_extractor` expression in the LogMetric.
+   *
+   * Each label in the metric descriptor must have a matching label
+   * name as the key and an extractor expression as the value in the
+   * `label_extractors` map.
+   *
+   * The `metric_kind` and `value_type` fields in the `metric_descriptor` cannot
+   * be updated once initially configured. New labels can be added in the
+   * `metric_descriptor`, but existing labels cannot be modified except for
+   * their description.
+   * 
+ * + * + * .google.api.MetricDescriptor metric_descriptor = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The metricDescriptor. + */ + @java.lang.Override + public com.google.api.MetricDescriptor getMetricDescriptor() { + return metricDescriptor_ == null + ? com.google.api.MetricDescriptor.getDefaultInstance() + : metricDescriptor_; + } + + /** + * + * + *
+   * Optional. The metric descriptor associated with the logs-based metric.
+   * If unspecified, it uses a default metric descriptor with a DELTA metric
+   * kind, INT64 value type, with no labels and a unit of "1". Such a metric
+   * counts the number of log entries matching the `filter` expression.
+   *
+   * The `name`, `type`, and `description` fields in the `metric_descriptor`
+   * are output only, and is constructed using the `name` and `description`
+   * field in the LogMetric.
+   *
+   * To create a logs-based metric that records a distribution of log values, a
+   * DELTA metric kind with a DISTRIBUTION value type must be used along with
+   * a `value_extractor` expression in the LogMetric.
+   *
+   * Each label in the metric descriptor must have a matching label
+   * name as the key and an extractor expression as the value in the
+   * `label_extractors` map.
+   *
+   * The `metric_kind` and `value_type` fields in the `metric_descriptor` cannot
+   * be updated once initially configured. New labels can be added in the
+   * `metric_descriptor`, but existing labels cannot be modified except for
+   * their description.
+   * 
+ * + * + * .google.api.MetricDescriptor metric_descriptor = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.api.MetricDescriptorOrBuilder getMetricDescriptorOrBuilder() { + return metricDescriptor_ == null + ? com.google.api.MetricDescriptor.getDefaultInstance() + : metricDescriptor_; + } + + public static final int VALUE_EXTRACTOR_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object valueExtractor_ = ""; + + /** + * + * + *
+   * Optional. A `value_extractor` is required when using a distribution
+   * logs-based metric to extract the values to record from a log entry.
+   * Two functions are supported for value extraction: `EXTRACT(field)` or
+   * `REGEXP_EXTRACT(field, regex)`. The arguments are:
+   *
+   *   1. field: The name of the log entry field from which the value is to be
+   *      extracted.
+   *   2. regex: A regular expression using the Google RE2 syntax
+   *      (https://github.com/google/re2/wiki/Syntax) with a single capture
+   *      group to extract data from the specified log entry field. The value
+   *      of the field is converted to a string before applying the regex.
+   *      It is an error to specify a regex that does not include exactly one
+   *      capture group.
+   *
+   * The result of the extraction must be convertible to a double type, as the
+   * distribution always records double values. If either the extraction or
+   * the conversion to double fails, then those values are not recorded in the
+   * distribution.
+   *
+   * Example: `REGEXP_EXTRACT(jsonPayload.request, ".*quantity=(\d+).*")`
+   * 
+ * + * string value_extractor = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The valueExtractor. + */ + @java.lang.Override + public java.lang.String getValueExtractor() { + java.lang.Object ref = valueExtractor_; + 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(); + valueExtractor_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. A `value_extractor` is required when using a distribution
+   * logs-based metric to extract the values to record from a log entry.
+   * Two functions are supported for value extraction: `EXTRACT(field)` or
+   * `REGEXP_EXTRACT(field, regex)`. The arguments are:
+   *
+   *   1. field: The name of the log entry field from which the value is to be
+   *      extracted.
+   *   2. regex: A regular expression using the Google RE2 syntax
+   *      (https://github.com/google/re2/wiki/Syntax) with a single capture
+   *      group to extract data from the specified log entry field. The value
+   *      of the field is converted to a string before applying the regex.
+   *      It is an error to specify a regex that does not include exactly one
+   *      capture group.
+   *
+   * The result of the extraction must be convertible to a double type, as the
+   * distribution always records double values. If either the extraction or
+   * the conversion to double fails, then those values are not recorded in the
+   * distribution.
+   *
+   * Example: `REGEXP_EXTRACT(jsonPayload.request, ".*quantity=(\d+).*")`
+   * 
+ * + * string value_extractor = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for valueExtractor. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValueExtractorBytes() { + java.lang.Object ref = valueExtractor_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + valueExtractor_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LABEL_EXTRACTORS_FIELD_NUMBER = 7; + + private static final class LabelExtractorsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.logging.v2.LoggingMetricsProto + .internal_static_google_logging_v2_LogMetric_LabelExtractorsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField labelExtractors_; + + private com.google.protobuf.MapField + internalGetLabelExtractors() { + if (labelExtractors_ == null) { + return com.google.protobuf.MapField.emptyMapField( + LabelExtractorsDefaultEntryHolder.defaultEntry); + } + return labelExtractors_; + } + + public int getLabelExtractorsCount() { + return internalGetLabelExtractors().getMap().size(); + } + + /** + * + * + *
+   * Optional. A map from a label key string to an extractor expression which is
+   * used to extract data from a log entry field and assign as the label value.
+   * Each label key specified in the LabelDescriptor must have an associated
+   * extractor expression in this map. The syntax of the extractor expression
+   * is the same as for the `value_extractor` field.
+   *
+   * The extracted value is converted to the type defined in the label
+   * descriptor. If either the extraction or the type conversion fails,
+   * the label will have a default value. The default value for a string
+   * label is an empty string, for an integer label its 0, and for a boolean
+   * label its `false`.
+   *
+   * Note that there are upper bounds on the maximum number of labels and the
+   * number of active time series that are allowed in a project.
+   * 
+ * + * map<string, string> label_extractors = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsLabelExtractors(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabelExtractors().getMap().containsKey(key); + } + + /** Use {@link #getLabelExtractorsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabelExtractors() { + return getLabelExtractorsMap(); + } + + /** + * + * + *
+   * Optional. A map from a label key string to an extractor expression which is
+   * used to extract data from a log entry field and assign as the label value.
+   * Each label key specified in the LabelDescriptor must have an associated
+   * extractor expression in this map. The syntax of the extractor expression
+   * is the same as for the `value_extractor` field.
+   *
+   * The extracted value is converted to the type defined in the label
+   * descriptor. If either the extraction or the type conversion fails,
+   * the label will have a default value. The default value for a string
+   * label is an empty string, for an integer label its 0, and for a boolean
+   * label its `false`.
+   *
+   * Note that there are upper bounds on the maximum number of labels and the
+   * number of active time series that are allowed in a project.
+   * 
+ * + * map<string, string> label_extractors = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map getLabelExtractorsMap() { + return internalGetLabelExtractors().getMap(); + } + + /** + * + * + *
+   * Optional. A map from a label key string to an extractor expression which is
+   * used to extract data from a log entry field and assign as the label value.
+   * Each label key specified in the LabelDescriptor must have an associated
+   * extractor expression in this map. The syntax of the extractor expression
+   * is the same as for the `value_extractor` field.
+   *
+   * The extracted value is converted to the type defined in the label
+   * descriptor. If either the extraction or the type conversion fails,
+   * the label will have a default value. The default value for a string
+   * label is an empty string, for an integer label its 0, and for a boolean
+   * label its `false`.
+   *
+   * Note that there are upper bounds on the maximum number of labels and the
+   * number of active time series that are allowed in a project.
+   * 
+ * + * map<string, string> label_extractors = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public /* nullable */ java.lang.String getLabelExtractorsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabelExtractors().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * + * + *
+   * Optional. A map from a label key string to an extractor expression which is
+   * used to extract data from a log entry field and assign as the label value.
+   * Each label key specified in the LabelDescriptor must have an associated
+   * extractor expression in this map. The syntax of the extractor expression
+   * is the same as for the `value_extractor` field.
+   *
+   * The extracted value is converted to the type defined in the label
+   * descriptor. If either the extraction or the type conversion fails,
+   * the label will have a default value. The default value for a string
+   * label is an empty string, for an integer label its 0, and for a boolean
+   * label its `false`.
+   *
+   * Note that there are upper bounds on the maximum number of labels and the
+   * number of active time series that are allowed in a project.
+   * 
+ * + * map<string, string> label_extractors = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.lang.String getLabelExtractorsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabelExtractors().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int BUCKET_OPTIONS_FIELD_NUMBER = 8; + private com.google.api.Distribution.BucketOptions bucketOptions_; + + /** + * + * + *
+   * Optional. The `bucket_options` are required when the logs-based metric is
+   * using a DISTRIBUTION value type and it describes the bucket boundaries
+   * used to create a histogram of the extracted values.
+   * 
+ * + * + * .google.api.Distribution.BucketOptions bucket_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the bucketOptions field is set. + */ + @java.lang.Override + public boolean hasBucketOptions() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Optional. The `bucket_options` are required when the logs-based metric is
+   * using a DISTRIBUTION value type and it describes the bucket boundaries
+   * used to create a histogram of the extracted values.
+   * 
+ * + * + * .google.api.Distribution.BucketOptions bucket_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The bucketOptions. + */ + @java.lang.Override + public com.google.api.Distribution.BucketOptions getBucketOptions() { + return bucketOptions_ == null + ? com.google.api.Distribution.BucketOptions.getDefaultInstance() + : bucketOptions_; + } + + /** + * + * + *
+   * Optional. The `bucket_options` are required when the logs-based metric is
+   * using a DISTRIBUTION value type and it describes the bucket boundaries
+   * used to create a histogram of the extracted values.
+   * 
+ * + * + * .google.api.Distribution.BucketOptions bucket_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.api.Distribution.BucketOptionsOrBuilder getBucketOptionsOrBuilder() { + return bucketOptions_ == null + ? com.google.api.Distribution.BucketOptions.getDefaultInstance() + : bucketOptions_; + } + + public static final int CREATE_TIME_FIELD_NUMBER = 9; + private com.google.protobuf.Timestamp createTime_; + + /** + * + * + *
+   * Output only. The creation timestamp of the metric.
+   *
+   * This field may not be present for older metrics.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+   * Output only. The creation timestamp of the metric.
+   *
+   * This field may not be present for older metrics.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + /** + * + * + *
+   * Output only. The creation timestamp of the metric.
+   *
+   * This field may not be present for older metrics.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 10; + private com.google.protobuf.Timestamp updateTime_; + + /** + * + * + *
+   * Output only. The last update timestamp of the metric.
+   *
+   * This field may not be present for older metrics.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+   * Output only. The last update timestamp of the metric.
+   *
+   * This field may not be present for older metrics.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + /** + * + * + *
+   * Output only. The last update timestamp of the metric.
+   *
+   * This field may not be present for older metrics.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + public static final int VERSION_FIELD_NUMBER = 4; + private int version_ = 0; + + /** + * + * + *
+   * Deprecated. The API version that created or updated this metric.
+   * The v2 format is used by default and cannot be changed.
+   * 
+ * + * .google.logging.v2.LogMetric.ApiVersion version = 4 [deprecated = true]; + * + * @deprecated google.logging.v2.LogMetric.version is deprecated. See + * google/logging/v2/logging_metrics.proto;l=237 + * @return The enum numeric value on the wire for version. + */ + @java.lang.Override + @java.lang.Deprecated + public int getVersionValue() { + return version_; + } + + /** + * + * + *
+   * Deprecated. The API version that created or updated this metric.
+   * The v2 format is used by default and cannot be changed.
+   * 
+ * + * .google.logging.v2.LogMetric.ApiVersion version = 4 [deprecated = true]; + * + * @deprecated google.logging.v2.LogMetric.version is deprecated. See + * google/logging/v2/logging_metrics.proto;l=237 + * @return The version. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.logging.v2.LogMetric.ApiVersion getVersion() { + com.google.logging.v2.LogMetric.ApiVersion result = + com.google.logging.v2.LogMetric.ApiVersion.forNumber(version_); + return result == null ? com.google.logging.v2.LogMetric.ApiVersion.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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, description_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, filter_); + } + if (version_ != com.google.logging.v2.LogMetric.ApiVersion.V2.getNumber()) { + output.writeEnum(4, version_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(5, getMetricDescriptor()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(valueExtractor_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, valueExtractor_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabelExtractors(), LabelExtractorsDefaultEntryHolder.defaultEntry, 7); + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(8, getBucketOptions()); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(9, getCreateTime()); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeMessage(10, getUpdateTime()); + } + if (disabled_ != false) { + output.writeBool(12, disabled_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(bucketName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 13, bucketName_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, description_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, filter_); + } + if (version_ != com.google.logging.v2.LogMetric.ApiVersion.V2.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, version_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getMetricDescriptor()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(valueExtractor_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, valueExtractor_); + } + for (java.util.Map.Entry entry : + internalGetLabelExtractors().getMap().entrySet()) { + com.google.protobuf.MapEntry labelExtractors__ = + LabelExtractorsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, labelExtractors__); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getBucketOptions()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getCreateTime()); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getUpdateTime()); + } + if (disabled_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(12, disabled_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(bucketName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(13, bucketName_); + } + size += getUnknownFields().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.logging.v2.LogMetric)) { + return super.equals(obj); + } + com.google.logging.v2.LogMetric other = (com.google.logging.v2.LogMetric) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getBucketName().equals(other.getBucketName())) return false; + if (getDisabled() != other.getDisabled()) return false; + if (hasMetricDescriptor() != other.hasMetricDescriptor()) return false; + if (hasMetricDescriptor()) { + if (!getMetricDescriptor().equals(other.getMetricDescriptor())) return false; + } + if (!getValueExtractor().equals(other.getValueExtractor())) return false; + if (!internalGetLabelExtractors().equals(other.internalGetLabelExtractors())) return false; + if (hasBucketOptions() != other.hasBucketOptions()) return false; + if (hasBucketOptions()) { + if (!getBucketOptions().equals(other.getBucketOptions())) return false; + } + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (version_ != other.version_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + BUCKET_NAME_FIELD_NUMBER; + hash = (53 * hash) + getBucketName().hashCode(); + hash = (37 * hash) + DISABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDisabled()); + if (hasMetricDescriptor()) { + hash = (37 * hash) + METRIC_DESCRIPTOR_FIELD_NUMBER; + hash = (53 * hash) + getMetricDescriptor().hashCode(); + } + hash = (37 * hash) + VALUE_EXTRACTOR_FIELD_NUMBER; + hash = (53 * hash) + getValueExtractor().hashCode(); + if (!internalGetLabelExtractors().getMap().isEmpty()) { + hash = (37 * hash) + LABEL_EXTRACTORS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabelExtractors().hashCode(); + } + if (hasBucketOptions()) { + hash = (37 * hash) + BUCKET_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getBucketOptions().hashCode(); + } + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + hash = (37 * hash) + VERSION_FIELD_NUMBER; + hash = (53 * hash) + version_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.LogMetric parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.LogMetric parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.LogMetric parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.LogMetric 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.logging.v2.LogMetric parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.LogMetric parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.LogMetric parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.LogMetric 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.logging.v2.LogMetric parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.LogMetric 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.logging.v2.LogMetric parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.LogMetric 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.logging.v2.LogMetric 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; + } + + /** + * + * + *
+   * Describes a logs-based metric. The value of the metric is the number of log
+   * entries that match a logs filter in a given time interval.
+   *
+   * Logs-based metrics can also be used to extract values from logs and create a
+   * distribution of the values. The distribution records the statistics of the
+   * extracted values along with an optional histogram of the values as specified
+   * by the bucket options.
+   * 
+ * + * Protobuf type {@code google.logging.v2.LogMetric} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.LogMetric) + com.google.logging.v2.LogMetricOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingMetricsProto + .internal_static_google_logging_v2_LogMetric_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 7: + return internalGetLabelExtractors(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 7: + return internalGetMutableLabelExtractors(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingMetricsProto + .internal_static_google_logging_v2_LogMetric_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.LogMetric.class, com.google.logging.v2.LogMetric.Builder.class); + } + + // Construct using com.google.logging.v2.LogMetric.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getMetricDescriptorFieldBuilder(); + getBucketOptionsFieldBuilder(); + getCreateTimeFieldBuilder(); + getUpdateTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + description_ = ""; + filter_ = ""; + bucketName_ = ""; + disabled_ = false; + metricDescriptor_ = null; + if (metricDescriptorBuilder_ != null) { + metricDescriptorBuilder_.dispose(); + metricDescriptorBuilder_ = null; + } + valueExtractor_ = ""; + internalGetMutableLabelExtractors().clear(); + bucketOptions_ = null; + if (bucketOptionsBuilder_ != null) { + bucketOptionsBuilder_.dispose(); + bucketOptionsBuilder_ = null; + } + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + version_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingMetricsProto + .internal_static_google_logging_v2_LogMetric_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.LogMetric getDefaultInstanceForType() { + return com.google.logging.v2.LogMetric.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.LogMetric build() { + com.google.logging.v2.LogMetric result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.LogMetric buildPartial() { + com.google.logging.v2.LogMetric result = new com.google.logging.v2.LogMetric(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.logging.v2.LogMetric result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.description_ = description_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.filter_ = filter_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.bucketName_ = bucketName_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.disabled_ = disabled_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000020) != 0)) { + result.metricDescriptor_ = + metricDescriptorBuilder_ == null ? metricDescriptor_ : metricDescriptorBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.valueExtractor_ = valueExtractor_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.labelExtractors_ = internalGetLabelExtractors(); + result.labelExtractors_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.bucketOptions_ = + bucketOptionsBuilder_ == null ? bucketOptions_ : bucketOptionsBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.version_ = version_; + } + result.bitField0_ |= to_bitField0_; + } + + @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.logging.v2.LogMetric) { + return mergeFrom((com.google.logging.v2.LogMetric) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.LogMetric other) { + if (other == com.google.logging.v2.LogMetric.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getBucketName().isEmpty()) { + bucketName_ = other.bucketName_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.getDisabled() != false) { + setDisabled(other.getDisabled()); + } + if (other.hasMetricDescriptor()) { + mergeMetricDescriptor(other.getMetricDescriptor()); + } + if (!other.getValueExtractor().isEmpty()) { + valueExtractor_ = other.valueExtractor_; + bitField0_ |= 0x00000040; + onChanged(); + } + internalGetMutableLabelExtractors().mergeFrom(other.internalGetLabelExtractors()); + bitField0_ |= 0x00000080; + if (other.hasBucketOptions()) { + mergeBucketOptions(other.getBucketOptions()); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (other.version_ != 0) { + setVersionValue(other.getVersionValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + filter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 32: + { + version_ = input.readEnum(); + bitField0_ |= 0x00000800; + break; + } // case 32 + case 42: + { + input.readMessage( + getMetricDescriptorFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 42 + case 50: + { + valueExtractor_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 50 + case 58: + { + com.google.protobuf.MapEntry labelExtractors__ = + input.readMessage( + LabelExtractorsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableLabelExtractors() + .getMutableMap() + .put(labelExtractors__.getKey(), labelExtractors__.getValue()); + bitField0_ |= 0x00000080; + break; + } // case 58 + case 66: + { + input.readMessage(getBucketOptionsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000100; + break; + } // case 66 + case 74: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000200; + break; + } // case 74 + case 82: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000400; + break; + } // case 82 + case 96: + { + disabled_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 96 + case 106: + { + bucketName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 106 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. The client-assigned metric identifier.
+     * Examples: `"error_count"`, `"nginx/requests"`.
+     *
+     * Metric identifiers are limited to 100 characters and can include only the
+     * following characters: `A-Z`, `a-z`, `0-9`, and the special characters
+     * `_-.,+!*',()%/`. The forward-slash character (`/`) denotes a hierarchy of
+     * name pieces, and it cannot be the first character of the name.
+     *
+     * This field is the `[METRIC_ID]` part of a metric resource name in the
+     * format "projects/[PROJECT_ID]/metrics/[METRIC_ID]". Example: If the
+     * resource name of a metric is
+     * `"projects/my-project/metrics/nginx%2Frequests"`, this field's value is
+     * `"nginx/requests"`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The client-assigned metric identifier.
+     * Examples: `"error_count"`, `"nginx/requests"`.
+     *
+     * Metric identifiers are limited to 100 characters and can include only the
+     * following characters: `A-Z`, `a-z`, `0-9`, and the special characters
+     * `_-.,+!*',()%/`. The forward-slash character (`/`) denotes a hierarchy of
+     * name pieces, and it cannot be the first character of the name.
+     *
+     * This field is the `[METRIC_ID]` part of a metric resource name in the
+     * format "projects/[PROJECT_ID]/metrics/[METRIC_ID]". Example: If the
+     * resource name of a metric is
+     * `"projects/my-project/metrics/nginx%2Frequests"`, this field's value is
+     * `"nginx/requests"`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The client-assigned metric identifier.
+     * Examples: `"error_count"`, `"nginx/requests"`.
+     *
+     * Metric identifiers are limited to 100 characters and can include only the
+     * following characters: `A-Z`, `a-z`, `0-9`, and the special characters
+     * `_-.,+!*',()%/`. The forward-slash character (`/`) denotes a hierarchy of
+     * name pieces, and it cannot be the first character of the name.
+     *
+     * This field is the `[METRIC_ID]` part of a metric resource name in the
+     * format "projects/[PROJECT_ID]/metrics/[METRIC_ID]". Example: If the
+     * resource name of a metric is
+     * `"projects/my-project/metrics/nginx%2Frequests"`, this field's value is
+     * `"nginx/requests"`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The client-assigned metric identifier.
+     * Examples: `"error_count"`, `"nginx/requests"`.
+     *
+     * Metric identifiers are limited to 100 characters and can include only the
+     * following characters: `A-Z`, `a-z`, `0-9`, and the special characters
+     * `_-.,+!*',()%/`. The forward-slash character (`/`) denotes a hierarchy of
+     * name pieces, and it cannot be the first character of the name.
+     *
+     * This field is the `[METRIC_ID]` part of a metric resource name in the
+     * format "projects/[PROJECT_ID]/metrics/[METRIC_ID]". Example: If the
+     * resource name of a metric is
+     * `"projects/my-project/metrics/nginx%2Frequests"`, this field's value is
+     * `"nginx/requests"`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The client-assigned metric identifier.
+     * Examples: `"error_count"`, `"nginx/requests"`.
+     *
+     * Metric identifiers are limited to 100 characters and can include only the
+     * following characters: `A-Z`, `a-z`, `0-9`, and the special characters
+     * `_-.,+!*',()%/`. The forward-slash character (`/`) denotes a hierarchy of
+     * name pieces, and it cannot be the first character of the name.
+     *
+     * This field is the `[METRIC_ID]` part of a metric resource name in the
+     * format "projects/[PROJECT_ID]/metrics/[METRIC_ID]". Example: If the
+     * resource name of a metric is
+     * `"projects/my-project/metrics/nginx%2Frequests"`, this field's value is
+     * `"nginx/requests"`.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + + /** + * + * + *
+     * Optional. A description of this metric, which is used in documentation.
+     * The maximum length of the description is 8000 characters.
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. A description of this metric, which is used in documentation.
+     * The maximum length of the description is 8000 characters.
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for description. + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. A description of this metric, which is used in documentation.
+     * The maximum length of the description is 8000 characters.
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + description_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. A description of this metric, which is used in documentation.
+     * The maximum length of the description is 8000 characters.
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. A description of this metric, which is used in documentation.
+     * The maximum length of the description is 8000 characters.
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + description_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + + /** + * + * + *
+     * Required. An [advanced logs
+     * filter](https://cloud.google.com/logging/docs/view/advanced_filters) which
+     * is used to match log entries. Example:
+     *
+     *     "resource.type=gae_app AND severity>=ERROR"
+     *
+     * The maximum length of the filter is 20000 characters.
+     * 
+ * + * string filter = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. An [advanced logs
+     * filter](https://cloud.google.com/logging/docs/view/advanced_filters) which
+     * is used to match log entries. Example:
+     *
+     *     "resource.type=gae_app AND severity>=ERROR"
+     *
+     * The maximum length of the filter is 20000 characters.
+     * 
+ * + * string filter = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. An [advanced logs
+     * filter](https://cloud.google.com/logging/docs/view/advanced_filters) which
+     * is used to match log entries. Example:
+     *
+     *     "resource.type=gae_app AND severity>=ERROR"
+     *
+     * The maximum length of the filter is 20000 characters.
+     * 
+ * + * string filter = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. An [advanced logs
+     * filter](https://cloud.google.com/logging/docs/view/advanced_filters) which
+     * is used to match log entries. Example:
+     *
+     *     "resource.type=gae_app AND severity>=ERROR"
+     *
+     * The maximum length of the filter is 20000 characters.
+     * 
+ * + * string filter = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. An [advanced logs
+     * filter](https://cloud.google.com/logging/docs/view/advanced_filters) which
+     * is used to match log entries. Example:
+     *
+     *     "resource.type=gae_app AND severity>=ERROR"
+     *
+     * The maximum length of the filter is 20000 characters.
+     * 
+ * + * string filter = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + filter_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object bucketName_ = ""; + + /** + * + * + *
+     * Optional. The resource name of the Log Bucket that owns the Log Metric.
+     * Only Log Buckets in projects are supported. The bucket has to be in the
+     * same project as the metric.
+     *
+     * For example:
+     *
+     *   `projects/my-project/locations/global/buckets/my-bucket`
+     *
+     * If empty, then the Log Metric is considered a non-Bucket Log Metric.
+     * 
+ * + * string bucket_name = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bucketName. + */ + public java.lang.String getBucketName() { + java.lang.Object ref = bucketName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + bucketName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The resource name of the Log Bucket that owns the Log Metric.
+     * Only Log Buckets in projects are supported. The bucket has to be in the
+     * same project as the metric.
+     *
+     * For example:
+     *
+     *   `projects/my-project/locations/global/buckets/my-bucket`
+     *
+     * If empty, then the Log Metric is considered a non-Bucket Log Metric.
+     * 
+ * + * string bucket_name = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for bucketName. + */ + public com.google.protobuf.ByteString getBucketNameBytes() { + java.lang.Object ref = bucketName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + bucketName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The resource name of the Log Bucket that owns the Log Metric.
+     * Only Log Buckets in projects are supported. The bucket has to be in the
+     * same project as the metric.
+     *
+     * For example:
+     *
+     *   `projects/my-project/locations/global/buckets/my-bucket`
+     *
+     * If empty, then the Log Metric is considered a non-Bucket Log Metric.
+     * 
+ * + * string bucket_name = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bucketName to set. + * @return This builder for chaining. + */ + public Builder setBucketName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bucketName_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The resource name of the Log Bucket that owns the Log Metric.
+     * Only Log Buckets in projects are supported. The bucket has to be in the
+     * same project as the metric.
+     *
+     * For example:
+     *
+     *   `projects/my-project/locations/global/buckets/my-bucket`
+     *
+     * If empty, then the Log Metric is considered a non-Bucket Log Metric.
+     * 
+ * + * string bucket_name = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearBucketName() { + bucketName_ = getDefaultInstance().getBucketName(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The resource name of the Log Bucket that owns the Log Metric.
+     * Only Log Buckets in projects are supported. The bucket has to be in the
+     * same project as the metric.
+     *
+     * For example:
+     *
+     *   `projects/my-project/locations/global/buckets/my-bucket`
+     *
+     * If empty, then the Log Metric is considered a non-Bucket Log Metric.
+     * 
+ * + * string bucket_name = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for bucketName to set. + * @return This builder for chaining. + */ + public Builder setBucketNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + bucketName_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private boolean disabled_; + + /** + * + * + *
+     * Optional. If set to True, then this metric is disabled and it does not
+     * generate any points.
+     * 
+ * + * bool disabled = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The disabled. + */ + @java.lang.Override + public boolean getDisabled() { + return disabled_; + } + + /** + * + * + *
+     * Optional. If set to True, then this metric is disabled and it does not
+     * generate any points.
+     * 
+ * + * bool disabled = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The disabled to set. + * @return This builder for chaining. + */ + public Builder setDisabled(boolean value) { + + disabled_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. If set to True, then this metric is disabled and it does not
+     * generate any points.
+     * 
+ * + * bool disabled = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDisabled() { + bitField0_ = (bitField0_ & ~0x00000010); + disabled_ = false; + onChanged(); + return this; + } + + private com.google.api.MetricDescriptor metricDescriptor_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.MetricDescriptor, + com.google.api.MetricDescriptor.Builder, + com.google.api.MetricDescriptorOrBuilder> + metricDescriptorBuilder_; + + /** + * + * + *
+     * Optional. The metric descriptor associated with the logs-based metric.
+     * If unspecified, it uses a default metric descriptor with a DELTA metric
+     * kind, INT64 value type, with no labels and a unit of "1". Such a metric
+     * counts the number of log entries matching the `filter` expression.
+     *
+     * The `name`, `type`, and `description` fields in the `metric_descriptor`
+     * are output only, and is constructed using the `name` and `description`
+     * field in the LogMetric.
+     *
+     * To create a logs-based metric that records a distribution of log values, a
+     * DELTA metric kind with a DISTRIBUTION value type must be used along with
+     * a `value_extractor` expression in the LogMetric.
+     *
+     * Each label in the metric descriptor must have a matching label
+     * name as the key and an extractor expression as the value in the
+     * `label_extractors` map.
+     *
+     * The `metric_kind` and `value_type` fields in the `metric_descriptor` cannot
+     * be updated once initially configured. New labels can be added in the
+     * `metric_descriptor`, but existing labels cannot be modified except for
+     * their description.
+     * 
+ * + * + * .google.api.MetricDescriptor metric_descriptor = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the metricDescriptor field is set. + */ + public boolean hasMetricDescriptor() { + return ((bitField0_ & 0x00000020) != 0); + } + + /** + * + * + *
+     * Optional. The metric descriptor associated with the logs-based metric.
+     * If unspecified, it uses a default metric descriptor with a DELTA metric
+     * kind, INT64 value type, with no labels and a unit of "1". Such a metric
+     * counts the number of log entries matching the `filter` expression.
+     *
+     * The `name`, `type`, and `description` fields in the `metric_descriptor`
+     * are output only, and is constructed using the `name` and `description`
+     * field in the LogMetric.
+     *
+     * To create a logs-based metric that records a distribution of log values, a
+     * DELTA metric kind with a DISTRIBUTION value type must be used along with
+     * a `value_extractor` expression in the LogMetric.
+     *
+     * Each label in the metric descriptor must have a matching label
+     * name as the key and an extractor expression as the value in the
+     * `label_extractors` map.
+     *
+     * The `metric_kind` and `value_type` fields in the `metric_descriptor` cannot
+     * be updated once initially configured. New labels can be added in the
+     * `metric_descriptor`, but existing labels cannot be modified except for
+     * their description.
+     * 
+ * + * + * .google.api.MetricDescriptor metric_descriptor = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The metricDescriptor. + */ + public com.google.api.MetricDescriptor getMetricDescriptor() { + if (metricDescriptorBuilder_ == null) { + return metricDescriptor_ == null + ? com.google.api.MetricDescriptor.getDefaultInstance() + : metricDescriptor_; + } else { + return metricDescriptorBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. The metric descriptor associated with the logs-based metric.
+     * If unspecified, it uses a default metric descriptor with a DELTA metric
+     * kind, INT64 value type, with no labels and a unit of "1". Such a metric
+     * counts the number of log entries matching the `filter` expression.
+     *
+     * The `name`, `type`, and `description` fields in the `metric_descriptor`
+     * are output only, and is constructed using the `name` and `description`
+     * field in the LogMetric.
+     *
+     * To create a logs-based metric that records a distribution of log values, a
+     * DELTA metric kind with a DISTRIBUTION value type must be used along with
+     * a `value_extractor` expression in the LogMetric.
+     *
+     * Each label in the metric descriptor must have a matching label
+     * name as the key and an extractor expression as the value in the
+     * `label_extractors` map.
+     *
+     * The `metric_kind` and `value_type` fields in the `metric_descriptor` cannot
+     * be updated once initially configured. New labels can be added in the
+     * `metric_descriptor`, but existing labels cannot be modified except for
+     * their description.
+     * 
+ * + * + * .google.api.MetricDescriptor metric_descriptor = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setMetricDescriptor(com.google.api.MetricDescriptor value) { + if (metricDescriptorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + metricDescriptor_ = value; + } else { + metricDescriptorBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The metric descriptor associated with the logs-based metric.
+     * If unspecified, it uses a default metric descriptor with a DELTA metric
+     * kind, INT64 value type, with no labels and a unit of "1". Such a metric
+     * counts the number of log entries matching the `filter` expression.
+     *
+     * The `name`, `type`, and `description` fields in the `metric_descriptor`
+     * are output only, and is constructed using the `name` and `description`
+     * field in the LogMetric.
+     *
+     * To create a logs-based metric that records a distribution of log values, a
+     * DELTA metric kind with a DISTRIBUTION value type must be used along with
+     * a `value_extractor` expression in the LogMetric.
+     *
+     * Each label in the metric descriptor must have a matching label
+     * name as the key and an extractor expression as the value in the
+     * `label_extractors` map.
+     *
+     * The `metric_kind` and `value_type` fields in the `metric_descriptor` cannot
+     * be updated once initially configured. New labels can be added in the
+     * `metric_descriptor`, but existing labels cannot be modified except for
+     * their description.
+     * 
+ * + * + * .google.api.MetricDescriptor metric_descriptor = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setMetricDescriptor(com.google.api.MetricDescriptor.Builder builderForValue) { + if (metricDescriptorBuilder_ == null) { + metricDescriptor_ = builderForValue.build(); + } else { + metricDescriptorBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The metric descriptor associated with the logs-based metric.
+     * If unspecified, it uses a default metric descriptor with a DELTA metric
+     * kind, INT64 value type, with no labels and a unit of "1". Such a metric
+     * counts the number of log entries matching the `filter` expression.
+     *
+     * The `name`, `type`, and `description` fields in the `metric_descriptor`
+     * are output only, and is constructed using the `name` and `description`
+     * field in the LogMetric.
+     *
+     * To create a logs-based metric that records a distribution of log values, a
+     * DELTA metric kind with a DISTRIBUTION value type must be used along with
+     * a `value_extractor` expression in the LogMetric.
+     *
+     * Each label in the metric descriptor must have a matching label
+     * name as the key and an extractor expression as the value in the
+     * `label_extractors` map.
+     *
+     * The `metric_kind` and `value_type` fields in the `metric_descriptor` cannot
+     * be updated once initially configured. New labels can be added in the
+     * `metric_descriptor`, but existing labels cannot be modified except for
+     * their description.
+     * 
+ * + * + * .google.api.MetricDescriptor metric_descriptor = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeMetricDescriptor(com.google.api.MetricDescriptor value) { + if (metricDescriptorBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && metricDescriptor_ != null + && metricDescriptor_ != com.google.api.MetricDescriptor.getDefaultInstance()) { + getMetricDescriptorBuilder().mergeFrom(value); + } else { + metricDescriptor_ = value; + } + } else { + metricDescriptorBuilder_.mergeFrom(value); + } + if (metricDescriptor_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. The metric descriptor associated with the logs-based metric.
+     * If unspecified, it uses a default metric descriptor with a DELTA metric
+     * kind, INT64 value type, with no labels and a unit of "1". Such a metric
+     * counts the number of log entries matching the `filter` expression.
+     *
+     * The `name`, `type`, and `description` fields in the `metric_descriptor`
+     * are output only, and is constructed using the `name` and `description`
+     * field in the LogMetric.
+     *
+     * To create a logs-based metric that records a distribution of log values, a
+     * DELTA metric kind with a DISTRIBUTION value type must be used along with
+     * a `value_extractor` expression in the LogMetric.
+     *
+     * Each label in the metric descriptor must have a matching label
+     * name as the key and an extractor expression as the value in the
+     * `label_extractors` map.
+     *
+     * The `metric_kind` and `value_type` fields in the `metric_descriptor` cannot
+     * be updated once initially configured. New labels can be added in the
+     * `metric_descriptor`, but existing labels cannot be modified except for
+     * their description.
+     * 
+ * + * + * .google.api.MetricDescriptor metric_descriptor = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearMetricDescriptor() { + bitField0_ = (bitField0_ & ~0x00000020); + metricDescriptor_ = null; + if (metricDescriptorBuilder_ != null) { + metricDescriptorBuilder_.dispose(); + metricDescriptorBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The metric descriptor associated with the logs-based metric.
+     * If unspecified, it uses a default metric descriptor with a DELTA metric
+     * kind, INT64 value type, with no labels and a unit of "1". Such a metric
+     * counts the number of log entries matching the `filter` expression.
+     *
+     * The `name`, `type`, and `description` fields in the `metric_descriptor`
+     * are output only, and is constructed using the `name` and `description`
+     * field in the LogMetric.
+     *
+     * To create a logs-based metric that records a distribution of log values, a
+     * DELTA metric kind with a DISTRIBUTION value type must be used along with
+     * a `value_extractor` expression in the LogMetric.
+     *
+     * Each label in the metric descriptor must have a matching label
+     * name as the key and an extractor expression as the value in the
+     * `label_extractors` map.
+     *
+     * The `metric_kind` and `value_type` fields in the `metric_descriptor` cannot
+     * be updated once initially configured. New labels can be added in the
+     * `metric_descriptor`, but existing labels cannot be modified except for
+     * their description.
+     * 
+ * + * + * .google.api.MetricDescriptor metric_descriptor = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.api.MetricDescriptor.Builder getMetricDescriptorBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getMetricDescriptorFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. The metric descriptor associated with the logs-based metric.
+     * If unspecified, it uses a default metric descriptor with a DELTA metric
+     * kind, INT64 value type, with no labels and a unit of "1". Such a metric
+     * counts the number of log entries matching the `filter` expression.
+     *
+     * The `name`, `type`, and `description` fields in the `metric_descriptor`
+     * are output only, and is constructed using the `name` and `description`
+     * field in the LogMetric.
+     *
+     * To create a logs-based metric that records a distribution of log values, a
+     * DELTA metric kind with a DISTRIBUTION value type must be used along with
+     * a `value_extractor` expression in the LogMetric.
+     *
+     * Each label in the metric descriptor must have a matching label
+     * name as the key and an extractor expression as the value in the
+     * `label_extractors` map.
+     *
+     * The `metric_kind` and `value_type` fields in the `metric_descriptor` cannot
+     * be updated once initially configured. New labels can be added in the
+     * `metric_descriptor`, but existing labels cannot be modified except for
+     * their description.
+     * 
+ * + * + * .google.api.MetricDescriptor metric_descriptor = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.api.MetricDescriptorOrBuilder getMetricDescriptorOrBuilder() { + if (metricDescriptorBuilder_ != null) { + return metricDescriptorBuilder_.getMessageOrBuilder(); + } else { + return metricDescriptor_ == null + ? com.google.api.MetricDescriptor.getDefaultInstance() + : metricDescriptor_; + } + } + + /** + * + * + *
+     * Optional. The metric descriptor associated with the logs-based metric.
+     * If unspecified, it uses a default metric descriptor with a DELTA metric
+     * kind, INT64 value type, with no labels and a unit of "1". Such a metric
+     * counts the number of log entries matching the `filter` expression.
+     *
+     * The `name`, `type`, and `description` fields in the `metric_descriptor`
+     * are output only, and is constructed using the `name` and `description`
+     * field in the LogMetric.
+     *
+     * To create a logs-based metric that records a distribution of log values, a
+     * DELTA metric kind with a DISTRIBUTION value type must be used along with
+     * a `value_extractor` expression in the LogMetric.
+     *
+     * Each label in the metric descriptor must have a matching label
+     * name as the key and an extractor expression as the value in the
+     * `label_extractors` map.
+     *
+     * The `metric_kind` and `value_type` fields in the `metric_descriptor` cannot
+     * be updated once initially configured. New labels can be added in the
+     * `metric_descriptor`, but existing labels cannot be modified except for
+     * their description.
+     * 
+ * + * + * .google.api.MetricDescriptor metric_descriptor = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.MetricDescriptor, + com.google.api.MetricDescriptor.Builder, + com.google.api.MetricDescriptorOrBuilder> + getMetricDescriptorFieldBuilder() { + if (metricDescriptorBuilder_ == null) { + metricDescriptorBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.api.MetricDescriptor, + com.google.api.MetricDescriptor.Builder, + com.google.api.MetricDescriptorOrBuilder>( + getMetricDescriptor(), getParentForChildren(), isClean()); + metricDescriptor_ = null; + } + return metricDescriptorBuilder_; + } + + private java.lang.Object valueExtractor_ = ""; + + /** + * + * + *
+     * Optional. A `value_extractor` is required when using a distribution
+     * logs-based metric to extract the values to record from a log entry.
+     * Two functions are supported for value extraction: `EXTRACT(field)` or
+     * `REGEXP_EXTRACT(field, regex)`. The arguments are:
+     *
+     *   1. field: The name of the log entry field from which the value is to be
+     *      extracted.
+     *   2. regex: A regular expression using the Google RE2 syntax
+     *      (https://github.com/google/re2/wiki/Syntax) with a single capture
+     *      group to extract data from the specified log entry field. The value
+     *      of the field is converted to a string before applying the regex.
+     *      It is an error to specify a regex that does not include exactly one
+     *      capture group.
+     *
+     * The result of the extraction must be convertible to a double type, as the
+     * distribution always records double values. If either the extraction or
+     * the conversion to double fails, then those values are not recorded in the
+     * distribution.
+     *
+     * Example: `REGEXP_EXTRACT(jsonPayload.request, ".*quantity=(\d+).*")`
+     * 
+ * + * string value_extractor = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The valueExtractor. + */ + public java.lang.String getValueExtractor() { + java.lang.Object ref = valueExtractor_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + valueExtractor_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. A `value_extractor` is required when using a distribution
+     * logs-based metric to extract the values to record from a log entry.
+     * Two functions are supported for value extraction: `EXTRACT(field)` or
+     * `REGEXP_EXTRACT(field, regex)`. The arguments are:
+     *
+     *   1. field: The name of the log entry field from which the value is to be
+     *      extracted.
+     *   2. regex: A regular expression using the Google RE2 syntax
+     *      (https://github.com/google/re2/wiki/Syntax) with a single capture
+     *      group to extract data from the specified log entry field. The value
+     *      of the field is converted to a string before applying the regex.
+     *      It is an error to specify a regex that does not include exactly one
+     *      capture group.
+     *
+     * The result of the extraction must be convertible to a double type, as the
+     * distribution always records double values. If either the extraction or
+     * the conversion to double fails, then those values are not recorded in the
+     * distribution.
+     *
+     * Example: `REGEXP_EXTRACT(jsonPayload.request, ".*quantity=(\d+).*")`
+     * 
+ * + * string value_extractor = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for valueExtractor. + */ + public com.google.protobuf.ByteString getValueExtractorBytes() { + java.lang.Object ref = valueExtractor_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + valueExtractor_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. A `value_extractor` is required when using a distribution
+     * logs-based metric to extract the values to record from a log entry.
+     * Two functions are supported for value extraction: `EXTRACT(field)` or
+     * `REGEXP_EXTRACT(field, regex)`. The arguments are:
+     *
+     *   1. field: The name of the log entry field from which the value is to be
+     *      extracted.
+     *   2. regex: A regular expression using the Google RE2 syntax
+     *      (https://github.com/google/re2/wiki/Syntax) with a single capture
+     *      group to extract data from the specified log entry field. The value
+     *      of the field is converted to a string before applying the regex.
+     *      It is an error to specify a regex that does not include exactly one
+     *      capture group.
+     *
+     * The result of the extraction must be convertible to a double type, as the
+     * distribution always records double values. If either the extraction or
+     * the conversion to double fails, then those values are not recorded in the
+     * distribution.
+     *
+     * Example: `REGEXP_EXTRACT(jsonPayload.request, ".*quantity=(\d+).*")`
+     * 
+ * + * string value_extractor = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The valueExtractor to set. + * @return This builder for chaining. + */ + public Builder setValueExtractor(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + valueExtractor_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. A `value_extractor` is required when using a distribution
+     * logs-based metric to extract the values to record from a log entry.
+     * Two functions are supported for value extraction: `EXTRACT(field)` or
+     * `REGEXP_EXTRACT(field, regex)`. The arguments are:
+     *
+     *   1. field: The name of the log entry field from which the value is to be
+     *      extracted.
+     *   2. regex: A regular expression using the Google RE2 syntax
+     *      (https://github.com/google/re2/wiki/Syntax) with a single capture
+     *      group to extract data from the specified log entry field. The value
+     *      of the field is converted to a string before applying the regex.
+     *      It is an error to specify a regex that does not include exactly one
+     *      capture group.
+     *
+     * The result of the extraction must be convertible to a double type, as the
+     * distribution always records double values. If either the extraction or
+     * the conversion to double fails, then those values are not recorded in the
+     * distribution.
+     *
+     * Example: `REGEXP_EXTRACT(jsonPayload.request, ".*quantity=(\d+).*")`
+     * 
+ * + * string value_extractor = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearValueExtractor() { + valueExtractor_ = getDefaultInstance().getValueExtractor(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. A `value_extractor` is required when using a distribution
+     * logs-based metric to extract the values to record from a log entry.
+     * Two functions are supported for value extraction: `EXTRACT(field)` or
+     * `REGEXP_EXTRACT(field, regex)`. The arguments are:
+     *
+     *   1. field: The name of the log entry field from which the value is to be
+     *      extracted.
+     *   2. regex: A regular expression using the Google RE2 syntax
+     *      (https://github.com/google/re2/wiki/Syntax) with a single capture
+     *      group to extract data from the specified log entry field. The value
+     *      of the field is converted to a string before applying the regex.
+     *      It is an error to specify a regex that does not include exactly one
+     *      capture group.
+     *
+     * The result of the extraction must be convertible to a double type, as the
+     * distribution always records double values. If either the extraction or
+     * the conversion to double fails, then those values are not recorded in the
+     * distribution.
+     *
+     * Example: `REGEXP_EXTRACT(jsonPayload.request, ".*quantity=(\d+).*")`
+     * 
+ * + * string value_extractor = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for valueExtractor to set. + * @return This builder for chaining. + */ + public Builder setValueExtractorBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + valueExtractor_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + private com.google.protobuf.MapField labelExtractors_; + + private com.google.protobuf.MapField + internalGetLabelExtractors() { + if (labelExtractors_ == null) { + return com.google.protobuf.MapField.emptyMapField( + LabelExtractorsDefaultEntryHolder.defaultEntry); + } + return labelExtractors_; + } + + private com.google.protobuf.MapField + internalGetMutableLabelExtractors() { + if (labelExtractors_ == null) { + labelExtractors_ = + com.google.protobuf.MapField.newMapField( + LabelExtractorsDefaultEntryHolder.defaultEntry); + } + if (!labelExtractors_.isMutable()) { + labelExtractors_ = labelExtractors_.copy(); + } + bitField0_ |= 0x00000080; + onChanged(); + return labelExtractors_; + } + + public int getLabelExtractorsCount() { + return internalGetLabelExtractors().getMap().size(); + } + + /** + * + * + *
+     * Optional. A map from a label key string to an extractor expression which is
+     * used to extract data from a log entry field and assign as the label value.
+     * Each label key specified in the LabelDescriptor must have an associated
+     * extractor expression in this map. The syntax of the extractor expression
+     * is the same as for the `value_extractor` field.
+     *
+     * The extracted value is converted to the type defined in the label
+     * descriptor. If either the extraction or the type conversion fails,
+     * the label will have a default value. The default value for a string
+     * label is an empty string, for an integer label its 0, and for a boolean
+     * label its `false`.
+     *
+     * Note that there are upper bounds on the maximum number of labels and the
+     * number of active time series that are allowed in a project.
+     * 
+ * + * + * map<string, string> label_extractors = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsLabelExtractors(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabelExtractors().getMap().containsKey(key); + } + + /** Use {@link #getLabelExtractorsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabelExtractors() { + return getLabelExtractorsMap(); + } + + /** + * + * + *
+     * Optional. A map from a label key string to an extractor expression which is
+     * used to extract data from a log entry field and assign as the label value.
+     * Each label key specified in the LabelDescriptor must have an associated
+     * extractor expression in this map. The syntax of the extractor expression
+     * is the same as for the `value_extractor` field.
+     *
+     * The extracted value is converted to the type defined in the label
+     * descriptor. If either the extraction or the type conversion fails,
+     * the label will have a default value. The default value for a string
+     * label is an empty string, for an integer label its 0, and for a boolean
+     * label its `false`.
+     *
+     * Note that there are upper bounds on the maximum number of labels and the
+     * number of active time series that are allowed in a project.
+     * 
+ * + * + * map<string, string> label_extractors = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map getLabelExtractorsMap() { + return internalGetLabelExtractors().getMap(); + } + + /** + * + * + *
+     * Optional. A map from a label key string to an extractor expression which is
+     * used to extract data from a log entry field and assign as the label value.
+     * Each label key specified in the LabelDescriptor must have an associated
+     * extractor expression in this map. The syntax of the extractor expression
+     * is the same as for the `value_extractor` field.
+     *
+     * The extracted value is converted to the type defined in the label
+     * descriptor. If either the extraction or the type conversion fails,
+     * the label will have a default value. The default value for a string
+     * label is an empty string, for an integer label its 0, and for a boolean
+     * label its `false`.
+     *
+     * Note that there are upper bounds on the maximum number of labels and the
+     * number of active time series that are allowed in a project.
+     * 
+ * + * + * map<string, string> label_extractors = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public /* nullable */ java.lang.String getLabelExtractorsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabelExtractors().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * + * + *
+     * Optional. A map from a label key string to an extractor expression which is
+     * used to extract data from a log entry field and assign as the label value.
+     * Each label key specified in the LabelDescriptor must have an associated
+     * extractor expression in this map. The syntax of the extractor expression
+     * is the same as for the `value_extractor` field.
+     *
+     * The extracted value is converted to the type defined in the label
+     * descriptor. If either the extraction or the type conversion fails,
+     * the label will have a default value. The default value for a string
+     * label is an empty string, for an integer label its 0, and for a boolean
+     * label its `false`.
+     *
+     * Note that there are upper bounds on the maximum number of labels and the
+     * number of active time series that are allowed in a project.
+     * 
+ * + * + * map<string, string> label_extractors = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.lang.String getLabelExtractorsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabelExtractors().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabelExtractors() { + bitField0_ = (bitField0_ & ~0x00000080); + internalGetMutableLabelExtractors().getMutableMap().clear(); + return this; + } + + /** + * + * + *
+     * Optional. A map from a label key string to an extractor expression which is
+     * used to extract data from a log entry field and assign as the label value.
+     * Each label key specified in the LabelDescriptor must have an associated
+     * extractor expression in this map. The syntax of the extractor expression
+     * is the same as for the `value_extractor` field.
+     *
+     * The extracted value is converted to the type defined in the label
+     * descriptor. If either the extraction or the type conversion fails,
+     * the label will have a default value. The default value for a string
+     * label is an empty string, for an integer label its 0, and for a boolean
+     * label its `false`.
+     *
+     * Note that there are upper bounds on the maximum number of labels and the
+     * number of active time series that are allowed in a project.
+     * 
+ * + * + * map<string, string> label_extractors = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeLabelExtractors(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableLabelExtractors().getMutableMap().remove(key); + return this; + } + + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabelExtractors() { + bitField0_ |= 0x00000080; + return internalGetMutableLabelExtractors().getMutableMap(); + } + + /** + * + * + *
+     * Optional. A map from a label key string to an extractor expression which is
+     * used to extract data from a log entry field and assign as the label value.
+     * Each label key specified in the LabelDescriptor must have an associated
+     * extractor expression in this map. The syntax of the extractor expression
+     * is the same as for the `value_extractor` field.
+     *
+     * The extracted value is converted to the type defined in the label
+     * descriptor. If either the extraction or the type conversion fails,
+     * the label will have a default value. The default value for a string
+     * label is an empty string, for an integer label its 0, and for a boolean
+     * label its `false`.
+     *
+     * Note that there are upper bounds on the maximum number of labels and the
+     * number of active time series that are allowed in a project.
+     * 
+ * + * + * map<string, string> label_extractors = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putLabelExtractors(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableLabelExtractors().getMutableMap().put(key, value); + bitField0_ |= 0x00000080; + return this; + } + + /** + * + * + *
+     * Optional. A map from a label key string to an extractor expression which is
+     * used to extract data from a log entry field and assign as the label value.
+     * Each label key specified in the LabelDescriptor must have an associated
+     * extractor expression in this map. The syntax of the extractor expression
+     * is the same as for the `value_extractor` field.
+     *
+     * The extracted value is converted to the type defined in the label
+     * descriptor. If either the extraction or the type conversion fails,
+     * the label will have a default value. The default value for a string
+     * label is an empty string, for an integer label its 0, and for a boolean
+     * label its `false`.
+     *
+     * Note that there are upper bounds on the maximum number of labels and the
+     * number of active time series that are allowed in a project.
+     * 
+ * + * + * map<string, string> label_extractors = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putAllLabelExtractors(java.util.Map values) { + internalGetMutableLabelExtractors().getMutableMap().putAll(values); + bitField0_ |= 0x00000080; + return this; + } + + private com.google.api.Distribution.BucketOptions bucketOptions_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.Distribution.BucketOptions, + com.google.api.Distribution.BucketOptions.Builder, + com.google.api.Distribution.BucketOptionsOrBuilder> + bucketOptionsBuilder_; + + /** + * + * + *
+     * Optional. The `bucket_options` are required when the logs-based metric is
+     * using a DISTRIBUTION value type and it describes the bucket boundaries
+     * used to create a histogram of the extracted values.
+     * 
+ * + * + * .google.api.Distribution.BucketOptions bucket_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the bucketOptions field is set. + */ + public boolean hasBucketOptions() { + return ((bitField0_ & 0x00000100) != 0); + } + + /** + * + * + *
+     * Optional. The `bucket_options` are required when the logs-based metric is
+     * using a DISTRIBUTION value type and it describes the bucket boundaries
+     * used to create a histogram of the extracted values.
+     * 
+ * + * + * .google.api.Distribution.BucketOptions bucket_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The bucketOptions. + */ + public com.google.api.Distribution.BucketOptions getBucketOptions() { + if (bucketOptionsBuilder_ == null) { + return bucketOptions_ == null + ? com.google.api.Distribution.BucketOptions.getDefaultInstance() + : bucketOptions_; + } else { + return bucketOptionsBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. The `bucket_options` are required when the logs-based metric is
+     * using a DISTRIBUTION value type and it describes the bucket boundaries
+     * used to create a histogram of the extracted values.
+     * 
+ * + * + * .google.api.Distribution.BucketOptions bucket_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setBucketOptions(com.google.api.Distribution.BucketOptions value) { + if (bucketOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + bucketOptions_ = value; + } else { + bucketOptionsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The `bucket_options` are required when the logs-based metric is
+     * using a DISTRIBUTION value type and it describes the bucket boundaries
+     * used to create a histogram of the extracted values.
+     * 
+ * + * + * .google.api.Distribution.BucketOptions bucket_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setBucketOptions( + com.google.api.Distribution.BucketOptions.Builder builderForValue) { + if (bucketOptionsBuilder_ == null) { + bucketOptions_ = builderForValue.build(); + } else { + bucketOptionsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The `bucket_options` are required when the logs-based metric is
+     * using a DISTRIBUTION value type and it describes the bucket boundaries
+     * used to create a histogram of the extracted values.
+     * 
+ * + * + * .google.api.Distribution.BucketOptions bucket_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeBucketOptions(com.google.api.Distribution.BucketOptions value) { + if (bucketOptionsBuilder_ == null) { + if (((bitField0_ & 0x00000100) != 0) + && bucketOptions_ != null + && bucketOptions_ != com.google.api.Distribution.BucketOptions.getDefaultInstance()) { + getBucketOptionsBuilder().mergeFrom(value); + } else { + bucketOptions_ = value; + } + } else { + bucketOptionsBuilder_.mergeFrom(value); + } + if (bucketOptions_ != null) { + bitField0_ |= 0x00000100; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. The `bucket_options` are required when the logs-based metric is
+     * using a DISTRIBUTION value type and it describes the bucket boundaries
+     * used to create a histogram of the extracted values.
+     * 
+ * + * + * .google.api.Distribution.BucketOptions bucket_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearBucketOptions() { + bitField0_ = (bitField0_ & ~0x00000100); + bucketOptions_ = null; + if (bucketOptionsBuilder_ != null) { + bucketOptionsBuilder_.dispose(); + bucketOptionsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The `bucket_options` are required when the logs-based metric is
+     * using a DISTRIBUTION value type and it describes the bucket boundaries
+     * used to create a histogram of the extracted values.
+     * 
+ * + * + * .google.api.Distribution.BucketOptions bucket_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.api.Distribution.BucketOptions.Builder getBucketOptionsBuilder() { + bitField0_ |= 0x00000100; + onChanged(); + return getBucketOptionsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. The `bucket_options` are required when the logs-based metric is
+     * using a DISTRIBUTION value type and it describes the bucket boundaries
+     * used to create a histogram of the extracted values.
+     * 
+ * + * + * .google.api.Distribution.BucketOptions bucket_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.api.Distribution.BucketOptionsOrBuilder getBucketOptionsOrBuilder() { + if (bucketOptionsBuilder_ != null) { + return bucketOptionsBuilder_.getMessageOrBuilder(); + } else { + return bucketOptions_ == null + ? com.google.api.Distribution.BucketOptions.getDefaultInstance() + : bucketOptions_; + } + } + + /** + * + * + *
+     * Optional. The `bucket_options` are required when the logs-based metric is
+     * using a DISTRIBUTION value type and it describes the bucket boundaries
+     * used to create a histogram of the extracted values.
+     * 
+ * + * + * .google.api.Distribution.BucketOptions bucket_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.Distribution.BucketOptions, + com.google.api.Distribution.BucketOptions.Builder, + com.google.api.Distribution.BucketOptionsOrBuilder> + getBucketOptionsFieldBuilder() { + if (bucketOptionsBuilder_ == null) { + bucketOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.api.Distribution.BucketOptions, + com.google.api.Distribution.BucketOptions.Builder, + com.google.api.Distribution.BucketOptionsOrBuilder>( + getBucketOptions(), getParentForChildren(), isClean()); + bucketOptions_ = null; + } + return bucketOptionsBuilder_; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + + /** + * + * + *
+     * Output only. The creation timestamp of the metric.
+     *
+     * This field may not be present for older metrics.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000200) != 0); + } + + /** + * + * + *
+     * Output only. The creation timestamp of the metric.
+     *
+     * This field may not be present for older metrics.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Output only. The creation timestamp of the metric.
+     *
+     * This field may not be present for older metrics.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The creation timestamp of the metric.
+     *
+     * This field may not be present for older metrics.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The creation timestamp of the metric.
+     *
+     * This field may not be present for older metrics.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000200) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + if (createTime_ != null) { + bitField0_ |= 0x00000200; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Output only. The creation timestamp of the metric.
+     *
+     * This field may not be present for older metrics.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000200); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The creation timestamp of the metric.
+     *
+     * This field may not be present for older metrics.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000200; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Output only. The creation timestamp of the metric.
+     *
+     * This field may not be present for older metrics.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + + /** + * + * + *
+     * Output only. The creation timestamp of the metric.
+     *
+     * This field may not be present for older metrics.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + + /** + * + * + *
+     * Output only. The last update timestamp of the metric.
+     *
+     * This field may not be present for older metrics.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000400) != 0); + } + + /** + * + * + *
+     * Output only. The last update timestamp of the metric.
+     *
+     * This field may not be present for older metrics.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Output only. The last update timestamp of the metric.
+     *
+     * This field may not be present for older metrics.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + } else { + updateTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The last update timestamp of the metric.
+     *
+     * This field may not be present for older metrics.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The last update timestamp of the metric.
+     *
+     * This field may not be present for older metrics.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000400) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + if (updateTime_ != null) { + bitField0_ |= 0x00000400; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Output only. The last update timestamp of the metric.
+     *
+     * This field may not be present for older metrics.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + bitField0_ = (bitField0_ & ~0x00000400); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The last update timestamp of the metric.
+     *
+     * This field may not be present for older metrics.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000400; + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Output only. The last update timestamp of the metric.
+     *
+     * This field may not be present for older metrics.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + + /** + * + * + *
+     * Output only. The last update timestamp of the metric.
+     *
+     * This field may not be present for older metrics.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private int version_ = 0; + + /** + * + * + *
+     * Deprecated. The API version that created or updated this metric.
+     * The v2 format is used by default and cannot be changed.
+     * 
+ * + * .google.logging.v2.LogMetric.ApiVersion version = 4 [deprecated = true]; + * + * @deprecated google.logging.v2.LogMetric.version is deprecated. See + * google/logging/v2/logging_metrics.proto;l=237 + * @return The enum numeric value on the wire for version. + */ + @java.lang.Override + @java.lang.Deprecated + public int getVersionValue() { + return version_; + } + + /** + * + * + *
+     * Deprecated. The API version that created or updated this metric.
+     * The v2 format is used by default and cannot be changed.
+     * 
+ * + * .google.logging.v2.LogMetric.ApiVersion version = 4 [deprecated = true]; + * + * @deprecated google.logging.v2.LogMetric.version is deprecated. See + * google/logging/v2/logging_metrics.proto;l=237 + * @param value The enum numeric value on the wire for version to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setVersionValue(int value) { + version_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + /** + * + * + *
+     * Deprecated. The API version that created or updated this metric.
+     * The v2 format is used by default and cannot be changed.
+     * 
+ * + * .google.logging.v2.LogMetric.ApiVersion version = 4 [deprecated = true]; + * + * @deprecated google.logging.v2.LogMetric.version is deprecated. See + * google/logging/v2/logging_metrics.proto;l=237 + * @return The version. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.logging.v2.LogMetric.ApiVersion getVersion() { + com.google.logging.v2.LogMetric.ApiVersion result = + com.google.logging.v2.LogMetric.ApiVersion.forNumber(version_); + return result == null ? com.google.logging.v2.LogMetric.ApiVersion.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * Deprecated. The API version that created or updated this metric.
+     * The v2 format is used by default and cannot be changed.
+     * 
+ * + * .google.logging.v2.LogMetric.ApiVersion version = 4 [deprecated = true]; + * + * @deprecated google.logging.v2.LogMetric.version is deprecated. See + * google/logging/v2/logging_metrics.proto;l=237 + * @param value The version to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setVersion(com.google.logging.v2.LogMetric.ApiVersion value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000800; + version_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Deprecated. The API version that created or updated this metric.
+     * The v2 format is used by default and cannot be changed.
+     * 
+ * + * .google.logging.v2.LogMetric.ApiVersion version = 4 [deprecated = true]; + * + * @deprecated google.logging.v2.LogMetric.version is deprecated. See + * google/logging/v2/logging_metrics.proto;l=237 + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder clearVersion() { + bitField0_ = (bitField0_ & ~0x00000800); + version_ = 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.logging.v2.LogMetric) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.LogMetric) + private static final com.google.logging.v2.LogMetric DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.LogMetric(); + } + + public static com.google.logging.v2.LogMetric getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LogMetric parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.LogMetric getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogMetricName.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogMetricName.java new file mode 100644 index 000000000000..7fe6a52fc6ee --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogMetricName.java @@ -0,0 +1,191 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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.logging.v2; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class LogMetricName implements ResourceName { + private static final PathTemplate PROJECT_METRIC = + PathTemplate.createWithoutUrlEncoding("projects/{project}/metrics/{metric}"); + private volatile Map fieldValuesMap; + private final String project; + private final String metric; + + @Deprecated + protected LogMetricName() { + project = null; + metric = null; + } + + private LogMetricName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + metric = Preconditions.checkNotNull(builder.getMetric()); + } + + public String getProject() { + return project; + } + + public String getMetric() { + return metric; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static LogMetricName of(String project, String metric) { + return newBuilder().setProject(project).setMetric(metric).build(); + } + + public static String format(String project, String metric) { + return newBuilder().setProject(project).setMetric(metric).build().toString(); + } + + public static LogMetricName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_METRIC.validatedMatch( + formattedString, "LogMetricName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("metric")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (LogMetricName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_METRIC.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (metric != null) { + fieldMapBuilder.put("metric", metric); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_METRIC.instantiate("project", project, "metric", metric); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + LogMetricName that = ((LogMetricName) o); + return Objects.equals(this.project, that.project) && Objects.equals(this.metric, that.metric); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(metric); + return h; + } + + /** Builder for projects/{project}/metrics/{metric}. */ + public static class Builder { + private String project; + private String metric; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getMetric() { + return metric; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setMetric(String metric) { + this.metric = metric; + return this; + } + + private Builder(LogMetricName logMetricName) { + this.project = logMetricName.project; + this.metric = logMetricName.metric; + } + + public LogMetricName build() { + return new LogMetricName(this); + } + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogMetricOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogMetricOrBuilder.java new file mode 100644 index 000000000000..2548fabac32d --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogMetricOrBuilder.java @@ -0,0 +1,673 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_metrics.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface LogMetricOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.LogMetric) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The client-assigned metric identifier.
+   * Examples: `"error_count"`, `"nginx/requests"`.
+   *
+   * Metric identifiers are limited to 100 characters and can include only the
+   * following characters: `A-Z`, `a-z`, `0-9`, and the special characters
+   * `_-.,+!*',()%/`. The forward-slash character (`/`) denotes a hierarchy of
+   * name pieces, and it cannot be the first character of the name.
+   *
+   * This field is the `[METRIC_ID]` part of a metric resource name in the
+   * format "projects/[PROJECT_ID]/metrics/[METRIC_ID]". Example: If the
+   * resource name of a metric is
+   * `"projects/my-project/metrics/nginx%2Frequests"`, this field's value is
+   * `"nginx/requests"`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Required. The client-assigned metric identifier.
+   * Examples: `"error_count"`, `"nginx/requests"`.
+   *
+   * Metric identifiers are limited to 100 characters and can include only the
+   * following characters: `A-Z`, `a-z`, `0-9`, and the special characters
+   * `_-.,+!*',()%/`. The forward-slash character (`/`) denotes a hierarchy of
+   * name pieces, and it cannot be the first character of the name.
+   *
+   * This field is the `[METRIC_ID]` part of a metric resource name in the
+   * format "projects/[PROJECT_ID]/metrics/[METRIC_ID]". Example: If the
+   * resource name of a metric is
+   * `"projects/my-project/metrics/nginx%2Frequests"`, this field's value is
+   * `"nginx/requests"`.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. A description of this metric, which is used in documentation.
+   * The maximum length of the description is 8000 characters.
+   * 
+ * + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The description. + */ + java.lang.String getDescription(); + + /** + * + * + *
+   * Optional. A description of this metric, which is used in documentation.
+   * The maximum length of the description is 8000 characters.
+   * 
+ * + * string description = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Required. An [advanced logs
+   * filter](https://cloud.google.com/logging/docs/view/advanced_filters) which
+   * is used to match log entries. Example:
+   *
+   *     "resource.type=gae_app AND severity>=ERROR"
+   *
+   * The maximum length of the filter is 20000 characters.
+   * 
+ * + * string filter = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The filter. + */ + java.lang.String getFilter(); + + /** + * + * + *
+   * Required. An [advanced logs
+   * filter](https://cloud.google.com/logging/docs/view/advanced_filters) which
+   * is used to match log entries. Example:
+   *
+   *     "resource.type=gae_app AND severity>=ERROR"
+   *
+   * The maximum length of the filter is 20000 characters.
+   * 
+ * + * string filter = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Optional. The resource name of the Log Bucket that owns the Log Metric.
+   * Only Log Buckets in projects are supported. The bucket has to be in the
+   * same project as the metric.
+   *
+   * For example:
+   *
+   *   `projects/my-project/locations/global/buckets/my-bucket`
+   *
+   * If empty, then the Log Metric is considered a non-Bucket Log Metric.
+   * 
+ * + * string bucket_name = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bucketName. + */ + java.lang.String getBucketName(); + + /** + * + * + *
+   * Optional. The resource name of the Log Bucket that owns the Log Metric.
+   * Only Log Buckets in projects are supported. The bucket has to be in the
+   * same project as the metric.
+   *
+   * For example:
+   *
+   *   `projects/my-project/locations/global/buckets/my-bucket`
+   *
+   * If empty, then the Log Metric is considered a non-Bucket Log Metric.
+   * 
+ * + * string bucket_name = 13 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for bucketName. + */ + com.google.protobuf.ByteString getBucketNameBytes(); + + /** + * + * + *
+   * Optional. If set to True, then this metric is disabled and it does not
+   * generate any points.
+   * 
+ * + * bool disabled = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The disabled. + */ + boolean getDisabled(); + + /** + * + * + *
+   * Optional. The metric descriptor associated with the logs-based metric.
+   * If unspecified, it uses a default metric descriptor with a DELTA metric
+   * kind, INT64 value type, with no labels and a unit of "1". Such a metric
+   * counts the number of log entries matching the `filter` expression.
+   *
+   * The `name`, `type`, and `description` fields in the `metric_descriptor`
+   * are output only, and is constructed using the `name` and `description`
+   * field in the LogMetric.
+   *
+   * To create a logs-based metric that records a distribution of log values, a
+   * DELTA metric kind with a DISTRIBUTION value type must be used along with
+   * a `value_extractor` expression in the LogMetric.
+   *
+   * Each label in the metric descriptor must have a matching label
+   * name as the key and an extractor expression as the value in the
+   * `label_extractors` map.
+   *
+   * The `metric_kind` and `value_type` fields in the `metric_descriptor` cannot
+   * be updated once initially configured. New labels can be added in the
+   * `metric_descriptor`, but existing labels cannot be modified except for
+   * their description.
+   * 
+ * + * + * .google.api.MetricDescriptor metric_descriptor = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the metricDescriptor field is set. + */ + boolean hasMetricDescriptor(); + + /** + * + * + *
+   * Optional. The metric descriptor associated with the logs-based metric.
+   * If unspecified, it uses a default metric descriptor with a DELTA metric
+   * kind, INT64 value type, with no labels and a unit of "1". Such a metric
+   * counts the number of log entries matching the `filter` expression.
+   *
+   * The `name`, `type`, and `description` fields in the `metric_descriptor`
+   * are output only, and is constructed using the `name` and `description`
+   * field in the LogMetric.
+   *
+   * To create a logs-based metric that records a distribution of log values, a
+   * DELTA metric kind with a DISTRIBUTION value type must be used along with
+   * a `value_extractor` expression in the LogMetric.
+   *
+   * Each label in the metric descriptor must have a matching label
+   * name as the key and an extractor expression as the value in the
+   * `label_extractors` map.
+   *
+   * The `metric_kind` and `value_type` fields in the `metric_descriptor` cannot
+   * be updated once initially configured. New labels can be added in the
+   * `metric_descriptor`, but existing labels cannot be modified except for
+   * their description.
+   * 
+ * + * + * .google.api.MetricDescriptor metric_descriptor = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The metricDescriptor. + */ + com.google.api.MetricDescriptor getMetricDescriptor(); + + /** + * + * + *
+   * Optional. The metric descriptor associated with the logs-based metric.
+   * If unspecified, it uses a default metric descriptor with a DELTA metric
+   * kind, INT64 value type, with no labels and a unit of "1". Such a metric
+   * counts the number of log entries matching the `filter` expression.
+   *
+   * The `name`, `type`, and `description` fields in the `metric_descriptor`
+   * are output only, and is constructed using the `name` and `description`
+   * field in the LogMetric.
+   *
+   * To create a logs-based metric that records a distribution of log values, a
+   * DELTA metric kind with a DISTRIBUTION value type must be used along with
+   * a `value_extractor` expression in the LogMetric.
+   *
+   * Each label in the metric descriptor must have a matching label
+   * name as the key and an extractor expression as the value in the
+   * `label_extractors` map.
+   *
+   * The `metric_kind` and `value_type` fields in the `metric_descriptor` cannot
+   * be updated once initially configured. New labels can be added in the
+   * `metric_descriptor`, but existing labels cannot be modified except for
+   * their description.
+   * 
+ * + * + * .google.api.MetricDescriptor metric_descriptor = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.api.MetricDescriptorOrBuilder getMetricDescriptorOrBuilder(); + + /** + * + * + *
+   * Optional. A `value_extractor` is required when using a distribution
+   * logs-based metric to extract the values to record from a log entry.
+   * Two functions are supported for value extraction: `EXTRACT(field)` or
+   * `REGEXP_EXTRACT(field, regex)`. The arguments are:
+   *
+   *   1. field: The name of the log entry field from which the value is to be
+   *      extracted.
+   *   2. regex: A regular expression using the Google RE2 syntax
+   *      (https://github.com/google/re2/wiki/Syntax) with a single capture
+   *      group to extract data from the specified log entry field. The value
+   *      of the field is converted to a string before applying the regex.
+   *      It is an error to specify a regex that does not include exactly one
+   *      capture group.
+   *
+   * The result of the extraction must be convertible to a double type, as the
+   * distribution always records double values. If either the extraction or
+   * the conversion to double fails, then those values are not recorded in the
+   * distribution.
+   *
+   * Example: `REGEXP_EXTRACT(jsonPayload.request, ".*quantity=(\d+).*")`
+   * 
+ * + * string value_extractor = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The valueExtractor. + */ + java.lang.String getValueExtractor(); + + /** + * + * + *
+   * Optional. A `value_extractor` is required when using a distribution
+   * logs-based metric to extract the values to record from a log entry.
+   * Two functions are supported for value extraction: `EXTRACT(field)` or
+   * `REGEXP_EXTRACT(field, regex)`. The arguments are:
+   *
+   *   1. field: The name of the log entry field from which the value is to be
+   *      extracted.
+   *   2. regex: A regular expression using the Google RE2 syntax
+   *      (https://github.com/google/re2/wiki/Syntax) with a single capture
+   *      group to extract data from the specified log entry field. The value
+   *      of the field is converted to a string before applying the regex.
+   *      It is an error to specify a regex that does not include exactly one
+   *      capture group.
+   *
+   * The result of the extraction must be convertible to a double type, as the
+   * distribution always records double values. If either the extraction or
+   * the conversion to double fails, then those values are not recorded in the
+   * distribution.
+   *
+   * Example: `REGEXP_EXTRACT(jsonPayload.request, ".*quantity=(\d+).*")`
+   * 
+ * + * string value_extractor = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for valueExtractor. + */ + com.google.protobuf.ByteString getValueExtractorBytes(); + + /** + * + * + *
+   * Optional. A map from a label key string to an extractor expression which is
+   * used to extract data from a log entry field and assign as the label value.
+   * Each label key specified in the LabelDescriptor must have an associated
+   * extractor expression in this map. The syntax of the extractor expression
+   * is the same as for the `value_extractor` field.
+   *
+   * The extracted value is converted to the type defined in the label
+   * descriptor. If either the extraction or the type conversion fails,
+   * the label will have a default value. The default value for a string
+   * label is an empty string, for an integer label its 0, and for a boolean
+   * label its `false`.
+   *
+   * Note that there are upper bounds on the maximum number of labels and the
+   * number of active time series that are allowed in a project.
+   * 
+ * + * map<string, string> label_extractors = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getLabelExtractorsCount(); + + /** + * + * + *
+   * Optional. A map from a label key string to an extractor expression which is
+   * used to extract data from a log entry field and assign as the label value.
+   * Each label key specified in the LabelDescriptor must have an associated
+   * extractor expression in this map. The syntax of the extractor expression
+   * is the same as for the `value_extractor` field.
+   *
+   * The extracted value is converted to the type defined in the label
+   * descriptor. If either the extraction or the type conversion fails,
+   * the label will have a default value. The default value for a string
+   * label is an empty string, for an integer label its 0, and for a boolean
+   * label its `false`.
+   *
+   * Note that there are upper bounds on the maximum number of labels and the
+   * number of active time series that are allowed in a project.
+   * 
+ * + * map<string, string> label_extractors = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + boolean containsLabelExtractors(java.lang.String key); + + /** Use {@link #getLabelExtractorsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabelExtractors(); + + /** + * + * + *
+   * Optional. A map from a label key string to an extractor expression which is
+   * used to extract data from a log entry field and assign as the label value.
+   * Each label key specified in the LabelDescriptor must have an associated
+   * extractor expression in this map. The syntax of the extractor expression
+   * is the same as for the `value_extractor` field.
+   *
+   * The extracted value is converted to the type defined in the label
+   * descriptor. If either the extraction or the type conversion fails,
+   * the label will have a default value. The default value for a string
+   * label is an empty string, for an integer label its 0, and for a boolean
+   * label its `false`.
+   *
+   * Note that there are upper bounds on the maximum number of labels and the
+   * number of active time series that are allowed in a project.
+   * 
+ * + * map<string, string> label_extractors = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.Map getLabelExtractorsMap(); + + /** + * + * + *
+   * Optional. A map from a label key string to an extractor expression which is
+   * used to extract data from a log entry field and assign as the label value.
+   * Each label key specified in the LabelDescriptor must have an associated
+   * extractor expression in this map. The syntax of the extractor expression
+   * is the same as for the `value_extractor` field.
+   *
+   * The extracted value is converted to the type defined in the label
+   * descriptor. If either the extraction or the type conversion fails,
+   * the label will have a default value. The default value for a string
+   * label is an empty string, for an integer label its 0, and for a boolean
+   * label its `false`.
+   *
+   * Note that there are upper bounds on the maximum number of labels and the
+   * number of active time series that are allowed in a project.
+   * 
+ * + * map<string, string> label_extractors = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + /* nullable */ + java.lang.String getLabelExtractorsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + + /** + * + * + *
+   * Optional. A map from a label key string to an extractor expression which is
+   * used to extract data from a log entry field and assign as the label value.
+   * Each label key specified in the LabelDescriptor must have an associated
+   * extractor expression in this map. The syntax of the extractor expression
+   * is the same as for the `value_extractor` field.
+   *
+   * The extracted value is converted to the type defined in the label
+   * descriptor. If either the extraction or the type conversion fails,
+   * the label will have a default value. The default value for a string
+   * label is an empty string, for an integer label its 0, and for a boolean
+   * label its `false`.
+   *
+   * Note that there are upper bounds on the maximum number of labels and the
+   * number of active time series that are allowed in a project.
+   * 
+ * + * map<string, string> label_extractors = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.lang.String getLabelExtractorsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Optional. The `bucket_options` are required when the logs-based metric is
+   * using a DISTRIBUTION value type and it describes the bucket boundaries
+   * used to create a histogram of the extracted values.
+   * 
+ * + * + * .google.api.Distribution.BucketOptions bucket_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the bucketOptions field is set. + */ + boolean hasBucketOptions(); + + /** + * + * + *
+   * Optional. The `bucket_options` are required when the logs-based metric is
+   * using a DISTRIBUTION value type and it describes the bucket boundaries
+   * used to create a histogram of the extracted values.
+   * 
+ * + * + * .google.api.Distribution.BucketOptions bucket_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The bucketOptions. + */ + com.google.api.Distribution.BucketOptions getBucketOptions(); + + /** + * + * + *
+   * Optional. The `bucket_options` are required when the logs-based metric is
+   * using a DISTRIBUTION value type and it describes the bucket boundaries
+   * used to create a histogram of the extracted values.
+   * 
+ * + * + * .google.api.Distribution.BucketOptions bucket_options = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.api.Distribution.BucketOptionsOrBuilder getBucketOptionsOrBuilder(); + + /** + * + * + *
+   * Output only. The creation timestamp of the metric.
+   *
+   * This field may not be present for older metrics.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + + /** + * + * + *
+   * Output only. The creation timestamp of the metric.
+   *
+   * This field may not be present for older metrics.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + + /** + * + * + *
+   * Output only. The creation timestamp of the metric.
+   *
+   * This field may not be present for older metrics.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The last update timestamp of the metric.
+   *
+   * This field may not be present for older metrics.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + + /** + * + * + *
+   * Output only. The last update timestamp of the metric.
+   *
+   * This field may not be present for older metrics.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + + /** + * + * + *
+   * Output only. The last update timestamp of the metric.
+   *
+   * This field may not be present for older metrics.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Deprecated. The API version that created or updated this metric.
+   * The v2 format is used by default and cannot be changed.
+   * 
+ * + * .google.logging.v2.LogMetric.ApiVersion version = 4 [deprecated = true]; + * + * @deprecated google.logging.v2.LogMetric.version is deprecated. See + * google/logging/v2/logging_metrics.proto;l=237 + * @return The enum numeric value on the wire for version. + */ + @java.lang.Deprecated + int getVersionValue(); + + /** + * + * + *
+   * Deprecated. The API version that created or updated this metric.
+   * The v2 format is used by default and cannot be changed.
+   * 
+ * + * .google.logging.v2.LogMetric.ApiVersion version = 4 [deprecated = true]; + * + * @deprecated google.logging.v2.LogMetric.version is deprecated. See + * google/logging/v2/logging_metrics.proto;l=237 + * @return The version. + */ + @java.lang.Deprecated + com.google.logging.v2.LogMetric.ApiVersion getVersion(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogName.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogName.java new file mode 100644 index 000000000000..4dbeb75d03eb --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogName.java @@ -0,0 +1,429 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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.logging.v2; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.pathtemplate.ValidationException; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class LogName implements ResourceName { + private static final PathTemplate PROJECT_LOG = + PathTemplate.createWithoutUrlEncoding("projects/{project}/logs/{log}"); + private static final PathTemplate ORGANIZATION_LOG = + PathTemplate.createWithoutUrlEncoding("organizations/{organization}/logs/{log}"); + private static final PathTemplate FOLDER_LOG = + PathTemplate.createWithoutUrlEncoding("folders/{folder}/logs/{log}"); + private static final PathTemplate BILLING_ACCOUNT_LOG = + PathTemplate.createWithoutUrlEncoding("billingAccounts/{billing_account}/logs/{log}"); + private volatile Map fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; + private final String project; + private final String log; + private final String organization; + private final String folder; + private final String billingAccount; + + @Deprecated + protected LogName() { + project = null; + log = null; + organization = null; + folder = null; + billingAccount = null; + } + + private LogName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + log = Preconditions.checkNotNull(builder.getLog()); + organization = null; + folder = null; + billingAccount = null; + pathTemplate = PROJECT_LOG; + } + + private LogName(OrganizationLogBuilder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + log = Preconditions.checkNotNull(builder.getLog()); + project = null; + folder = null; + billingAccount = null; + pathTemplate = ORGANIZATION_LOG; + } + + private LogName(FolderLogBuilder builder) { + folder = Preconditions.checkNotNull(builder.getFolder()); + log = Preconditions.checkNotNull(builder.getLog()); + project = null; + organization = null; + billingAccount = null; + pathTemplate = FOLDER_LOG; + } + + private LogName(BillingAccountLogBuilder builder) { + billingAccount = Preconditions.checkNotNull(builder.getBillingAccount()); + log = Preconditions.checkNotNull(builder.getLog()); + project = null; + organization = null; + folder = null; + pathTemplate = BILLING_ACCOUNT_LOG; + } + + public String getProject() { + return project; + } + + public String getLog() { + return log; + } + + public String getOrganization() { + return organization; + } + + public String getFolder() { + return folder; + } + + public String getBillingAccount() { + return billingAccount; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public static Builder newProjectLogBuilder() { + return new Builder(); + } + + public static OrganizationLogBuilder newOrganizationLogBuilder() { + return new OrganizationLogBuilder(); + } + + public static FolderLogBuilder newFolderLogBuilder() { + return new FolderLogBuilder(); + } + + public static BillingAccountLogBuilder newBillingAccountLogBuilder() { + return new BillingAccountLogBuilder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static LogName of(String project, String log) { + return newBuilder().setProject(project).setLog(log).build(); + } + + public static LogName ofProjectLogName(String project, String log) { + return newBuilder().setProject(project).setLog(log).build(); + } + + public static LogName ofOrganizationLogName(String organization, String log) { + return newOrganizationLogBuilder().setOrganization(organization).setLog(log).build(); + } + + public static LogName ofFolderLogName(String folder, String log) { + return newFolderLogBuilder().setFolder(folder).setLog(log).build(); + } + + public static LogName ofBillingAccountLogName(String billingAccount, String log) { + return newBillingAccountLogBuilder().setBillingAccount(billingAccount).setLog(log).build(); + } + + public static String format(String project, String log) { + return newBuilder().setProject(project).setLog(log).build().toString(); + } + + public static String formatProjectLogName(String project, String log) { + return newBuilder().setProject(project).setLog(log).build().toString(); + } + + public static String formatOrganizationLogName(String organization, String log) { + return newOrganizationLogBuilder().setOrganization(organization).setLog(log).build().toString(); + } + + public static String formatFolderLogName(String folder, String log) { + return newFolderLogBuilder().setFolder(folder).setLog(log).build().toString(); + } + + public static String formatBillingAccountLogName(String billingAccount, String log) { + return newBillingAccountLogBuilder() + .setBillingAccount(billingAccount) + .setLog(log) + .build() + .toString(); + } + + public static LogName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + if (PROJECT_LOG.matches(formattedString)) { + Map matchMap = PROJECT_LOG.match(formattedString); + return ofProjectLogName(matchMap.get("project"), matchMap.get("log")); + } else if (ORGANIZATION_LOG.matches(formattedString)) { + Map matchMap = ORGANIZATION_LOG.match(formattedString); + return ofOrganizationLogName(matchMap.get("organization"), matchMap.get("log")); + } else if (FOLDER_LOG.matches(formattedString)) { + Map matchMap = FOLDER_LOG.match(formattedString); + return ofFolderLogName(matchMap.get("folder"), matchMap.get("log")); + } else if (BILLING_ACCOUNT_LOG.matches(formattedString)) { + Map matchMap = BILLING_ACCOUNT_LOG.match(formattedString); + return ofBillingAccountLogName(matchMap.get("billing_account"), matchMap.get("log")); + } + throw new ValidationException("LogName.parse: formattedString not in valid format"); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (LogName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOG.matches(formattedString) + || ORGANIZATION_LOG.matches(formattedString) + || FOLDER_LOG.matches(formattedString) + || BILLING_ACCOUNT_LOG.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (log != null) { + fieldMapBuilder.put("log", log); + } + if (organization != null) { + fieldMapBuilder.put("organization", organization); + } + if (folder != null) { + fieldMapBuilder.put("folder", folder); + } + if (billingAccount != null) { + fieldMapBuilder.put("billing_account", billingAccount); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + LogName that = ((LogName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.log, that.log) + && Objects.equals(this.organization, that.organization) + && Objects.equals(this.folder, that.folder) + && Objects.equals(this.billingAccount, that.billingAccount); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(fixedValue); + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(log); + h *= 1000003; + h ^= Objects.hashCode(organization); + h *= 1000003; + h ^= Objects.hashCode(folder); + h *= 1000003; + h ^= Objects.hashCode(billingAccount); + return h; + } + + /** Builder for projects/{project}/logs/{log}. */ + public static class Builder { + private String project; + private String log; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLog() { + return log; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLog(String log) { + this.log = log; + return this; + } + + private Builder(LogName logName) { + Preconditions.checkArgument( + Objects.equals(logName.pathTemplate, PROJECT_LOG), + "toBuilder is only supported when LogName has the pattern of" + + " projects/{project}/logs/{log}"); + this.project = logName.project; + this.log = logName.log; + } + + public LogName build() { + return new LogName(this); + } + } + + /** Builder for organizations/{organization}/logs/{log}. */ + public static class OrganizationLogBuilder { + private String organization; + private String log; + + protected OrganizationLogBuilder() {} + + public String getOrganization() { + return organization; + } + + public String getLog() { + return log; + } + + public OrganizationLogBuilder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public OrganizationLogBuilder setLog(String log) { + this.log = log; + return this; + } + + public LogName build() { + return new LogName(this); + } + } + + /** Builder for folders/{folder}/logs/{log}. */ + public static class FolderLogBuilder { + private String folder; + private String log; + + protected FolderLogBuilder() {} + + public String getFolder() { + return folder; + } + + public String getLog() { + return log; + } + + public FolderLogBuilder setFolder(String folder) { + this.folder = folder; + return this; + } + + public FolderLogBuilder setLog(String log) { + this.log = log; + return this; + } + + public LogName build() { + return new LogName(this); + } + } + + /** Builder for billingAccounts/{billing_account}/logs/{log}. */ + public static class BillingAccountLogBuilder { + private String billingAccount; + private String log; + + protected BillingAccountLogBuilder() {} + + public String getBillingAccount() { + return billingAccount; + } + + public String getLog() { + return log; + } + + public BillingAccountLogBuilder setBillingAccount(String billingAccount) { + this.billingAccount = billingAccount; + return this; + } + + public BillingAccountLogBuilder setLog(String log) { + this.log = log; + return this; + } + + public LogName build() { + return new LogName(this); + } + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogSink.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogSink.java new file mode 100644 index 000000000000..5c7d23dfeba2 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogSink.java @@ -0,0 +1,4016 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * Describes a sink used to export log entries to one of the following
+ * destinations in any project: a Cloud Storage bucket, a BigQuery dataset, a
+ * Pub/Sub topic or a Cloud Logging log bucket. A logs filter controls which log
+ * entries are exported. The sink must be created within a project,
+ * organization, billing account, or folder.
+ * 
+ * + * Protobuf type {@code google.logging.v2.LogSink} + */ +public final class LogSink extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.LogSink) + LogSinkOrBuilder { + private static final long serialVersionUID = 0L; + + // Use LogSink.newBuilder() to construct. + private LogSink(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private LogSink() { + name_ = ""; + destination_ = ""; + filter_ = ""; + description_ = ""; + exclusions_ = java.util.Collections.emptyList(); + outputVersionFormat_ = 0; + writerIdentity_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new LogSink(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_LogSink_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_LogSink_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.LogSink.class, com.google.logging.v2.LogSink.Builder.class); + } + + /** + * + * + *
+   * Deprecated. This is unused.
+   * 
+ * + * Protobuf enum {@code google.logging.v2.LogSink.VersionFormat} + */ + public enum VersionFormat implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * An unspecified format version that will default to V2.
+     * 
+ * + * VERSION_FORMAT_UNSPECIFIED = 0; + */ + VERSION_FORMAT_UNSPECIFIED(0), + /** + * + * + *
+     * `LogEntry` version 2 format.
+     * 
+ * + * V2 = 1; + */ + V2(1), + /** + * + * + *
+     * `LogEntry` version 1 format.
+     * 
+ * + * V1 = 2; + */ + V1(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * An unspecified format version that will default to V2.
+     * 
+ * + * VERSION_FORMAT_UNSPECIFIED = 0; + */ + public static final int VERSION_FORMAT_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+     * `LogEntry` version 2 format.
+     * 
+ * + * V2 = 1; + */ + public static final int V2_VALUE = 1; + + /** + * + * + *
+     * `LogEntry` version 1 format.
+     * 
+ * + * V1 = 2; + */ + public static final int V1_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static VersionFormat 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 VersionFormat forNumber(int value) { + switch (value) { + case 0: + return VERSION_FORMAT_UNSPECIFIED; + case 1: + return V2; + case 2: + return V1; + 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 VersionFormat findValueByNumber(int number) { + return VersionFormat.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.logging.v2.LogSink.getDescriptor().getEnumTypes().get(0); + } + + private static final VersionFormat[] VALUES = values(); + + public static VersionFormat 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 VersionFormat(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.logging.v2.LogSink.VersionFormat) + } + + private int bitField0_; + private int optionsCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object options_; + + public enum OptionsCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + BIGQUERY_OPTIONS(12), + OPTIONS_NOT_SET(0); + private final int value; + + private OptionsCase(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 OptionsCase valueOf(int value) { + return forNumber(value); + } + + public static OptionsCase forNumber(int value) { + switch (value) { + case 12: + return BIGQUERY_OPTIONS; + case 0: + return OPTIONS_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public OptionsCase getOptionsCase() { + return OptionsCase.forNumber(optionsCase_); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. The client-assigned sink identifier, unique within the project.
+   *
+   * For example: `"my-syslog-errors-to-pubsub"`. Sink identifiers are limited
+   * to 100 characters and can include only the following characters: upper and
+   * lower-case alphanumeric characters, underscores, hyphens, and periods.
+   * First character has to be alphanumeric.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The client-assigned sink identifier, unique within the project.
+   *
+   * For example: `"my-syslog-errors-to-pubsub"`. Sink identifiers are limited
+   * to 100 characters and can include only the following characters: upper and
+   * lower-case alphanumeric characters, underscores, hyphens, and periods.
+   * First character has to be alphanumeric.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESTINATION_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object destination_ = ""; + + /** + * + * + *
+   * Required. The export destination:
+   *
+   *     "storage.googleapis.com/[GCS_BUCKET]"
+   *     "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]"
+   *     "pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]"
+   *
+   * The sink's `writer_identity`, set when the sink is created, must have
+   * permission to write to the destination or else the log entries are not
+   * exported. For more information, see
+   * [Exporting Logs with
+   * Sinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs).
+   * 
+ * + * + * string destination = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The destination. + */ + @java.lang.Override + public java.lang.String getDestination() { + java.lang.Object ref = destination_; + 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(); + destination_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The export destination:
+   *
+   *     "storage.googleapis.com/[GCS_BUCKET]"
+   *     "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]"
+   *     "pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]"
+   *
+   * The sink's `writer_identity`, set when the sink is created, must have
+   * permission to write to the destination or else the log entries are not
+   * exported. For more information, see
+   * [Exporting Logs with
+   * Sinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs).
+   * 
+ * + * + * string destination = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for destination. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDestinationBytes() { + java.lang.Object ref = destination_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + destination_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + + /** + * + * + *
+   * Optional. An [advanced logs
+   * filter](https://cloud.google.com/logging/docs/view/advanced-queries). The
+   * only exported log entries are those that are in the resource owning the
+   * sink and that match the filter.
+   *
+   * For example:
+   *
+   *   `logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR`
+   * 
+ * + * string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. An [advanced logs
+   * filter](https://cloud.google.com/logging/docs/view/advanced-queries). The
+   * only exported log entries are those that are in the resource owning the
+   * sink and that match the filter.
+   *
+   * For example:
+   *
+   *   `logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR`
+   * 
+ * + * string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 18; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + + /** + * + * + *
+   * Optional. A description of this sink.
+   *
+   * The maximum length of the description is 8000 characters.
+   * 
+ * + * string description = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. A description of this sink.
+   *
+   * The maximum length of the description is 8000 characters.
+   * 
+ * + * string description = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISABLED_FIELD_NUMBER = 19; + private boolean disabled_ = false; + + /** + * + * + *
+   * Optional. If set to true, then this sink is disabled and it does not export
+   * any log entries.
+   * 
+ * + * bool disabled = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The disabled. + */ + @java.lang.Override + public boolean getDisabled() { + return disabled_; + } + + public static final int EXCLUSIONS_FIELD_NUMBER = 16; + + @SuppressWarnings("serial") + private java.util.List exclusions_; + + /** + * + * + *
+   * Optional. Log entries that match any of these exclusion filters will not be
+   * exported.
+   *
+   * If a log entry is matched by both `filter` and one of `exclusion_filters`
+   * it will not be exported.
+   * 
+ * + * + * repeated .google.logging.v2.LogExclusion exclusions = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List getExclusionsList() { + return exclusions_; + } + + /** + * + * + *
+   * Optional. Log entries that match any of these exclusion filters will not be
+   * exported.
+   *
+   * If a log entry is matched by both `filter` and one of `exclusion_filters`
+   * it will not be exported.
+   * 
+ * + * + * repeated .google.logging.v2.LogExclusion exclusions = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List + getExclusionsOrBuilderList() { + return exclusions_; + } + + /** + * + * + *
+   * Optional. Log entries that match any of these exclusion filters will not be
+   * exported.
+   *
+   * If a log entry is matched by both `filter` and one of `exclusion_filters`
+   * it will not be exported.
+   * 
+ * + * + * repeated .google.logging.v2.LogExclusion exclusions = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public int getExclusionsCount() { + return exclusions_.size(); + } + + /** + * + * + *
+   * Optional. Log entries that match any of these exclusion filters will not be
+   * exported.
+   *
+   * If a log entry is matched by both `filter` and one of `exclusion_filters`
+   * it will not be exported.
+   * 
+ * + * + * repeated .google.logging.v2.LogExclusion exclusions = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.logging.v2.LogExclusion getExclusions(int index) { + return exclusions_.get(index); + } + + /** + * + * + *
+   * Optional. Log entries that match any of these exclusion filters will not be
+   * exported.
+   *
+   * If a log entry is matched by both `filter` and one of `exclusion_filters`
+   * it will not be exported.
+   * 
+ * + * + * repeated .google.logging.v2.LogExclusion exclusions = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.logging.v2.LogExclusionOrBuilder getExclusionsOrBuilder(int index) { + return exclusions_.get(index); + } + + public static final int OUTPUT_VERSION_FORMAT_FIELD_NUMBER = 6; + private int outputVersionFormat_ = 0; + + /** + * + * + *
+   * Deprecated. This field is unused.
+   * 
+ * + * .google.logging.v2.LogSink.VersionFormat output_version_format = 6 [deprecated = true]; + * + * + * @deprecated google.logging.v2.LogSink.output_version_format is deprecated. See + * google/logging/v2/logging_config.proto;l=1000 + * @return The enum numeric value on the wire for outputVersionFormat. + */ + @java.lang.Override + @java.lang.Deprecated + public int getOutputVersionFormatValue() { + return outputVersionFormat_; + } + + /** + * + * + *
+   * Deprecated. This field is unused.
+   * 
+ * + * .google.logging.v2.LogSink.VersionFormat output_version_format = 6 [deprecated = true]; + * + * + * @deprecated google.logging.v2.LogSink.output_version_format is deprecated. See + * google/logging/v2/logging_config.proto;l=1000 + * @return The outputVersionFormat. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.logging.v2.LogSink.VersionFormat getOutputVersionFormat() { + com.google.logging.v2.LogSink.VersionFormat result = + com.google.logging.v2.LogSink.VersionFormat.forNumber(outputVersionFormat_); + return result == null ? com.google.logging.v2.LogSink.VersionFormat.UNRECOGNIZED : result; + } + + public static final int WRITER_IDENTITY_FIELD_NUMBER = 8; + + @SuppressWarnings("serial") + private volatile java.lang.Object writerIdentity_ = ""; + + /** + * + * + *
+   * Output only. An IAM identity&mdash;a service account or group&mdash;under
+   * which Cloud Logging writes the exported log entries to the sink's
+   * destination. This field is either set by specifying
+   * `custom_writer_identity` or set automatically by
+   * [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink] and
+   * [sinks.update][google.logging.v2.ConfigServiceV2.UpdateSink] based on the
+   * value of `unique_writer_identity` in those methods.
+   *
+   * Until you grant this identity write-access to the destination, log entry
+   * exports from this sink will fail. For more information, see [Granting
+   * Access for a
+   * Resource](https://cloud.google.com/iam/docs/granting-roles-to-service-accounts#granting_access_to_a_service_account_for_a_resource).
+   * Consult the destination service's documentation to determine the
+   * appropriate IAM roles to assign to the identity.
+   *
+   * Sinks that have a destination that is a log bucket in the same project as
+   * the sink cannot have a writer_identity and no additional permissions are
+   * required.
+   * 
+ * + * string writer_identity = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The writerIdentity. + */ + @java.lang.Override + public java.lang.String getWriterIdentity() { + java.lang.Object ref = writerIdentity_; + 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(); + writerIdentity_ = s; + return s; + } + } + + /** + * + * + *
+   * Output only. An IAM identity&mdash;a service account or group&mdash;under
+   * which Cloud Logging writes the exported log entries to the sink's
+   * destination. This field is either set by specifying
+   * `custom_writer_identity` or set automatically by
+   * [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink] and
+   * [sinks.update][google.logging.v2.ConfigServiceV2.UpdateSink] based on the
+   * value of `unique_writer_identity` in those methods.
+   *
+   * Until you grant this identity write-access to the destination, log entry
+   * exports from this sink will fail. For more information, see [Granting
+   * Access for a
+   * Resource](https://cloud.google.com/iam/docs/granting-roles-to-service-accounts#granting_access_to_a_service_account_for_a_resource).
+   * Consult the destination service's documentation to determine the
+   * appropriate IAM roles to assign to the identity.
+   *
+   * Sinks that have a destination that is a log bucket in the same project as
+   * the sink cannot have a writer_identity and no additional permissions are
+   * required.
+   * 
+ * + * string writer_identity = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for writerIdentity. + */ + @java.lang.Override + public com.google.protobuf.ByteString getWriterIdentityBytes() { + java.lang.Object ref = writerIdentity_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + writerIdentity_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INCLUDE_CHILDREN_FIELD_NUMBER = 9; + private boolean includeChildren_ = false; + + /** + * + * + *
+   * Optional. This field applies only to sinks owned by organizations and
+   * folders. If the field is false, the default, only the logs owned by the
+   * sink's parent resource are available for export. If the field is true, then
+   * log entries from all the projects, folders, and billing accounts contained
+   * in the sink's parent resource are also available for export. Whether a
+   * particular log entry from the children is exported depends on the sink's
+   * filter expression.
+   *
+   * For example, if this field is true, then the filter
+   * `resource.type=gce_instance` would export all Compute Engine VM instance
+   * log entries from all projects in the sink's parent.
+   *
+   * To only export entries from certain child projects, filter on the project
+   * part of the log name:
+   *
+   *   logName:("projects/test-project1/" OR "projects/test-project2/") AND
+   *   resource.type=gce_instance
+   * 
+ * + * bool include_children = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The includeChildren. + */ + @java.lang.Override + public boolean getIncludeChildren() { + return includeChildren_; + } + + public static final int BIGQUERY_OPTIONS_FIELD_NUMBER = 12; + + /** + * + * + *
+   * Optional. Options that affect sinks exporting data to BigQuery.
+   * 
+ * + * + * .google.logging.v2.BigQueryOptions bigquery_options = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the bigqueryOptions field is set. + */ + @java.lang.Override + public boolean hasBigqueryOptions() { + return optionsCase_ == 12; + } + + /** + * + * + *
+   * Optional. Options that affect sinks exporting data to BigQuery.
+   * 
+ * + * + * .google.logging.v2.BigQueryOptions bigquery_options = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The bigqueryOptions. + */ + @java.lang.Override + public com.google.logging.v2.BigQueryOptions getBigqueryOptions() { + if (optionsCase_ == 12) { + return (com.google.logging.v2.BigQueryOptions) options_; + } + return com.google.logging.v2.BigQueryOptions.getDefaultInstance(); + } + + /** + * + * + *
+   * Optional. Options that affect sinks exporting data to BigQuery.
+   * 
+ * + * + * .google.logging.v2.BigQueryOptions bigquery_options = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.logging.v2.BigQueryOptionsOrBuilder getBigqueryOptionsOrBuilder() { + if (optionsCase_ == 12) { + return (com.google.logging.v2.BigQueryOptions) options_; + } + return com.google.logging.v2.BigQueryOptions.getDefaultInstance(); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 13; + private com.google.protobuf.Timestamp createTime_; + + /** + * + * + *
+   * Output only. The creation timestamp of the sink.
+   *
+   * This field may not be present for older sinks.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Output only. The creation timestamp of the sink.
+   *
+   * This field may not be present for older sinks.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + /** + * + * + *
+   * Output only. The creation timestamp of the sink.
+   *
+   * This field may not be present for older sinks.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 14; + private com.google.protobuf.Timestamp updateTime_; + + /** + * + * + *
+   * Output only. The last update timestamp of the sink.
+   *
+   * This field may not be present for older sinks.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Output only. The last update timestamp of the sink.
+   *
+   * This field may not be present for older sinks.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + /** + * + * + *
+   * Output only. The last update timestamp of the sink.
+   *
+   * This field may not be present for older sinks.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(destination_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, destination_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, filter_); + } + if (outputVersionFormat_ + != com.google.logging.v2.LogSink.VersionFormat.VERSION_FORMAT_UNSPECIFIED.getNumber()) { + output.writeEnum(6, outputVersionFormat_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(writerIdentity_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, writerIdentity_); + } + if (includeChildren_ != false) { + output.writeBool(9, includeChildren_); + } + if (optionsCase_ == 12) { + output.writeMessage(12, (com.google.logging.v2.BigQueryOptions) options_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(13, getCreateTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(14, getUpdateTime()); + } + for (int i = 0; i < exclusions_.size(); i++) { + output.writeMessage(16, exclusions_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 18, description_); + } + if (disabled_ != false) { + output.writeBool(19, disabled_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(destination_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, destination_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, filter_); + } + if (outputVersionFormat_ + != com.google.logging.v2.LogSink.VersionFormat.VERSION_FORMAT_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(6, outputVersionFormat_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(writerIdentity_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, writerIdentity_); + } + if (includeChildren_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(9, includeChildren_); + } + if (optionsCase_ == 12) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 12, (com.google.logging.v2.BigQueryOptions) options_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(13, getCreateTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(14, getUpdateTime()); + } + for (int i = 0; i < exclusions_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(16, exclusions_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(18, description_); + } + if (disabled_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(19, disabled_); + } + size += getUnknownFields().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.logging.v2.LogSink)) { + return super.equals(obj); + } + com.google.logging.v2.LogSink other = (com.google.logging.v2.LogSink) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDestination().equals(other.getDestination())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (getDisabled() != other.getDisabled()) return false; + if (!getExclusionsList().equals(other.getExclusionsList())) return false; + if (outputVersionFormat_ != other.outputVersionFormat_) return false; + if (!getWriterIdentity().equals(other.getWriterIdentity())) return false; + if (getIncludeChildren() != other.getIncludeChildren()) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (!getOptionsCase().equals(other.getOptionsCase())) return false; + switch (optionsCase_) { + case 12: + if (!getBigqueryOptions().equals(other.getBigqueryOptions())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DESTINATION_FIELD_NUMBER; + hash = (53 * hash) + getDestination().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + DISABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDisabled()); + if (getExclusionsCount() > 0) { + hash = (37 * hash) + EXCLUSIONS_FIELD_NUMBER; + hash = (53 * hash) + getExclusionsList().hashCode(); + } + hash = (37 * hash) + OUTPUT_VERSION_FORMAT_FIELD_NUMBER; + hash = (53 * hash) + outputVersionFormat_; + hash = (37 * hash) + WRITER_IDENTITY_FIELD_NUMBER; + hash = (53 * hash) + getWriterIdentity().hashCode(); + hash = (37 * hash) + INCLUDE_CHILDREN_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIncludeChildren()); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + switch (optionsCase_) { + case 12: + hash = (37 * hash) + BIGQUERY_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getBigqueryOptions().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.LogSink parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.LogSink parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.LogSink parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.LogSink 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.logging.v2.LogSink parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.LogSink parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.LogSink parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.LogSink 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.logging.v2.LogSink parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.LogSink 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.logging.v2.LogSink parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.LogSink 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.logging.v2.LogSink 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; + } + + /** + * + * + *
+   * Describes a sink used to export log entries to one of the following
+   * destinations in any project: a Cloud Storage bucket, a BigQuery dataset, a
+   * Pub/Sub topic or a Cloud Logging log bucket. A logs filter controls which log
+   * entries are exported. The sink must be created within a project,
+   * organization, billing account, or folder.
+   * 
+ * + * Protobuf type {@code google.logging.v2.LogSink} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.LogSink) + com.google.logging.v2.LogSinkOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_LogSink_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_LogSink_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.LogSink.class, com.google.logging.v2.LogSink.Builder.class); + } + + // Construct using com.google.logging.v2.LogSink.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getExclusionsFieldBuilder(); + getCreateTimeFieldBuilder(); + getUpdateTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + destination_ = ""; + filter_ = ""; + description_ = ""; + disabled_ = false; + if (exclusionsBuilder_ == null) { + exclusions_ = java.util.Collections.emptyList(); + } else { + exclusions_ = null; + exclusionsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000020); + outputVersionFormat_ = 0; + writerIdentity_ = ""; + includeChildren_ = false; + if (bigqueryOptionsBuilder_ != null) { + bigqueryOptionsBuilder_.clear(); + } + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + optionsCase_ = 0; + options_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_LogSink_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.LogSink getDefaultInstanceForType() { + return com.google.logging.v2.LogSink.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.LogSink build() { + com.google.logging.v2.LogSink result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.LogSink buildPartial() { + com.google.logging.v2.LogSink result = new com.google.logging.v2.LogSink(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.logging.v2.LogSink result) { + if (exclusionsBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0)) { + exclusions_ = java.util.Collections.unmodifiableList(exclusions_); + bitField0_ = (bitField0_ & ~0x00000020); + } + result.exclusions_ = exclusions_; + } else { + result.exclusions_ = exclusionsBuilder_.build(); + } + } + + private void buildPartial0(com.google.logging.v2.LogSink result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.destination_ = destination_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.filter_ = filter_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.description_ = description_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.disabled_ = disabled_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.outputVersionFormat_ = outputVersionFormat_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.writerIdentity_ = writerIdentity_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.includeChildren_ = includeChildren_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000400) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + private void buildPartialOneofs(com.google.logging.v2.LogSink result) { + result.optionsCase_ = optionsCase_; + result.options_ = this.options_; + if (optionsCase_ == 12 && bigqueryOptionsBuilder_ != null) { + result.options_ = bigqueryOptionsBuilder_.build(); + } + } + + @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.logging.v2.LogSink) { + return mergeFrom((com.google.logging.v2.LogSink) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.LogSink other) { + if (other == com.google.logging.v2.LogSink.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDestination().isEmpty()) { + destination_ = other.destination_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.getDisabled() != false) { + setDisabled(other.getDisabled()); + } + if (exclusionsBuilder_ == null) { + if (!other.exclusions_.isEmpty()) { + if (exclusions_.isEmpty()) { + exclusions_ = other.exclusions_; + bitField0_ = (bitField0_ & ~0x00000020); + } else { + ensureExclusionsIsMutable(); + exclusions_.addAll(other.exclusions_); + } + onChanged(); + } + } else { + if (!other.exclusions_.isEmpty()) { + if (exclusionsBuilder_.isEmpty()) { + exclusionsBuilder_.dispose(); + exclusionsBuilder_ = null; + exclusions_ = other.exclusions_; + bitField0_ = (bitField0_ & ~0x00000020); + exclusionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getExclusionsFieldBuilder() + : null; + } else { + exclusionsBuilder_.addAllMessages(other.exclusions_); + } + } + } + if (other.outputVersionFormat_ != 0) { + setOutputVersionFormatValue(other.getOutputVersionFormatValue()); + } + if (!other.getWriterIdentity().isEmpty()) { + writerIdentity_ = other.writerIdentity_; + bitField0_ |= 0x00000080; + onChanged(); + } + if (other.getIncludeChildren() != false) { + setIncludeChildren(other.getIncludeChildren()); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + switch (other.getOptionsCase()) { + case BIGQUERY_OPTIONS: + { + mergeBigqueryOptions(other.getBigqueryOptions()); + break; + } + case OPTIONS_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 26: + { + destination_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 26 + case 42: + { + filter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 42 + case 48: + { + outputVersionFormat_ = input.readEnum(); + bitField0_ |= 0x00000040; + break; + } // case 48 + case 66: + { + writerIdentity_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000080; + break; + } // case 66 + case 72: + { + includeChildren_ = input.readBool(); + bitField0_ |= 0x00000100; + break; + } // case 72 + case 98: + { + input.readMessage(getBigqueryOptionsFieldBuilder().getBuilder(), extensionRegistry); + optionsCase_ = 12; + break; + } // case 98 + case 106: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000400; + break; + } // case 106 + case 114: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000800; + break; + } // case 114 + case 130: + { + com.google.logging.v2.LogExclusion m = + input.readMessage( + com.google.logging.v2.LogExclusion.parser(), extensionRegistry); + if (exclusionsBuilder_ == null) { + ensureExclusionsIsMutable(); + exclusions_.add(m); + } else { + exclusionsBuilder_.addMessage(m); + } + break; + } // case 130 + case 146: + { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 146 + case 152: + { + disabled_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 152 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int optionsCase_ = 0; + private java.lang.Object options_; + + public OptionsCase getOptionsCase() { + return OptionsCase.forNumber(optionsCase_); + } + + public Builder clearOptions() { + optionsCase_ = 0; + options_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. The client-assigned sink identifier, unique within the project.
+     *
+     * For example: `"my-syslog-errors-to-pubsub"`. Sink identifiers are limited
+     * to 100 characters and can include only the following characters: upper and
+     * lower-case alphanumeric characters, underscores, hyphens, and periods.
+     * First character has to be alphanumeric.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The client-assigned sink identifier, unique within the project.
+     *
+     * For example: `"my-syslog-errors-to-pubsub"`. Sink identifiers are limited
+     * to 100 characters and can include only the following characters: upper and
+     * lower-case alphanumeric characters, underscores, hyphens, and periods.
+     * First character has to be alphanumeric.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The client-assigned sink identifier, unique within the project.
+     *
+     * For example: `"my-syslog-errors-to-pubsub"`. Sink identifiers are limited
+     * to 100 characters and can include only the following characters: upper and
+     * lower-case alphanumeric characters, underscores, hyphens, and periods.
+     * First character has to be alphanumeric.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The client-assigned sink identifier, unique within the project.
+     *
+     * For example: `"my-syslog-errors-to-pubsub"`. Sink identifiers are limited
+     * to 100 characters and can include only the following characters: upper and
+     * lower-case alphanumeric characters, underscores, hyphens, and periods.
+     * First character has to be alphanumeric.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The client-assigned sink identifier, unique within the project.
+     *
+     * For example: `"my-syslog-errors-to-pubsub"`. Sink identifiers are limited
+     * to 100 characters and can include only the following characters: upper and
+     * lower-case alphanumeric characters, underscores, hyphens, and periods.
+     * First character has to be alphanumeric.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object destination_ = ""; + + /** + * + * + *
+     * Required. The export destination:
+     *
+     *     "storage.googleapis.com/[GCS_BUCKET]"
+     *     "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]"
+     *     "pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]"
+     *
+     * The sink's `writer_identity`, set when the sink is created, must have
+     * permission to write to the destination or else the log entries are not
+     * exported. For more information, see
+     * [Exporting Logs with
+     * Sinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs).
+     * 
+ * + * + * string destination = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The destination. + */ + public java.lang.String getDestination() { + java.lang.Object ref = destination_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + destination_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The export destination:
+     *
+     *     "storage.googleapis.com/[GCS_BUCKET]"
+     *     "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]"
+     *     "pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]"
+     *
+     * The sink's `writer_identity`, set when the sink is created, must have
+     * permission to write to the destination or else the log entries are not
+     * exported. For more information, see
+     * [Exporting Logs with
+     * Sinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs).
+     * 
+ * + * + * string destination = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for destination. + */ + public com.google.protobuf.ByteString getDestinationBytes() { + java.lang.Object ref = destination_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + destination_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The export destination:
+     *
+     *     "storage.googleapis.com/[GCS_BUCKET]"
+     *     "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]"
+     *     "pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]"
+     *
+     * The sink's `writer_identity`, set when the sink is created, must have
+     * permission to write to the destination or else the log entries are not
+     * exported. For more information, see
+     * [Exporting Logs with
+     * Sinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs).
+     * 
+ * + * + * string destination = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The destination to set. + * @return This builder for chaining. + */ + public Builder setDestination(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + destination_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The export destination:
+     *
+     *     "storage.googleapis.com/[GCS_BUCKET]"
+     *     "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]"
+     *     "pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]"
+     *
+     * The sink's `writer_identity`, set when the sink is created, must have
+     * permission to write to the destination or else the log entries are not
+     * exported. For more information, see
+     * [Exporting Logs with
+     * Sinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs).
+     * 
+ * + * + * string destination = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearDestination() { + destination_ = getDefaultInstance().getDestination(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The export destination:
+     *
+     *     "storage.googleapis.com/[GCS_BUCKET]"
+     *     "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]"
+     *     "pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]"
+     *
+     * The sink's `writer_identity`, set when the sink is created, must have
+     * permission to write to the destination or else the log entries are not
+     * exported. For more information, see
+     * [Exporting Logs with
+     * Sinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs).
+     * 
+ * + * + * string destination = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for destination to set. + * @return This builder for chaining. + */ + public Builder setDestinationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + destination_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + + /** + * + * + *
+     * Optional. An [advanced logs
+     * filter](https://cloud.google.com/logging/docs/view/advanced-queries). The
+     * only exported log entries are those that are in the resource owning the
+     * sink and that match the filter.
+     *
+     * For example:
+     *
+     *   `logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR`
+     * 
+ * + * string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. An [advanced logs
+     * filter](https://cloud.google.com/logging/docs/view/advanced-queries). The
+     * only exported log entries are those that are in the resource owning the
+     * sink and that match the filter.
+     *
+     * For example:
+     *
+     *   `logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR`
+     * 
+ * + * string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. An [advanced logs
+     * filter](https://cloud.google.com/logging/docs/view/advanced-queries). The
+     * only exported log entries are those that are in the resource owning the
+     * sink and that match the filter.
+     *
+     * For example:
+     *
+     *   `logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR`
+     * 
+ * + * string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. An [advanced logs
+     * filter](https://cloud.google.com/logging/docs/view/advanced-queries). The
+     * only exported log entries are those that are in the resource owning the
+     * sink and that match the filter.
+     *
+     * For example:
+     *
+     *   `logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR`
+     * 
+ * + * string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. An [advanced logs
+     * filter](https://cloud.google.com/logging/docs/view/advanced-queries). The
+     * only exported log entries are those that are in the resource owning the
+     * sink and that match the filter.
+     *
+     * For example:
+     *
+     *   `logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR`
+     * 
+ * + * string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + filter_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + + /** + * + * + *
+     * Optional. A description of this sink.
+     *
+     * The maximum length of the description is 8000 characters.
+     * 
+ * + * string description = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. A description of this sink.
+     *
+     * The maximum length of the description is 8000 characters.
+     * 
+ * + * string description = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for description. + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. A description of this sink.
+     *
+     * The maximum length of the description is 8000 characters.
+     * 
+ * + * string description = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + description_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. A description of this sink.
+     *
+     * The maximum length of the description is 8000 characters.
+     * 
+ * + * string description = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. A description of this sink.
+     *
+     * The maximum length of the description is 8000 characters.
+     * 
+ * + * string description = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + description_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private boolean disabled_; + + /** + * + * + *
+     * Optional. If set to true, then this sink is disabled and it does not export
+     * any log entries.
+     * 
+ * + * bool disabled = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The disabled. + */ + @java.lang.Override + public boolean getDisabled() { + return disabled_; + } + + /** + * + * + *
+     * Optional. If set to true, then this sink is disabled and it does not export
+     * any log entries.
+     * 
+ * + * bool disabled = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The disabled to set. + * @return This builder for chaining. + */ + public Builder setDisabled(boolean value) { + + disabled_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. If set to true, then this sink is disabled and it does not export
+     * any log entries.
+     * 
+ * + * bool disabled = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDisabled() { + bitField0_ = (bitField0_ & ~0x00000010); + disabled_ = false; + onChanged(); + return this; + } + + private java.util.List exclusions_ = + java.util.Collections.emptyList(); + + private void ensureExclusionsIsMutable() { + if (!((bitField0_ & 0x00000020) != 0)) { + exclusions_ = new java.util.ArrayList(exclusions_); + bitField0_ |= 0x00000020; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.logging.v2.LogExclusion, + com.google.logging.v2.LogExclusion.Builder, + com.google.logging.v2.LogExclusionOrBuilder> + exclusionsBuilder_; + + /** + * + * + *
+     * Optional. Log entries that match any of these exclusion filters will not be
+     * exported.
+     *
+     * If a log entry is matched by both `filter` and one of `exclusion_filters`
+     * it will not be exported.
+     * 
+ * + * + * repeated .google.logging.v2.LogExclusion exclusions = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List getExclusionsList() { + if (exclusionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(exclusions_); + } else { + return exclusionsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * Optional. Log entries that match any of these exclusion filters will not be
+     * exported.
+     *
+     * If a log entry is matched by both `filter` and one of `exclusion_filters`
+     * it will not be exported.
+     * 
+ * + * + * repeated .google.logging.v2.LogExclusion exclusions = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public int getExclusionsCount() { + if (exclusionsBuilder_ == null) { + return exclusions_.size(); + } else { + return exclusionsBuilder_.getCount(); + } + } + + /** + * + * + *
+     * Optional. Log entries that match any of these exclusion filters will not be
+     * exported.
+     *
+     * If a log entry is matched by both `filter` and one of `exclusion_filters`
+     * it will not be exported.
+     * 
+ * + * + * repeated .google.logging.v2.LogExclusion exclusions = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.logging.v2.LogExclusion getExclusions(int index) { + if (exclusionsBuilder_ == null) { + return exclusions_.get(index); + } else { + return exclusionsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * Optional. Log entries that match any of these exclusion filters will not be
+     * exported.
+     *
+     * If a log entry is matched by both `filter` and one of `exclusion_filters`
+     * it will not be exported.
+     * 
+ * + * + * repeated .google.logging.v2.LogExclusion exclusions = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setExclusions(int index, com.google.logging.v2.LogExclusion value) { + if (exclusionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExclusionsIsMutable(); + exclusions_.set(index, value); + onChanged(); + } else { + exclusionsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Optional. Log entries that match any of these exclusion filters will not be
+     * exported.
+     *
+     * If a log entry is matched by both `filter` and one of `exclusion_filters`
+     * it will not be exported.
+     * 
+ * + * + * repeated .google.logging.v2.LogExclusion exclusions = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setExclusions( + int index, com.google.logging.v2.LogExclusion.Builder builderForValue) { + if (exclusionsBuilder_ == null) { + ensureExclusionsIsMutable(); + exclusions_.set(index, builderForValue.build()); + onChanged(); + } else { + exclusionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Optional. Log entries that match any of these exclusion filters will not be
+     * exported.
+     *
+     * If a log entry is matched by both `filter` and one of `exclusion_filters`
+     * it will not be exported.
+     * 
+ * + * + * repeated .google.logging.v2.LogExclusion exclusions = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addExclusions(com.google.logging.v2.LogExclusion value) { + if (exclusionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExclusionsIsMutable(); + exclusions_.add(value); + onChanged(); + } else { + exclusionsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * Optional. Log entries that match any of these exclusion filters will not be
+     * exported.
+     *
+     * If a log entry is matched by both `filter` and one of `exclusion_filters`
+     * it will not be exported.
+     * 
+ * + * + * repeated .google.logging.v2.LogExclusion exclusions = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addExclusions(int index, com.google.logging.v2.LogExclusion value) { + if (exclusionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExclusionsIsMutable(); + exclusions_.add(index, value); + onChanged(); + } else { + exclusionsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Optional. Log entries that match any of these exclusion filters will not be
+     * exported.
+     *
+     * If a log entry is matched by both `filter` and one of `exclusion_filters`
+     * it will not be exported.
+     * 
+ * + * + * repeated .google.logging.v2.LogExclusion exclusions = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addExclusions(com.google.logging.v2.LogExclusion.Builder builderForValue) { + if (exclusionsBuilder_ == null) { + ensureExclusionsIsMutable(); + exclusions_.add(builderForValue.build()); + onChanged(); + } else { + exclusionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Optional. Log entries that match any of these exclusion filters will not be
+     * exported.
+     *
+     * If a log entry is matched by both `filter` and one of `exclusion_filters`
+     * it will not be exported.
+     * 
+ * + * + * repeated .google.logging.v2.LogExclusion exclusions = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addExclusions( + int index, com.google.logging.v2.LogExclusion.Builder builderForValue) { + if (exclusionsBuilder_ == null) { + ensureExclusionsIsMutable(); + exclusions_.add(index, builderForValue.build()); + onChanged(); + } else { + exclusionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Optional. Log entries that match any of these exclusion filters will not be
+     * exported.
+     *
+     * If a log entry is matched by both `filter` and one of `exclusion_filters`
+     * it will not be exported.
+     * 
+ * + * + * repeated .google.logging.v2.LogExclusion exclusions = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addAllExclusions( + java.lang.Iterable values) { + if (exclusionsBuilder_ == null) { + ensureExclusionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, exclusions_); + onChanged(); + } else { + exclusionsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * Optional. Log entries that match any of these exclusion filters will not be
+     * exported.
+     *
+     * If a log entry is matched by both `filter` and one of `exclusion_filters`
+     * it will not be exported.
+     * 
+ * + * + * repeated .google.logging.v2.LogExclusion exclusions = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearExclusions() { + if (exclusionsBuilder_ == null) { + exclusions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + } else { + exclusionsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Optional. Log entries that match any of these exclusion filters will not be
+     * exported.
+     *
+     * If a log entry is matched by both `filter` and one of `exclusion_filters`
+     * it will not be exported.
+     * 
+ * + * + * repeated .google.logging.v2.LogExclusion exclusions = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeExclusions(int index) { + if (exclusionsBuilder_ == null) { + ensureExclusionsIsMutable(); + exclusions_.remove(index); + onChanged(); + } else { + exclusionsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * Optional. Log entries that match any of these exclusion filters will not be
+     * exported.
+     *
+     * If a log entry is matched by both `filter` and one of `exclusion_filters`
+     * it will not be exported.
+     * 
+ * + * + * repeated .google.logging.v2.LogExclusion exclusions = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.logging.v2.LogExclusion.Builder getExclusionsBuilder(int index) { + return getExclusionsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * Optional. Log entries that match any of these exclusion filters will not be
+     * exported.
+     *
+     * If a log entry is matched by both `filter` and one of `exclusion_filters`
+     * it will not be exported.
+     * 
+ * + * + * repeated .google.logging.v2.LogExclusion exclusions = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.logging.v2.LogExclusionOrBuilder getExclusionsOrBuilder(int index) { + if (exclusionsBuilder_ == null) { + return exclusions_.get(index); + } else { + return exclusionsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * Optional. Log entries that match any of these exclusion filters will not be
+     * exported.
+     *
+     * If a log entry is matched by both `filter` and one of `exclusion_filters`
+     * it will not be exported.
+     * 
+ * + * + * repeated .google.logging.v2.LogExclusion exclusions = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getExclusionsOrBuilderList() { + if (exclusionsBuilder_ != null) { + return exclusionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(exclusions_); + } + } + + /** + * + * + *
+     * Optional. Log entries that match any of these exclusion filters will not be
+     * exported.
+     *
+     * If a log entry is matched by both `filter` and one of `exclusion_filters`
+     * it will not be exported.
+     * 
+ * + * + * repeated .google.logging.v2.LogExclusion exclusions = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.logging.v2.LogExclusion.Builder addExclusionsBuilder() { + return getExclusionsFieldBuilder() + .addBuilder(com.google.logging.v2.LogExclusion.getDefaultInstance()); + } + + /** + * + * + *
+     * Optional. Log entries that match any of these exclusion filters will not be
+     * exported.
+     *
+     * If a log entry is matched by both `filter` and one of `exclusion_filters`
+     * it will not be exported.
+     * 
+ * + * + * repeated .google.logging.v2.LogExclusion exclusions = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.logging.v2.LogExclusion.Builder addExclusionsBuilder(int index) { + return getExclusionsFieldBuilder() + .addBuilder(index, com.google.logging.v2.LogExclusion.getDefaultInstance()); + } + + /** + * + * + *
+     * Optional. Log entries that match any of these exclusion filters will not be
+     * exported.
+     *
+     * If a log entry is matched by both `filter` and one of `exclusion_filters`
+     * it will not be exported.
+     * 
+ * + * + * repeated .google.logging.v2.LogExclusion exclusions = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List getExclusionsBuilderList() { + return getExclusionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.logging.v2.LogExclusion, + com.google.logging.v2.LogExclusion.Builder, + com.google.logging.v2.LogExclusionOrBuilder> + getExclusionsFieldBuilder() { + if (exclusionsBuilder_ == null) { + exclusionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.logging.v2.LogExclusion, + com.google.logging.v2.LogExclusion.Builder, + com.google.logging.v2.LogExclusionOrBuilder>( + exclusions_, ((bitField0_ & 0x00000020) != 0), getParentForChildren(), isClean()); + exclusions_ = null; + } + return exclusionsBuilder_; + } + + private int outputVersionFormat_ = 0; + + /** + * + * + *
+     * Deprecated. This field is unused.
+     * 
+ * + * .google.logging.v2.LogSink.VersionFormat output_version_format = 6 [deprecated = true]; + * + * + * @deprecated google.logging.v2.LogSink.output_version_format is deprecated. See + * google/logging/v2/logging_config.proto;l=1000 + * @return The enum numeric value on the wire for outputVersionFormat. + */ + @java.lang.Override + @java.lang.Deprecated + public int getOutputVersionFormatValue() { + return outputVersionFormat_; + } + + /** + * + * + *
+     * Deprecated. This field is unused.
+     * 
+ * + * .google.logging.v2.LogSink.VersionFormat output_version_format = 6 [deprecated = true]; + * + * + * @deprecated google.logging.v2.LogSink.output_version_format is deprecated. See + * google/logging/v2/logging_config.proto;l=1000 + * @param value The enum numeric value on the wire for outputVersionFormat to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setOutputVersionFormatValue(int value) { + outputVersionFormat_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** + * + * + *
+     * Deprecated. This field is unused.
+     * 
+ * + * .google.logging.v2.LogSink.VersionFormat output_version_format = 6 [deprecated = true]; + * + * + * @deprecated google.logging.v2.LogSink.output_version_format is deprecated. See + * google/logging/v2/logging_config.proto;l=1000 + * @return The outputVersionFormat. + */ + @java.lang.Override + @java.lang.Deprecated + public com.google.logging.v2.LogSink.VersionFormat getOutputVersionFormat() { + com.google.logging.v2.LogSink.VersionFormat result = + com.google.logging.v2.LogSink.VersionFormat.forNumber(outputVersionFormat_); + return result == null ? com.google.logging.v2.LogSink.VersionFormat.UNRECOGNIZED : result; + } + + /** + * + * + *
+     * Deprecated. This field is unused.
+     * 
+ * + * .google.logging.v2.LogSink.VersionFormat output_version_format = 6 [deprecated = true]; + * + * + * @deprecated google.logging.v2.LogSink.output_version_format is deprecated. See + * google/logging/v2/logging_config.proto;l=1000 + * @param value The outputVersionFormat to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder setOutputVersionFormat(com.google.logging.v2.LogSink.VersionFormat value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000040; + outputVersionFormat_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Deprecated. This field is unused.
+     * 
+ * + * .google.logging.v2.LogSink.VersionFormat output_version_format = 6 [deprecated = true]; + * + * + * @deprecated google.logging.v2.LogSink.output_version_format is deprecated. See + * google/logging/v2/logging_config.proto;l=1000 + * @return This builder for chaining. + */ + @java.lang.Deprecated + public Builder clearOutputVersionFormat() { + bitField0_ = (bitField0_ & ~0x00000040); + outputVersionFormat_ = 0; + onChanged(); + return this; + } + + private java.lang.Object writerIdentity_ = ""; + + /** + * + * + *
+     * Output only. An IAM identity&mdash;a service account or group&mdash;under
+     * which Cloud Logging writes the exported log entries to the sink's
+     * destination. This field is either set by specifying
+     * `custom_writer_identity` or set automatically by
+     * [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink] and
+     * [sinks.update][google.logging.v2.ConfigServiceV2.UpdateSink] based on the
+     * value of `unique_writer_identity` in those methods.
+     *
+     * Until you grant this identity write-access to the destination, log entry
+     * exports from this sink will fail. For more information, see [Granting
+     * Access for a
+     * Resource](https://cloud.google.com/iam/docs/granting-roles-to-service-accounts#granting_access_to_a_service_account_for_a_resource).
+     * Consult the destination service's documentation to determine the
+     * appropriate IAM roles to assign to the identity.
+     *
+     * Sinks that have a destination that is a log bucket in the same project as
+     * the sink cannot have a writer_identity and no additional permissions are
+     * required.
+     * 
+ * + * string writer_identity = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The writerIdentity. + */ + public java.lang.String getWriterIdentity() { + java.lang.Object ref = writerIdentity_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + writerIdentity_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Output only. An IAM identity&mdash;a service account or group&mdash;under
+     * which Cloud Logging writes the exported log entries to the sink's
+     * destination. This field is either set by specifying
+     * `custom_writer_identity` or set automatically by
+     * [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink] and
+     * [sinks.update][google.logging.v2.ConfigServiceV2.UpdateSink] based on the
+     * value of `unique_writer_identity` in those methods.
+     *
+     * Until you grant this identity write-access to the destination, log entry
+     * exports from this sink will fail. For more information, see [Granting
+     * Access for a
+     * Resource](https://cloud.google.com/iam/docs/granting-roles-to-service-accounts#granting_access_to_a_service_account_for_a_resource).
+     * Consult the destination service's documentation to determine the
+     * appropriate IAM roles to assign to the identity.
+     *
+     * Sinks that have a destination that is a log bucket in the same project as
+     * the sink cannot have a writer_identity and no additional permissions are
+     * required.
+     * 
+ * + * string writer_identity = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for writerIdentity. + */ + public com.google.protobuf.ByteString getWriterIdentityBytes() { + java.lang.Object ref = writerIdentity_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + writerIdentity_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Output only. An IAM identity&mdash;a service account or group&mdash;under
+     * which Cloud Logging writes the exported log entries to the sink's
+     * destination. This field is either set by specifying
+     * `custom_writer_identity` or set automatically by
+     * [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink] and
+     * [sinks.update][google.logging.v2.ConfigServiceV2.UpdateSink] based on the
+     * value of `unique_writer_identity` in those methods.
+     *
+     * Until you grant this identity write-access to the destination, log entry
+     * exports from this sink will fail. For more information, see [Granting
+     * Access for a
+     * Resource](https://cloud.google.com/iam/docs/granting-roles-to-service-accounts#granting_access_to_a_service_account_for_a_resource).
+     * Consult the destination service's documentation to determine the
+     * appropriate IAM roles to assign to the identity.
+     *
+     * Sinks that have a destination that is a log bucket in the same project as
+     * the sink cannot have a writer_identity and no additional permissions are
+     * required.
+     * 
+ * + * string writer_identity = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The writerIdentity to set. + * @return This builder for chaining. + */ + public Builder setWriterIdentity(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + writerIdentity_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. An IAM identity&mdash;a service account or group&mdash;under
+     * which Cloud Logging writes the exported log entries to the sink's
+     * destination. This field is either set by specifying
+     * `custom_writer_identity` or set automatically by
+     * [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink] and
+     * [sinks.update][google.logging.v2.ConfigServiceV2.UpdateSink] based on the
+     * value of `unique_writer_identity` in those methods.
+     *
+     * Until you grant this identity write-access to the destination, log entry
+     * exports from this sink will fail. For more information, see [Granting
+     * Access for a
+     * Resource](https://cloud.google.com/iam/docs/granting-roles-to-service-accounts#granting_access_to_a_service_account_for_a_resource).
+     * Consult the destination service's documentation to determine the
+     * appropriate IAM roles to assign to the identity.
+     *
+     * Sinks that have a destination that is a log bucket in the same project as
+     * the sink cannot have a writer_identity and no additional permissions are
+     * required.
+     * 
+ * + * string writer_identity = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearWriterIdentity() { + writerIdentity_ = getDefaultInstance().getWriterIdentity(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. An IAM identity&mdash;a service account or group&mdash;under
+     * which Cloud Logging writes the exported log entries to the sink's
+     * destination. This field is either set by specifying
+     * `custom_writer_identity` or set automatically by
+     * [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink] and
+     * [sinks.update][google.logging.v2.ConfigServiceV2.UpdateSink] based on the
+     * value of `unique_writer_identity` in those methods.
+     *
+     * Until you grant this identity write-access to the destination, log entry
+     * exports from this sink will fail. For more information, see [Granting
+     * Access for a
+     * Resource](https://cloud.google.com/iam/docs/granting-roles-to-service-accounts#granting_access_to_a_service_account_for_a_resource).
+     * Consult the destination service's documentation to determine the
+     * appropriate IAM roles to assign to the identity.
+     *
+     * Sinks that have a destination that is a log bucket in the same project as
+     * the sink cannot have a writer_identity and no additional permissions are
+     * required.
+     * 
+ * + * string writer_identity = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for writerIdentity to set. + * @return This builder for chaining. + */ + public Builder setWriterIdentityBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + writerIdentity_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + private boolean includeChildren_; + + /** + * + * + *
+     * Optional. This field applies only to sinks owned by organizations and
+     * folders. If the field is false, the default, only the logs owned by the
+     * sink's parent resource are available for export. If the field is true, then
+     * log entries from all the projects, folders, and billing accounts contained
+     * in the sink's parent resource are also available for export. Whether a
+     * particular log entry from the children is exported depends on the sink's
+     * filter expression.
+     *
+     * For example, if this field is true, then the filter
+     * `resource.type=gce_instance` would export all Compute Engine VM instance
+     * log entries from all projects in the sink's parent.
+     *
+     * To only export entries from certain child projects, filter on the project
+     * part of the log name:
+     *
+     *   logName:("projects/test-project1/" OR "projects/test-project2/") AND
+     *   resource.type=gce_instance
+     * 
+ * + * bool include_children = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The includeChildren. + */ + @java.lang.Override + public boolean getIncludeChildren() { + return includeChildren_; + } + + /** + * + * + *
+     * Optional. This field applies only to sinks owned by organizations and
+     * folders. If the field is false, the default, only the logs owned by the
+     * sink's parent resource are available for export. If the field is true, then
+     * log entries from all the projects, folders, and billing accounts contained
+     * in the sink's parent resource are also available for export. Whether a
+     * particular log entry from the children is exported depends on the sink's
+     * filter expression.
+     *
+     * For example, if this field is true, then the filter
+     * `resource.type=gce_instance` would export all Compute Engine VM instance
+     * log entries from all projects in the sink's parent.
+     *
+     * To only export entries from certain child projects, filter on the project
+     * part of the log name:
+     *
+     *   logName:("projects/test-project1/" OR "projects/test-project2/") AND
+     *   resource.type=gce_instance
+     * 
+ * + * bool include_children = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The includeChildren to set. + * @return This builder for chaining. + */ + public Builder setIncludeChildren(boolean value) { + + includeChildren_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. This field applies only to sinks owned by organizations and
+     * folders. If the field is false, the default, only the logs owned by the
+     * sink's parent resource are available for export. If the field is true, then
+     * log entries from all the projects, folders, and billing accounts contained
+     * in the sink's parent resource are also available for export. Whether a
+     * particular log entry from the children is exported depends on the sink's
+     * filter expression.
+     *
+     * For example, if this field is true, then the filter
+     * `resource.type=gce_instance` would export all Compute Engine VM instance
+     * log entries from all projects in the sink's parent.
+     *
+     * To only export entries from certain child projects, filter on the project
+     * part of the log name:
+     *
+     *   logName:("projects/test-project1/" OR "projects/test-project2/") AND
+     *   resource.type=gce_instance
+     * 
+ * + * bool include_children = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearIncludeChildren() { + bitField0_ = (bitField0_ & ~0x00000100); + includeChildren_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.BigQueryOptions, + com.google.logging.v2.BigQueryOptions.Builder, + com.google.logging.v2.BigQueryOptionsOrBuilder> + bigqueryOptionsBuilder_; + + /** + * + * + *
+     * Optional. Options that affect sinks exporting data to BigQuery.
+     * 
+ * + * + * .google.logging.v2.BigQueryOptions bigquery_options = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the bigqueryOptions field is set. + */ + @java.lang.Override + public boolean hasBigqueryOptions() { + return optionsCase_ == 12; + } + + /** + * + * + *
+     * Optional. Options that affect sinks exporting data to BigQuery.
+     * 
+ * + * + * .google.logging.v2.BigQueryOptions bigquery_options = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The bigqueryOptions. + */ + @java.lang.Override + public com.google.logging.v2.BigQueryOptions getBigqueryOptions() { + if (bigqueryOptionsBuilder_ == null) { + if (optionsCase_ == 12) { + return (com.google.logging.v2.BigQueryOptions) options_; + } + return com.google.logging.v2.BigQueryOptions.getDefaultInstance(); + } else { + if (optionsCase_ == 12) { + return bigqueryOptionsBuilder_.getMessage(); + } + return com.google.logging.v2.BigQueryOptions.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Optional. Options that affect sinks exporting data to BigQuery.
+     * 
+ * + * + * .google.logging.v2.BigQueryOptions bigquery_options = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setBigqueryOptions(com.google.logging.v2.BigQueryOptions value) { + if (bigqueryOptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + options_ = value; + onChanged(); + } else { + bigqueryOptionsBuilder_.setMessage(value); + } + optionsCase_ = 12; + return this; + } + + /** + * + * + *
+     * Optional. Options that affect sinks exporting data to BigQuery.
+     * 
+ * + * + * .google.logging.v2.BigQueryOptions bigquery_options = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setBigqueryOptions( + com.google.logging.v2.BigQueryOptions.Builder builderForValue) { + if (bigqueryOptionsBuilder_ == null) { + options_ = builderForValue.build(); + onChanged(); + } else { + bigqueryOptionsBuilder_.setMessage(builderForValue.build()); + } + optionsCase_ = 12; + return this; + } + + /** + * + * + *
+     * Optional. Options that affect sinks exporting data to BigQuery.
+     * 
+ * + * + * .google.logging.v2.BigQueryOptions bigquery_options = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeBigqueryOptions(com.google.logging.v2.BigQueryOptions value) { + if (bigqueryOptionsBuilder_ == null) { + if (optionsCase_ == 12 + && options_ != com.google.logging.v2.BigQueryOptions.getDefaultInstance()) { + options_ = + com.google.logging.v2.BigQueryOptions.newBuilder( + (com.google.logging.v2.BigQueryOptions) options_) + .mergeFrom(value) + .buildPartial(); + } else { + options_ = value; + } + onChanged(); + } else { + if (optionsCase_ == 12) { + bigqueryOptionsBuilder_.mergeFrom(value); + } else { + bigqueryOptionsBuilder_.setMessage(value); + } + } + optionsCase_ = 12; + return this; + } + + /** + * + * + *
+     * Optional. Options that affect sinks exporting data to BigQuery.
+     * 
+ * + * + * .google.logging.v2.BigQueryOptions bigquery_options = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearBigqueryOptions() { + if (bigqueryOptionsBuilder_ == null) { + if (optionsCase_ == 12) { + optionsCase_ = 0; + options_ = null; + onChanged(); + } + } else { + if (optionsCase_ == 12) { + optionsCase_ = 0; + options_ = null; + } + bigqueryOptionsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Optional. Options that affect sinks exporting data to BigQuery.
+     * 
+ * + * + * .google.logging.v2.BigQueryOptions bigquery_options = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.logging.v2.BigQueryOptions.Builder getBigqueryOptionsBuilder() { + return getBigqueryOptionsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. Options that affect sinks exporting data to BigQuery.
+     * 
+ * + * + * .google.logging.v2.BigQueryOptions bigquery_options = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.logging.v2.BigQueryOptionsOrBuilder getBigqueryOptionsOrBuilder() { + if ((optionsCase_ == 12) && (bigqueryOptionsBuilder_ != null)) { + return bigqueryOptionsBuilder_.getMessageOrBuilder(); + } else { + if (optionsCase_ == 12) { + return (com.google.logging.v2.BigQueryOptions) options_; + } + return com.google.logging.v2.BigQueryOptions.getDefaultInstance(); + } + } + + /** + * + * + *
+     * Optional. Options that affect sinks exporting data to BigQuery.
+     * 
+ * + * + * .google.logging.v2.BigQueryOptions bigquery_options = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.BigQueryOptions, + com.google.logging.v2.BigQueryOptions.Builder, + com.google.logging.v2.BigQueryOptionsOrBuilder> + getBigqueryOptionsFieldBuilder() { + if (bigqueryOptionsBuilder_ == null) { + if (!(optionsCase_ == 12)) { + options_ = com.google.logging.v2.BigQueryOptions.getDefaultInstance(); + } + bigqueryOptionsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.BigQueryOptions, + com.google.logging.v2.BigQueryOptions.Builder, + com.google.logging.v2.BigQueryOptionsOrBuilder>( + (com.google.logging.v2.BigQueryOptions) options_, + getParentForChildren(), + isClean()); + options_ = null; + } + optionsCase_ = 12; + onChanged(); + return bigqueryOptionsBuilder_; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + + /** + * + * + *
+     * Output only. The creation timestamp of the sink.
+     *
+     * This field may not be present for older sinks.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000400) != 0); + } + + /** + * + * + *
+     * Output only. The creation timestamp of the sink.
+     *
+     * This field may not be present for older sinks.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Output only. The creation timestamp of the sink.
+     *
+     * This field may not be present for older sinks.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The creation timestamp of the sink.
+     *
+     * This field may not be present for older sinks.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The creation timestamp of the sink.
+     *
+     * This field may not be present for older sinks.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000400) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + if (createTime_ != null) { + bitField0_ |= 0x00000400; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Output only. The creation timestamp of the sink.
+     *
+     * This field may not be present for older sinks.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000400); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The creation timestamp of the sink.
+     *
+     * This field may not be present for older sinks.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000400; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Output only. The creation timestamp of the sink.
+     *
+     * This field may not be present for older sinks.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + + /** + * + * + *
+     * Output only. The creation timestamp of the sink.
+     *
+     * This field may not be present for older sinks.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + + /** + * + * + *
+     * Output only. The last update timestamp of the sink.
+     *
+     * This field may not be present for older sinks.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000800) != 0); + } + + /** + * + * + *
+     * Output only. The last update timestamp of the sink.
+     *
+     * This field may not be present for older sinks.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Output only. The last update timestamp of the sink.
+     *
+     * This field may not be present for older sinks.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + } else { + updateTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The last update timestamp of the sink.
+     *
+     * This field may not be present for older sinks.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The last update timestamp of the sink.
+     *
+     * This field may not be present for older sinks.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000800) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + if (updateTime_ != null) { + bitField0_ |= 0x00000800; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Output only. The last update timestamp of the sink.
+     *
+     * This field may not be present for older sinks.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + bitField0_ = (bitField0_ & ~0x00000800); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The last update timestamp of the sink.
+     *
+     * This field may not be present for older sinks.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000800; + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Output only. The last update timestamp of the sink.
+     *
+     * This field may not be present for older sinks.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + + /** + * + * + *
+     * Output only. The last update timestamp of the sink.
+     *
+     * This field may not be present for older sinks.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.logging.v2.LogSink) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.LogSink) + private static final com.google.logging.v2.LogSink DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.LogSink(); + } + + public static com.google.logging.v2.LogSink getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LogSink parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.LogSink getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogSinkName.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogSinkName.java new file mode 100644 index 000000000000..cf0e232d565c --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogSinkName.java @@ -0,0 +1,433 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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.logging.v2; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.pathtemplate.ValidationException; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class LogSinkName implements ResourceName { + private static final PathTemplate PROJECT_SINK = + PathTemplate.createWithoutUrlEncoding("projects/{project}/sinks/{sink}"); + private static final PathTemplate ORGANIZATION_SINK = + PathTemplate.createWithoutUrlEncoding("organizations/{organization}/sinks/{sink}"); + private static final PathTemplate FOLDER_SINK = + PathTemplate.createWithoutUrlEncoding("folders/{folder}/sinks/{sink}"); + private static final PathTemplate BILLING_ACCOUNT_SINK = + PathTemplate.createWithoutUrlEncoding("billingAccounts/{billing_account}/sinks/{sink}"); + private volatile Map fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; + private final String project; + private final String sink; + private final String organization; + private final String folder; + private final String billingAccount; + + @Deprecated + protected LogSinkName() { + project = null; + sink = null; + organization = null; + folder = null; + billingAccount = null; + } + + private LogSinkName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + sink = Preconditions.checkNotNull(builder.getSink()); + organization = null; + folder = null; + billingAccount = null; + pathTemplate = PROJECT_SINK; + } + + private LogSinkName(OrganizationSinkBuilder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + sink = Preconditions.checkNotNull(builder.getSink()); + project = null; + folder = null; + billingAccount = null; + pathTemplate = ORGANIZATION_SINK; + } + + private LogSinkName(FolderSinkBuilder builder) { + folder = Preconditions.checkNotNull(builder.getFolder()); + sink = Preconditions.checkNotNull(builder.getSink()); + project = null; + organization = null; + billingAccount = null; + pathTemplate = FOLDER_SINK; + } + + private LogSinkName(BillingAccountSinkBuilder builder) { + billingAccount = Preconditions.checkNotNull(builder.getBillingAccount()); + sink = Preconditions.checkNotNull(builder.getSink()); + project = null; + organization = null; + folder = null; + pathTemplate = BILLING_ACCOUNT_SINK; + } + + public String getProject() { + return project; + } + + public String getSink() { + return sink; + } + + public String getOrganization() { + return organization; + } + + public String getFolder() { + return folder; + } + + public String getBillingAccount() { + return billingAccount; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public static Builder newProjectSinkBuilder() { + return new Builder(); + } + + public static OrganizationSinkBuilder newOrganizationSinkBuilder() { + return new OrganizationSinkBuilder(); + } + + public static FolderSinkBuilder newFolderSinkBuilder() { + return new FolderSinkBuilder(); + } + + public static BillingAccountSinkBuilder newBillingAccountSinkBuilder() { + return new BillingAccountSinkBuilder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static LogSinkName of(String project, String sink) { + return newBuilder().setProject(project).setSink(sink).build(); + } + + public static LogSinkName ofProjectSinkName(String project, String sink) { + return newBuilder().setProject(project).setSink(sink).build(); + } + + public static LogSinkName ofOrganizationSinkName(String organization, String sink) { + return newOrganizationSinkBuilder().setOrganization(organization).setSink(sink).build(); + } + + public static LogSinkName ofFolderSinkName(String folder, String sink) { + return newFolderSinkBuilder().setFolder(folder).setSink(sink).build(); + } + + public static LogSinkName ofBillingAccountSinkName(String billingAccount, String sink) { + return newBillingAccountSinkBuilder().setBillingAccount(billingAccount).setSink(sink).build(); + } + + public static String format(String project, String sink) { + return newBuilder().setProject(project).setSink(sink).build().toString(); + } + + public static String formatProjectSinkName(String project, String sink) { + return newBuilder().setProject(project).setSink(sink).build().toString(); + } + + public static String formatOrganizationSinkName(String organization, String sink) { + return newOrganizationSinkBuilder() + .setOrganization(organization) + .setSink(sink) + .build() + .toString(); + } + + public static String formatFolderSinkName(String folder, String sink) { + return newFolderSinkBuilder().setFolder(folder).setSink(sink).build().toString(); + } + + public static String formatBillingAccountSinkName(String billingAccount, String sink) { + return newBillingAccountSinkBuilder() + .setBillingAccount(billingAccount) + .setSink(sink) + .build() + .toString(); + } + + public static LogSinkName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + if (PROJECT_SINK.matches(formattedString)) { + Map matchMap = PROJECT_SINK.match(formattedString); + return ofProjectSinkName(matchMap.get("project"), matchMap.get("sink")); + } else if (ORGANIZATION_SINK.matches(formattedString)) { + Map matchMap = ORGANIZATION_SINK.match(formattedString); + return ofOrganizationSinkName(matchMap.get("organization"), matchMap.get("sink")); + } else if (FOLDER_SINK.matches(formattedString)) { + Map matchMap = FOLDER_SINK.match(formattedString); + return ofFolderSinkName(matchMap.get("folder"), matchMap.get("sink")); + } else if (BILLING_ACCOUNT_SINK.matches(formattedString)) { + Map matchMap = BILLING_ACCOUNT_SINK.match(formattedString); + return ofBillingAccountSinkName(matchMap.get("billing_account"), matchMap.get("sink")); + } + throw new ValidationException("LogSinkName.parse: formattedString not in valid format"); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (LogSinkName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_SINK.matches(formattedString) + || ORGANIZATION_SINK.matches(formattedString) + || FOLDER_SINK.matches(formattedString) + || BILLING_ACCOUNT_SINK.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (sink != null) { + fieldMapBuilder.put("sink", sink); + } + if (organization != null) { + fieldMapBuilder.put("organization", organization); + } + if (folder != null) { + fieldMapBuilder.put("folder", folder); + } + if (billingAccount != null) { + fieldMapBuilder.put("billing_account", billingAccount); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + LogSinkName that = ((LogSinkName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.sink, that.sink) + && Objects.equals(this.organization, that.organization) + && Objects.equals(this.folder, that.folder) + && Objects.equals(this.billingAccount, that.billingAccount); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(fixedValue); + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(sink); + h *= 1000003; + h ^= Objects.hashCode(organization); + h *= 1000003; + h ^= Objects.hashCode(folder); + h *= 1000003; + h ^= Objects.hashCode(billingAccount); + return h; + } + + /** Builder for projects/{project}/sinks/{sink}. */ + public static class Builder { + private String project; + private String sink; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getSink() { + return sink; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setSink(String sink) { + this.sink = sink; + return this; + } + + private Builder(LogSinkName logSinkName) { + Preconditions.checkArgument( + Objects.equals(logSinkName.pathTemplate, PROJECT_SINK), + "toBuilder is only supported when LogSinkName has the pattern of" + + " projects/{project}/sinks/{sink}"); + this.project = logSinkName.project; + this.sink = logSinkName.sink; + } + + public LogSinkName build() { + return new LogSinkName(this); + } + } + + /** Builder for organizations/{organization}/sinks/{sink}. */ + public static class OrganizationSinkBuilder { + private String organization; + private String sink; + + protected OrganizationSinkBuilder() {} + + public String getOrganization() { + return organization; + } + + public String getSink() { + return sink; + } + + public OrganizationSinkBuilder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public OrganizationSinkBuilder setSink(String sink) { + this.sink = sink; + return this; + } + + public LogSinkName build() { + return new LogSinkName(this); + } + } + + /** Builder for folders/{folder}/sinks/{sink}. */ + public static class FolderSinkBuilder { + private String folder; + private String sink; + + protected FolderSinkBuilder() {} + + public String getFolder() { + return folder; + } + + public String getSink() { + return sink; + } + + public FolderSinkBuilder setFolder(String folder) { + this.folder = folder; + return this; + } + + public FolderSinkBuilder setSink(String sink) { + this.sink = sink; + return this; + } + + public LogSinkName build() { + return new LogSinkName(this); + } + } + + /** Builder for billingAccounts/{billing_account}/sinks/{sink}. */ + public static class BillingAccountSinkBuilder { + private String billingAccount; + private String sink; + + protected BillingAccountSinkBuilder() {} + + public String getBillingAccount() { + return billingAccount; + } + + public String getSink() { + return sink; + } + + public BillingAccountSinkBuilder setBillingAccount(String billingAccount) { + this.billingAccount = billingAccount; + return this; + } + + public BillingAccountSinkBuilder setSink(String sink) { + this.sink = sink; + return this; + } + + public LogSinkName build() { + return new LogSinkName(this); + } + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogSinkOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogSinkOrBuilder.java new file mode 100644 index 000000000000..f3764c37ad9d --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogSinkOrBuilder.java @@ -0,0 +1,542 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface LogSinkOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.LogSink) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The client-assigned sink identifier, unique within the project.
+   *
+   * For example: `"my-syslog-errors-to-pubsub"`. Sink identifiers are limited
+   * to 100 characters and can include only the following characters: upper and
+   * lower-case alphanumeric characters, underscores, hyphens, and periods.
+   * First character has to be alphanumeric.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Required. The client-assigned sink identifier, unique within the project.
+   *
+   * For example: `"my-syslog-errors-to-pubsub"`. Sink identifiers are limited
+   * to 100 characters and can include only the following characters: upper and
+   * lower-case alphanumeric characters, underscores, hyphens, and periods.
+   * First character has to be alphanumeric.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. The export destination:
+   *
+   *     "storage.googleapis.com/[GCS_BUCKET]"
+   *     "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]"
+   *     "pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]"
+   *
+   * The sink's `writer_identity`, set when the sink is created, must have
+   * permission to write to the destination or else the log entries are not
+   * exported. For more information, see
+   * [Exporting Logs with
+   * Sinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs).
+   * 
+ * + * + * string destination = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The destination. + */ + java.lang.String getDestination(); + + /** + * + * + *
+   * Required. The export destination:
+   *
+   *     "storage.googleapis.com/[GCS_BUCKET]"
+   *     "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]"
+   *     "pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]"
+   *
+   * The sink's `writer_identity`, set when the sink is created, must have
+   * permission to write to the destination or else the log entries are not
+   * exported. For more information, see
+   * [Exporting Logs with
+   * Sinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs).
+   * 
+ * + * + * string destination = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for destination. + */ + com.google.protobuf.ByteString getDestinationBytes(); + + /** + * + * + *
+   * Optional. An [advanced logs
+   * filter](https://cloud.google.com/logging/docs/view/advanced-queries). The
+   * only exported log entries are those that are in the resource owning the
+   * sink and that match the filter.
+   *
+   * For example:
+   *
+   *   `logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR`
+   * 
+ * + * string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + java.lang.String getFilter(); + + /** + * + * + *
+   * Optional. An [advanced logs
+   * filter](https://cloud.google.com/logging/docs/view/advanced-queries). The
+   * only exported log entries are those that are in the resource owning the
+   * sink and that match the filter.
+   *
+   * For example:
+   *
+   *   `logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR`
+   * 
+ * + * string filter = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Optional. A description of this sink.
+   *
+   * The maximum length of the description is 8000 characters.
+   * 
+ * + * string description = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The description. + */ + java.lang.String getDescription(); + + /** + * + * + *
+   * Optional. A description of this sink.
+   *
+   * The maximum length of the description is 8000 characters.
+   * 
+ * + * string description = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Optional. If set to true, then this sink is disabled and it does not export
+   * any log entries.
+   * 
+ * + * bool disabled = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The disabled. + */ + boolean getDisabled(); + + /** + * + * + *
+   * Optional. Log entries that match any of these exclusion filters will not be
+   * exported.
+   *
+   * If a log entry is matched by both `filter` and one of `exclusion_filters`
+   * it will not be exported.
+   * 
+ * + * + * repeated .google.logging.v2.LogExclusion exclusions = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List getExclusionsList(); + + /** + * + * + *
+   * Optional. Log entries that match any of these exclusion filters will not be
+   * exported.
+   *
+   * If a log entry is matched by both `filter` and one of `exclusion_filters`
+   * it will not be exported.
+   * 
+ * + * + * repeated .google.logging.v2.LogExclusion exclusions = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.logging.v2.LogExclusion getExclusions(int index); + + /** + * + * + *
+   * Optional. Log entries that match any of these exclusion filters will not be
+   * exported.
+   *
+   * If a log entry is matched by both `filter` and one of `exclusion_filters`
+   * it will not be exported.
+   * 
+ * + * + * repeated .google.logging.v2.LogExclusion exclusions = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getExclusionsCount(); + + /** + * + * + *
+   * Optional. Log entries that match any of these exclusion filters will not be
+   * exported.
+   *
+   * If a log entry is matched by both `filter` and one of `exclusion_filters`
+   * it will not be exported.
+   * 
+ * + * + * repeated .google.logging.v2.LogExclusion exclusions = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List + getExclusionsOrBuilderList(); + + /** + * + * + *
+   * Optional. Log entries that match any of these exclusion filters will not be
+   * exported.
+   *
+   * If a log entry is matched by both `filter` and one of `exclusion_filters`
+   * it will not be exported.
+   * 
+ * + * + * repeated .google.logging.v2.LogExclusion exclusions = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.logging.v2.LogExclusionOrBuilder getExclusionsOrBuilder(int index); + + /** + * + * + *
+   * Deprecated. This field is unused.
+   * 
+ * + * .google.logging.v2.LogSink.VersionFormat output_version_format = 6 [deprecated = true]; + * + * + * @deprecated google.logging.v2.LogSink.output_version_format is deprecated. See + * google/logging/v2/logging_config.proto;l=1000 + * @return The enum numeric value on the wire for outputVersionFormat. + */ + @java.lang.Deprecated + int getOutputVersionFormatValue(); + + /** + * + * + *
+   * Deprecated. This field is unused.
+   * 
+ * + * .google.logging.v2.LogSink.VersionFormat output_version_format = 6 [deprecated = true]; + * + * + * @deprecated google.logging.v2.LogSink.output_version_format is deprecated. See + * google/logging/v2/logging_config.proto;l=1000 + * @return The outputVersionFormat. + */ + @java.lang.Deprecated + com.google.logging.v2.LogSink.VersionFormat getOutputVersionFormat(); + + /** + * + * + *
+   * Output only. An IAM identity&mdash;a service account or group&mdash;under
+   * which Cloud Logging writes the exported log entries to the sink's
+   * destination. This field is either set by specifying
+   * `custom_writer_identity` or set automatically by
+   * [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink] and
+   * [sinks.update][google.logging.v2.ConfigServiceV2.UpdateSink] based on the
+   * value of `unique_writer_identity` in those methods.
+   *
+   * Until you grant this identity write-access to the destination, log entry
+   * exports from this sink will fail. For more information, see [Granting
+   * Access for a
+   * Resource](https://cloud.google.com/iam/docs/granting-roles-to-service-accounts#granting_access_to_a_service_account_for_a_resource).
+   * Consult the destination service's documentation to determine the
+   * appropriate IAM roles to assign to the identity.
+   *
+   * Sinks that have a destination that is a log bucket in the same project as
+   * the sink cannot have a writer_identity and no additional permissions are
+   * required.
+   * 
+ * + * string writer_identity = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The writerIdentity. + */ + java.lang.String getWriterIdentity(); + + /** + * + * + *
+   * Output only. An IAM identity&mdash;a service account or group&mdash;under
+   * which Cloud Logging writes the exported log entries to the sink's
+   * destination. This field is either set by specifying
+   * `custom_writer_identity` or set automatically by
+   * [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink] and
+   * [sinks.update][google.logging.v2.ConfigServiceV2.UpdateSink] based on the
+   * value of `unique_writer_identity` in those methods.
+   *
+   * Until you grant this identity write-access to the destination, log entry
+   * exports from this sink will fail. For more information, see [Granting
+   * Access for a
+   * Resource](https://cloud.google.com/iam/docs/granting-roles-to-service-accounts#granting_access_to_a_service_account_for_a_resource).
+   * Consult the destination service's documentation to determine the
+   * appropriate IAM roles to assign to the identity.
+   *
+   * Sinks that have a destination that is a log bucket in the same project as
+   * the sink cannot have a writer_identity and no additional permissions are
+   * required.
+   * 
+ * + * string writer_identity = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for writerIdentity. + */ + com.google.protobuf.ByteString getWriterIdentityBytes(); + + /** + * + * + *
+   * Optional. This field applies only to sinks owned by organizations and
+   * folders. If the field is false, the default, only the logs owned by the
+   * sink's parent resource are available for export. If the field is true, then
+   * log entries from all the projects, folders, and billing accounts contained
+   * in the sink's parent resource are also available for export. Whether a
+   * particular log entry from the children is exported depends on the sink's
+   * filter expression.
+   *
+   * For example, if this field is true, then the filter
+   * `resource.type=gce_instance` would export all Compute Engine VM instance
+   * log entries from all projects in the sink's parent.
+   *
+   * To only export entries from certain child projects, filter on the project
+   * part of the log name:
+   *
+   *   logName:("projects/test-project1/" OR "projects/test-project2/") AND
+   *   resource.type=gce_instance
+   * 
+ * + * bool include_children = 9 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The includeChildren. + */ + boolean getIncludeChildren(); + + /** + * + * + *
+   * Optional. Options that affect sinks exporting data to BigQuery.
+   * 
+ * + * + * .google.logging.v2.BigQueryOptions bigquery_options = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the bigqueryOptions field is set. + */ + boolean hasBigqueryOptions(); + + /** + * + * + *
+   * Optional. Options that affect sinks exporting data to BigQuery.
+   * 
+ * + * + * .google.logging.v2.BigQueryOptions bigquery_options = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The bigqueryOptions. + */ + com.google.logging.v2.BigQueryOptions getBigqueryOptions(); + + /** + * + * + *
+   * Optional. Options that affect sinks exporting data to BigQuery.
+   * 
+ * + * + * .google.logging.v2.BigQueryOptions bigquery_options = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.logging.v2.BigQueryOptionsOrBuilder getBigqueryOptionsOrBuilder(); + + /** + * + * + *
+   * Output only. The creation timestamp of the sink.
+   *
+   * This field may not be present for older sinks.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + + /** + * + * + *
+   * Output only. The creation timestamp of the sink.
+   *
+   * This field may not be present for older sinks.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + + /** + * + * + *
+   * Output only. The creation timestamp of the sink.
+   *
+   * This field may not be present for older sinks.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The last update timestamp of the sink.
+   *
+   * This field may not be present for older sinks.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + + /** + * + * + *
+   * Output only. The last update timestamp of the sink.
+   *
+   * This field may not be present for older sinks.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + + /** + * + * + *
+   * Output only. The last update timestamp of the sink.
+   *
+   * This field may not be present for older sinks.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + com.google.logging.v2.LogSink.OptionsCase getOptionsCase(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogSplit.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogSplit.java new file mode 100644 index 000000000000..1a695decab53 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogSplit.java @@ -0,0 +1,848 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/log_entry.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * Additional information used to correlate multiple log entries. Used when a
+ * single LogEntry would exceed the Google Cloud Logging size limit and is
+ * split across multiple log entries.
+ * 
+ * + * Protobuf type {@code google.logging.v2.LogSplit} + */ +public final class LogSplit extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.LogSplit) + LogSplitOrBuilder { + private static final long serialVersionUID = 0L; + + // Use LogSplit.newBuilder() to construct. + private LogSplit(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private LogSplit() { + uid_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new LogSplit(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LogEntryProto + .internal_static_google_logging_v2_LogSplit_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LogEntryProto + .internal_static_google_logging_v2_LogSplit_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.LogSplit.class, com.google.logging.v2.LogSplit.Builder.class); + } + + public static final int UID_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object uid_ = ""; + + /** + * + * + *
+   * A globally unique identifier for all log entries in a sequence of split log
+   * entries. All log entries with the same |LogSplit.uid| are assumed to be
+   * part of the same sequence of split log entries.
+   * 
+ * + * string uid = 1; + * + * @return The uid. + */ + @java.lang.Override + public java.lang.String getUid() { + java.lang.Object ref = uid_; + 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(); + uid_ = s; + return s; + } + } + + /** + * + * + *
+   * A globally unique identifier for all log entries in a sequence of split log
+   * entries. All log entries with the same |LogSplit.uid| are assumed to be
+   * part of the same sequence of split log entries.
+   * 
+ * + * string uid = 1; + * + * @return The bytes for uid. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUidBytes() { + java.lang.Object ref = uid_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INDEX_FIELD_NUMBER = 2; + private int index_ = 0; + + /** + * + * + *
+   * The index of this LogEntry in the sequence of split log entries. Log
+   * entries are given |index| values 0, 1, ..., n-1 for a sequence of n log
+   * entries.
+   * 
+ * + * int32 index = 2; + * + * @return The index. + */ + @java.lang.Override + public int getIndex() { + return index_; + } + + public static final int TOTAL_SPLITS_FIELD_NUMBER = 3; + private int totalSplits_ = 0; + + /** + * + * + *
+   * The total number of log entries that the original LogEntry was split into.
+   * 
+ * + * int32 total_splits = 3; + * + * @return The totalSplits. + */ + @java.lang.Override + public int getTotalSplits() { + return totalSplits_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uid_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, uid_); + } + if (index_ != 0) { + output.writeInt32(2, index_); + } + if (totalSplits_ != 0) { + output.writeInt32(3, totalSplits_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uid_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, uid_); + } + if (index_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, index_); + } + if (totalSplits_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, totalSplits_); + } + size += getUnknownFields().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.logging.v2.LogSplit)) { + return super.equals(obj); + } + com.google.logging.v2.LogSplit other = (com.google.logging.v2.LogSplit) obj; + + if (!getUid().equals(other.getUid())) return false; + if (getIndex() != other.getIndex()) return false; + if (getTotalSplits() != other.getTotalSplits()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + UID_FIELD_NUMBER; + hash = (53 * hash) + getUid().hashCode(); + hash = (37 * hash) + INDEX_FIELD_NUMBER; + hash = (53 * hash) + getIndex(); + hash = (37 * hash) + TOTAL_SPLITS_FIELD_NUMBER; + hash = (53 * hash) + getTotalSplits(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.LogSplit parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.LogSplit parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.LogSplit parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.LogSplit 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.logging.v2.LogSplit parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.LogSplit parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.LogSplit parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.LogSplit 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.logging.v2.LogSplit parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.LogSplit 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.logging.v2.LogSplit parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.LogSplit 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.logging.v2.LogSplit 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 used to correlate multiple log entries. Used when a
+   * single LogEntry would exceed the Google Cloud Logging size limit and is
+   * split across multiple log entries.
+   * 
+ * + * Protobuf type {@code google.logging.v2.LogSplit} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.LogSplit) + com.google.logging.v2.LogSplitOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LogEntryProto + .internal_static_google_logging_v2_LogSplit_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LogEntryProto + .internal_static_google_logging_v2_LogSplit_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.LogSplit.class, com.google.logging.v2.LogSplit.Builder.class); + } + + // Construct using com.google.logging.v2.LogSplit.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + uid_ = ""; + index_ = 0; + totalSplits_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LogEntryProto + .internal_static_google_logging_v2_LogSplit_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.LogSplit getDefaultInstanceForType() { + return com.google.logging.v2.LogSplit.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.LogSplit build() { + com.google.logging.v2.LogSplit result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.LogSplit buildPartial() { + com.google.logging.v2.LogSplit result = new com.google.logging.v2.LogSplit(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.logging.v2.LogSplit result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.uid_ = uid_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.index_ = index_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.totalSplits_ = totalSplits_; + } + } + + @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.logging.v2.LogSplit) { + return mergeFrom((com.google.logging.v2.LogSplit) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.LogSplit other) { + if (other == com.google.logging.v2.LogSplit.getDefaultInstance()) return this; + if (!other.getUid().isEmpty()) { + uid_ = other.uid_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getIndex() != 0) { + setIndex(other.getIndex()); + } + if (other.getTotalSplits() != 0) { + setTotalSplits(other.getTotalSplits()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + uid_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + index_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: + { + totalSplits_ = input.readInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object uid_ = ""; + + /** + * + * + *
+     * A globally unique identifier for all log entries in a sequence of split log
+     * entries. All log entries with the same |LogSplit.uid| are assumed to be
+     * part of the same sequence of split log entries.
+     * 
+ * + * string uid = 1; + * + * @return The uid. + */ + public java.lang.String getUid() { + java.lang.Object ref = uid_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uid_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * A globally unique identifier for all log entries in a sequence of split log
+     * entries. All log entries with the same |LogSplit.uid| are assumed to be
+     * part of the same sequence of split log entries.
+     * 
+ * + * string uid = 1; + * + * @return The bytes for uid. + */ + public com.google.protobuf.ByteString getUidBytes() { + java.lang.Object ref = uid_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + uid_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * A globally unique identifier for all log entries in a sequence of split log
+     * entries. All log entries with the same |LogSplit.uid| are assumed to be
+     * part of the same sequence of split log entries.
+     * 
+ * + * string uid = 1; + * + * @param value The uid to set. + * @return This builder for chaining. + */ + public Builder setUid(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + uid_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * A globally unique identifier for all log entries in a sequence of split log
+     * entries. All log entries with the same |LogSplit.uid| are assumed to be
+     * part of the same sequence of split log entries.
+     * 
+ * + * string uid = 1; + * + * @return This builder for chaining. + */ + public Builder clearUid() { + uid_ = getDefaultInstance().getUid(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * A globally unique identifier for all log entries in a sequence of split log
+     * entries. All log entries with the same |LogSplit.uid| are assumed to be
+     * part of the same sequence of split log entries.
+     * 
+ * + * string uid = 1; + * + * @param value The bytes for uid to set. + * @return This builder for chaining. + */ + public Builder setUidBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + uid_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int index_; + + /** + * + * + *
+     * The index of this LogEntry in the sequence of split log entries. Log
+     * entries are given |index| values 0, 1, ..., n-1 for a sequence of n log
+     * entries.
+     * 
+ * + * int32 index = 2; + * + * @return The index. + */ + @java.lang.Override + public int getIndex() { + return index_; + } + + /** + * + * + *
+     * The index of this LogEntry in the sequence of split log entries. Log
+     * entries are given |index| values 0, 1, ..., n-1 for a sequence of n log
+     * entries.
+     * 
+ * + * int32 index = 2; + * + * @param value The index to set. + * @return This builder for chaining. + */ + public Builder setIndex(int value) { + + index_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * The index of this LogEntry in the sequence of split log entries. Log
+     * entries are given |index| values 0, 1, ..., n-1 for a sequence of n log
+     * entries.
+     * 
+ * + * int32 index = 2; + * + * @return This builder for chaining. + */ + public Builder clearIndex() { + bitField0_ = (bitField0_ & ~0x00000002); + index_ = 0; + onChanged(); + return this; + } + + private int totalSplits_; + + /** + * + * + *
+     * The total number of log entries that the original LogEntry was split into.
+     * 
+ * + * int32 total_splits = 3; + * + * @return The totalSplits. + */ + @java.lang.Override + public int getTotalSplits() { + return totalSplits_; + } + + /** + * + * + *
+     * The total number of log entries that the original LogEntry was split into.
+     * 
+ * + * int32 total_splits = 3; + * + * @param value The totalSplits to set. + * @return This builder for chaining. + */ + public Builder setTotalSplits(int value) { + + totalSplits_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * The total number of log entries that the original LogEntry was split into.
+     * 
+ * + * int32 total_splits = 3; + * + * @return This builder for chaining. + */ + public Builder clearTotalSplits() { + bitField0_ = (bitField0_ & ~0x00000004); + totalSplits_ = 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.logging.v2.LogSplit) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.LogSplit) + private static final com.google.logging.v2.LogSplit DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.LogSplit(); + } + + public static com.google.logging.v2.LogSplit getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LogSplit parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.LogSplit getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogSplitOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogSplitOrBuilder.java new file mode 100644 index 000000000000..a0fc95789189 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogSplitOrBuilder.java @@ -0,0 +1,84 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/log_entry.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface LogSplitOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.LogSplit) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A globally unique identifier for all log entries in a sequence of split log
+   * entries. All log entries with the same |LogSplit.uid| are assumed to be
+   * part of the same sequence of split log entries.
+   * 
+ * + * string uid = 1; + * + * @return The uid. + */ + java.lang.String getUid(); + + /** + * + * + *
+   * A globally unique identifier for all log entries in a sequence of split log
+   * entries. All log entries with the same |LogSplit.uid| are assumed to be
+   * part of the same sequence of split log entries.
+   * 
+ * + * string uid = 1; + * + * @return The bytes for uid. + */ + com.google.protobuf.ByteString getUidBytes(); + + /** + * + * + *
+   * The index of this LogEntry in the sequence of split log entries. Log
+   * entries are given |index| values 0, 1, ..., n-1 for a sequence of n log
+   * entries.
+   * 
+ * + * int32 index = 2; + * + * @return The index. + */ + int getIndex(); + + /** + * + * + *
+   * The total number of log entries that the original LogEntry was split into.
+   * 
+ * + * int32 total_splits = 3; + * + * @return The totalSplits. + */ + int getTotalSplits(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogView.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogView.java new file mode 100644 index 000000000000..7248d09ca0d3 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogView.java @@ -0,0 +1,1730 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * Describes a view over log entries in a bucket.
+ * 
+ * + * Protobuf type {@code google.logging.v2.LogView} + */ +public final class LogView extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.LogView) + LogViewOrBuilder { + private static final long serialVersionUID = 0L; + + // Use LogView.newBuilder() to construct. + private LogView(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private LogView() { + name_ = ""; + description_ = ""; + filter_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new LogView(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_LogView_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_LogView_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.LogView.class, com.google.logging.v2.LogView.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * The resource name of the view.
+   *
+   * For example:
+   *
+   *   `projects/my-project/locations/global/buckets/my-bucket/views/my-view`
+   * 
+ * + * string name = 1; + * + * @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; + } + } + + /** + * + * + *
+   * The resource name of the view.
+   *
+   * For example:
+   *
+   *   `projects/my-project/locations/global/buckets/my-bucket/views/my-view`
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object description_ = ""; + + /** + * + * + *
+   * Describes this view.
+   * 
+ * + * 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; + } + } + + /** + * + * + *
+   * Describes this view.
+   * 
+ * + * 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 CREATE_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp createTime_; + + /** + * + * + *
+   * Output only. The creation timestamp of the view.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Output only. The creation timestamp of the view.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + /** + * + * + *
+   * Output only. The creation timestamp of the view.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp updateTime_; + + /** + * + * + *
+   * Output only. The last update timestamp of the view.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Output only. The last update timestamp of the view.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + /** + * + * + *
+   * Output only. The last update timestamp of the view.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + public static final int FILTER_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + + /** + * + * + *
+   * Filter that restricts which log entries in a bucket are visible in this
+   * view.
+   *
+   * Filters are restricted to be a logical AND of ==/!= of any of the
+   * following:
+   *
+   *   - originating project/folder/organization/billing account.
+   *   - resource type
+   *   - log id
+   *
+   * For example:
+   *
+   *   SOURCE("projects/myproject") AND resource.type = "gce_instance"
+   *                                AND LOG_ID("stdout")
+   * 
+ * + * string filter = 7; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + + /** + * + * + *
+   * Filter that restricts which log entries in a bucket are visible in this
+   * view.
+   *
+   * Filters are restricted to be a logical AND of ==/!= of any of the
+   * following:
+   *
+   *   - originating project/folder/organization/billing account.
+   *   - resource type
+   *   - log id
+   *
+   * For example:
+   *
+   *   SOURCE("projects/myproject") AND resource.type = "gce_instance"
+   *                                AND LOG_ID("stdout")
+   * 
+ * + * string filter = 7; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(4, getCreateTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(5, getUpdateTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, filter_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getCreateTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getUpdateTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, filter_); + } + size += getUnknownFields().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.logging.v2.LogView)) { + return super.equals(obj); + } + com.google.logging.v2.LogView other = (com.google.logging.v2.LogView) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (!getFilter().equals(other.getFilter())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.LogView parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.LogView parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.LogView parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.LogView 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.logging.v2.LogView parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.LogView parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.LogView parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.LogView 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.logging.v2.LogView parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.LogView 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.logging.v2.LogView parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.LogView 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.logging.v2.LogView 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; + } + + /** + * + * + *
+   * Describes a view over log entries in a bucket.
+   * 
+ * + * Protobuf type {@code google.logging.v2.LogView} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.LogView) + com.google.logging.v2.LogViewOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_LogView_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_LogView_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.LogView.class, com.google.logging.v2.LogView.Builder.class); + } + + // Construct using com.google.logging.v2.LogView.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getCreateTimeFieldBuilder(); + getUpdateTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + description_ = ""; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + filter_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_LogView_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.LogView getDefaultInstanceForType() { + return com.google.logging.v2.LogView.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.LogView build() { + com.google.logging.v2.LogView result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.LogView buildPartial() { + com.google.logging.v2.LogView result = new com.google.logging.v2.LogView(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.logging.v2.LogView result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.description_ = description_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.filter_ = filter_; + } + result.bitField0_ |= to_bitField0_; + } + + @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.logging.v2.LogView) { + return mergeFrom((com.google.logging.v2.LogView) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.LogView other) { + if (other == com.google.logging.v2.LogView.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + bitField0_ |= 0x00000010; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 26: + { + description_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 26 + case 34: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 34 + case 42: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 42 + case 58: + { + filter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 58 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * The resource name of the view.
+     *
+     * For example:
+     *
+     *   `projects/my-project/locations/global/buckets/my-bucket/views/my-view`
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The resource name of the view.
+     *
+     * For example:
+     *
+     *   `projects/my-project/locations/global/buckets/my-bucket/views/my-view`
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The resource name of the view.
+     *
+     * For example:
+     *
+     *   `projects/my-project/locations/global/buckets/my-bucket/views/my-view`
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * The resource name of the view.
+     *
+     * For example:
+     *
+     *   `projects/my-project/locations/global/buckets/my-bucket/views/my-view`
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * The resource name of the view.
+     *
+     * For example:
+     *
+     *   `projects/my-project/locations/global/buckets/my-bucket/views/my-view`
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + + /** + * + * + *
+     * Describes this view.
+     * 
+ * + * 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; + } + } + + /** + * + * + *
+     * Describes this view.
+     * 
+ * + * 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; + } + } + + /** + * + * + *
+     * Describes this view.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Describes this view.
+     * 
+ * + * string description = 3; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + description_ = getDefaultInstance().getDescription(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Describes this view.
+     * 
+ * + * 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + + /** + * + * + *
+     * Output only. The creation timestamp of the view.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Output only. The creation timestamp of the view.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Output only. The creation timestamp of the view.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + } else { + createTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The creation timestamp of the view.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The creation timestamp of the view.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + if (createTime_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Output only. The creation timestamp of the view.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + bitField0_ = (bitField0_ & ~0x00000004); + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The creation timestamp of the view.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Output only. The creation timestamp of the view.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + + /** + * + * + *
+     * Output only. The creation timestamp of the view.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + + /** + * + * + *
+     * Output only. The last update timestamp of the view.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * Output only. The last update timestamp of the view.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Output only. The last update timestamp of the view.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + } else { + updateTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The last update timestamp of the view.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The last update timestamp of the view.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + if (updateTime_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Output only. The last update timestamp of the view.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + bitField0_ = (bitField0_ & ~0x00000008); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The last update timestamp of the view.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Output only. The last update timestamp of the view.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + + /** + * + * + *
+     * Output only. The last update timestamp of the view.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private java.lang.Object filter_ = ""; + + /** + * + * + *
+     * Filter that restricts which log entries in a bucket are visible in this
+     * view.
+     *
+     * Filters are restricted to be a logical AND of ==/!= of any of the
+     * following:
+     *
+     *   - originating project/folder/organization/billing account.
+     *   - resource type
+     *   - log id
+     *
+     * For example:
+     *
+     *   SOURCE("projects/myproject") AND resource.type = "gce_instance"
+     *                                AND LOG_ID("stdout")
+     * 
+ * + * string filter = 7; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Filter that restricts which log entries in a bucket are visible in this
+     * view.
+     *
+     * Filters are restricted to be a logical AND of ==/!= of any of the
+     * following:
+     *
+     *   - originating project/folder/organization/billing account.
+     *   - resource type
+     *   - log id
+     *
+     * For example:
+     *
+     *   SOURCE("projects/myproject") AND resource.type = "gce_instance"
+     *                                AND LOG_ID("stdout")
+     * 
+ * + * string filter = 7; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Filter that restricts which log entries in a bucket are visible in this
+     * view.
+     *
+     * Filters are restricted to be a logical AND of ==/!= of any of the
+     * following:
+     *
+     *   - originating project/folder/organization/billing account.
+     *   - resource type
+     *   - log id
+     *
+     * For example:
+     *
+     *   SOURCE("projects/myproject") AND resource.type = "gce_instance"
+     *                                AND LOG_ID("stdout")
+     * 
+ * + * string filter = 7; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Filter that restricts which log entries in a bucket are visible in this
+     * view.
+     *
+     * Filters are restricted to be a logical AND of ==/!= of any of the
+     * following:
+     *
+     *   - originating project/folder/organization/billing account.
+     *   - resource type
+     *   - log id
+     *
+     * For example:
+     *
+     *   SOURCE("projects/myproject") AND resource.type = "gce_instance"
+     *                                AND LOG_ID("stdout")
+     * 
+ * + * string filter = 7; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + + /** + * + * + *
+     * Filter that restricts which log entries in a bucket are visible in this
+     * view.
+     *
+     * Filters are restricted to be a logical AND of ==/!= of any of the
+     * following:
+     *
+     *   - originating project/folder/organization/billing account.
+     *   - resource type
+     *   - log id
+     *
+     * For example:
+     *
+     *   SOURCE("projects/myproject") AND resource.type = "gce_instance"
+     *                                AND LOG_ID("stdout")
+     * 
+ * + * string filter = 7; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + filter_ = value; + bitField0_ |= 0x00000010; + 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.logging.v2.LogView) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.LogView) + private static final com.google.logging.v2.LogView DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.LogView(); + } + + public static com.google.logging.v2.LogView getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LogView parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.LogView getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogViewName.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogViewName.java new file mode 100644 index 000000000000..4ff5babafdae --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogViewName.java @@ -0,0 +1,628 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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.logging.v2; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.pathtemplate.ValidationException; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class LogViewName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_BUCKET_VIEW = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/buckets/{bucket}/views/{view}"); + private static final PathTemplate ORGANIZATION_LOCATION_BUCKET_VIEW = + PathTemplate.createWithoutUrlEncoding( + "organizations/{organization}/locations/{location}/buckets/{bucket}/views/{view}"); + private static final PathTemplate FOLDER_LOCATION_BUCKET_VIEW = + PathTemplate.createWithoutUrlEncoding( + "folders/{folder}/locations/{location}/buckets/{bucket}/views/{view}"); + private static final PathTemplate BILLING_ACCOUNT_LOCATION_BUCKET_VIEW = + PathTemplate.createWithoutUrlEncoding( + "billingAccounts/{billing_account}/locations/{location}/buckets/{bucket}/views/{view}"); + private volatile Map fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; + private final String project; + private final String location; + private final String bucket; + private final String view; + private final String organization; + private final String folder; + private final String billingAccount; + + @Deprecated + protected LogViewName() { + project = null; + location = null; + bucket = null; + view = null; + organization = null; + folder = null; + billingAccount = null; + } + + private LogViewName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + bucket = Preconditions.checkNotNull(builder.getBucket()); + view = Preconditions.checkNotNull(builder.getView()); + organization = null; + folder = null; + billingAccount = null; + pathTemplate = PROJECT_LOCATION_BUCKET_VIEW; + } + + private LogViewName(OrganizationLocationBucketViewBuilder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + location = Preconditions.checkNotNull(builder.getLocation()); + bucket = Preconditions.checkNotNull(builder.getBucket()); + view = Preconditions.checkNotNull(builder.getView()); + project = null; + folder = null; + billingAccount = null; + pathTemplate = ORGANIZATION_LOCATION_BUCKET_VIEW; + } + + private LogViewName(FolderLocationBucketViewBuilder builder) { + folder = Preconditions.checkNotNull(builder.getFolder()); + location = Preconditions.checkNotNull(builder.getLocation()); + bucket = Preconditions.checkNotNull(builder.getBucket()); + view = Preconditions.checkNotNull(builder.getView()); + project = null; + organization = null; + billingAccount = null; + pathTemplate = FOLDER_LOCATION_BUCKET_VIEW; + } + + private LogViewName(BillingAccountLocationBucketViewBuilder builder) { + billingAccount = Preconditions.checkNotNull(builder.getBillingAccount()); + location = Preconditions.checkNotNull(builder.getLocation()); + bucket = Preconditions.checkNotNull(builder.getBucket()); + view = Preconditions.checkNotNull(builder.getView()); + project = null; + organization = null; + folder = null; + pathTemplate = BILLING_ACCOUNT_LOCATION_BUCKET_VIEW; + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getBucket() { + return bucket; + } + + public String getView() { + return view; + } + + public String getOrganization() { + return organization; + } + + public String getFolder() { + return folder; + } + + public String getBillingAccount() { + return billingAccount; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public static Builder newProjectLocationBucketViewBuilder() { + return new Builder(); + } + + public static OrganizationLocationBucketViewBuilder newOrganizationLocationBucketViewBuilder() { + return new OrganizationLocationBucketViewBuilder(); + } + + public static FolderLocationBucketViewBuilder newFolderLocationBucketViewBuilder() { + return new FolderLocationBucketViewBuilder(); + } + + public static BillingAccountLocationBucketViewBuilder + newBillingAccountLocationBucketViewBuilder() { + return new BillingAccountLocationBucketViewBuilder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static LogViewName of(String project, String location, String bucket, String view) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setBucket(bucket) + .setView(view) + .build(); + } + + public static LogViewName ofProjectLocationBucketViewName( + String project, String location, String bucket, String view) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setBucket(bucket) + .setView(view) + .build(); + } + + public static LogViewName ofOrganizationLocationBucketViewName( + String organization, String location, String bucket, String view) { + return newOrganizationLocationBucketViewBuilder() + .setOrganization(organization) + .setLocation(location) + .setBucket(bucket) + .setView(view) + .build(); + } + + public static LogViewName ofFolderLocationBucketViewName( + String folder, String location, String bucket, String view) { + return newFolderLocationBucketViewBuilder() + .setFolder(folder) + .setLocation(location) + .setBucket(bucket) + .setView(view) + .build(); + } + + public static LogViewName ofBillingAccountLocationBucketViewName( + String billingAccount, String location, String bucket, String view) { + return newBillingAccountLocationBucketViewBuilder() + .setBillingAccount(billingAccount) + .setLocation(location) + .setBucket(bucket) + .setView(view) + .build(); + } + + public static String format(String project, String location, String bucket, String view) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setBucket(bucket) + .setView(view) + .build() + .toString(); + } + + public static String formatProjectLocationBucketViewName( + String project, String location, String bucket, String view) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setBucket(bucket) + .setView(view) + .build() + .toString(); + } + + public static String formatOrganizationLocationBucketViewName( + String organization, String location, String bucket, String view) { + return newOrganizationLocationBucketViewBuilder() + .setOrganization(organization) + .setLocation(location) + .setBucket(bucket) + .setView(view) + .build() + .toString(); + } + + public static String formatFolderLocationBucketViewName( + String folder, String location, String bucket, String view) { + return newFolderLocationBucketViewBuilder() + .setFolder(folder) + .setLocation(location) + .setBucket(bucket) + .setView(view) + .build() + .toString(); + } + + public static String formatBillingAccountLocationBucketViewName( + String billingAccount, String location, String bucket, String view) { + return newBillingAccountLocationBucketViewBuilder() + .setBillingAccount(billingAccount) + .setLocation(location) + .setBucket(bucket) + .setView(view) + .build() + .toString(); + } + + public static LogViewName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + if (PROJECT_LOCATION_BUCKET_VIEW.matches(formattedString)) { + Map matchMap = PROJECT_LOCATION_BUCKET_VIEW.match(formattedString); + return ofProjectLocationBucketViewName( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("bucket"), + matchMap.get("view")); + } else if (ORGANIZATION_LOCATION_BUCKET_VIEW.matches(formattedString)) { + Map matchMap = ORGANIZATION_LOCATION_BUCKET_VIEW.match(formattedString); + return ofOrganizationLocationBucketViewName( + matchMap.get("organization"), + matchMap.get("location"), + matchMap.get("bucket"), + matchMap.get("view")); + } else if (FOLDER_LOCATION_BUCKET_VIEW.matches(formattedString)) { + Map matchMap = FOLDER_LOCATION_BUCKET_VIEW.match(formattedString); + return ofFolderLocationBucketViewName( + matchMap.get("folder"), + matchMap.get("location"), + matchMap.get("bucket"), + matchMap.get("view")); + } else if (BILLING_ACCOUNT_LOCATION_BUCKET_VIEW.matches(formattedString)) { + Map matchMap = BILLING_ACCOUNT_LOCATION_BUCKET_VIEW.match(formattedString); + return ofBillingAccountLocationBucketViewName( + matchMap.get("billing_account"), + matchMap.get("location"), + matchMap.get("bucket"), + matchMap.get("view")); + } + throw new ValidationException("LogViewName.parse: formattedString not in valid format"); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (LogViewName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_BUCKET_VIEW.matches(formattedString) + || ORGANIZATION_LOCATION_BUCKET_VIEW.matches(formattedString) + || FOLDER_LOCATION_BUCKET_VIEW.matches(formattedString) + || BILLING_ACCOUNT_LOCATION_BUCKET_VIEW.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (bucket != null) { + fieldMapBuilder.put("bucket", bucket); + } + if (view != null) { + fieldMapBuilder.put("view", view); + } + if (organization != null) { + fieldMapBuilder.put("organization", organization); + } + if (folder != null) { + fieldMapBuilder.put("folder", folder); + } + if (billingAccount != null) { + fieldMapBuilder.put("billing_account", billingAccount); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + LogViewName that = ((LogViewName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.bucket, that.bucket) + && Objects.equals(this.view, that.view) + && Objects.equals(this.organization, that.organization) + && Objects.equals(this.folder, that.folder) + && Objects.equals(this.billingAccount, that.billingAccount); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(fixedValue); + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(bucket); + h *= 1000003; + h ^= Objects.hashCode(view); + h *= 1000003; + h ^= Objects.hashCode(organization); + h *= 1000003; + h ^= Objects.hashCode(folder); + h *= 1000003; + h ^= Objects.hashCode(billingAccount); + return h; + } + + /** Builder for projects/{project}/locations/{location}/buckets/{bucket}/views/{view}. */ + public static class Builder { + private String project; + private String location; + private String bucket; + private String view; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getBucket() { + return bucket; + } + + public String getView() { + return view; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setBucket(String bucket) { + this.bucket = bucket; + return this; + } + + public Builder setView(String view) { + this.view = view; + return this; + } + + private Builder(LogViewName logViewName) { + Preconditions.checkArgument( + Objects.equals(logViewName.pathTemplate, PROJECT_LOCATION_BUCKET_VIEW), + "toBuilder is only supported when LogViewName has the pattern of" + + " projects/{project}/locations/{location}/buckets/{bucket}/views/{view}"); + this.project = logViewName.project; + this.location = logViewName.location; + this.bucket = logViewName.bucket; + this.view = logViewName.view; + } + + public LogViewName build() { + return new LogViewName(this); + } + } + + /** + * Builder for organizations/{organization}/locations/{location}/buckets/{bucket}/views/{view}. + */ + public static class OrganizationLocationBucketViewBuilder { + private String organization; + private String location; + private String bucket; + private String view; + + protected OrganizationLocationBucketViewBuilder() {} + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public String getBucket() { + return bucket; + } + + public String getView() { + return view; + } + + public OrganizationLocationBucketViewBuilder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public OrganizationLocationBucketViewBuilder setLocation(String location) { + this.location = location; + return this; + } + + public OrganizationLocationBucketViewBuilder setBucket(String bucket) { + this.bucket = bucket; + return this; + } + + public OrganizationLocationBucketViewBuilder setView(String view) { + this.view = view; + return this; + } + + public LogViewName build() { + return new LogViewName(this); + } + } + + /** Builder for folders/{folder}/locations/{location}/buckets/{bucket}/views/{view}. */ + public static class FolderLocationBucketViewBuilder { + private String folder; + private String location; + private String bucket; + private String view; + + protected FolderLocationBucketViewBuilder() {} + + public String getFolder() { + return folder; + } + + public String getLocation() { + return location; + } + + public String getBucket() { + return bucket; + } + + public String getView() { + return view; + } + + public FolderLocationBucketViewBuilder setFolder(String folder) { + this.folder = folder; + return this; + } + + public FolderLocationBucketViewBuilder setLocation(String location) { + this.location = location; + return this; + } + + public FolderLocationBucketViewBuilder setBucket(String bucket) { + this.bucket = bucket; + return this; + } + + public FolderLocationBucketViewBuilder setView(String view) { + this.view = view; + return this; + } + + public LogViewName build() { + return new LogViewName(this); + } + } + + /** + * Builder for + * billingAccounts/{billing_account}/locations/{location}/buckets/{bucket}/views/{view}. + */ + public static class BillingAccountLocationBucketViewBuilder { + private String billingAccount; + private String location; + private String bucket; + private String view; + + protected BillingAccountLocationBucketViewBuilder() {} + + public String getBillingAccount() { + return billingAccount; + } + + public String getLocation() { + return location; + } + + public String getBucket() { + return bucket; + } + + public String getView() { + return view; + } + + public BillingAccountLocationBucketViewBuilder setBillingAccount(String billingAccount) { + this.billingAccount = billingAccount; + return this; + } + + public BillingAccountLocationBucketViewBuilder setLocation(String location) { + this.location = location; + return this; + } + + public BillingAccountLocationBucketViewBuilder setBucket(String bucket) { + this.bucket = bucket; + return this; + } + + public BillingAccountLocationBucketViewBuilder setView(String view) { + this.view = view; + return this; + } + + public LogViewName build() { + return new LogViewName(this); + } + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogViewOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogViewOrBuilder.java new file mode 100644 index 000000000000..622a4562c7bc --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogViewOrBuilder.java @@ -0,0 +1,218 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface LogViewOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.LogView) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The resource name of the view.
+   *
+   * For example:
+   *
+   *   `projects/my-project/locations/global/buckets/my-bucket/views/my-view`
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * The resource name of the view.
+   *
+   * For example:
+   *
+   *   `projects/my-project/locations/global/buckets/my-bucket/views/my-view`
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Describes this view.
+   * 
+ * + * string description = 3; + * + * @return The description. + */ + java.lang.String getDescription(); + + /** + * + * + *
+   * Describes this view.
+   * 
+ * + * string description = 3; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Output only. The creation timestamp of the view.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + + /** + * + * + *
+   * Output only. The creation timestamp of the view.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + + /** + * + * + *
+   * Output only. The creation timestamp of the view.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The last update timestamp of the view.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + + /** + * + * + *
+   * Output only. The last update timestamp of the view.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + + /** + * + * + *
+   * Output only. The last update timestamp of the view.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Filter that restricts which log entries in a bucket are visible in this
+   * view.
+   *
+   * Filters are restricted to be a logical AND of ==/!= of any of the
+   * following:
+   *
+   *   - originating project/folder/organization/billing account.
+   *   - resource type
+   *   - log id
+   *
+   * For example:
+   *
+   *   SOURCE("projects/myproject") AND resource.type = "gce_instance"
+   *                                AND LOG_ID("stdout")
+   * 
+ * + * string filter = 7; + * + * @return The filter. + */ + java.lang.String getFilter(); + + /** + * + * + *
+   * Filter that restricts which log entries in a bucket are visible in this
+   * view.
+   *
+   * Filters are restricted to be a logical AND of ==/!= of any of the
+   * following:
+   *
+   *   - originating project/folder/organization/billing account.
+   *   - resource type
+   *   - log id
+   *
+   * For example:
+   *
+   *   SOURCE("projects/myproject") AND resource.type = "gce_instance"
+   *                                AND LOG_ID("stdout")
+   * 
+ * + * string filter = 7; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LoggingConfigProto.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LoggingConfigProto.java new file mode 100644 index 000000000000..24674ece4d41 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LoggingConfigProto.java @@ -0,0 +1,1271 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public final class LoggingConfigProto { + private LoggingConfigProto() {} + + 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_logging_v2_IndexConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_IndexConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_LogBucket_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_LogBucket_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_LogView_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_LogView_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_LogSink_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_LogSink_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_BigQueryDataset_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_BigQueryDataset_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_Link_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_Link_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_BigQueryOptions_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_BigQueryOptions_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_ListBucketsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_ListBucketsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_ListBucketsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_ListBucketsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_CreateBucketRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_CreateBucketRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_UpdateBucketRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_UpdateBucketRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_GetBucketRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_GetBucketRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_DeleteBucketRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_DeleteBucketRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_UndeleteBucketRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_UndeleteBucketRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_ListViewsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_ListViewsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_ListViewsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_ListViewsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_CreateViewRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_CreateViewRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_UpdateViewRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_UpdateViewRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_GetViewRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_GetViewRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_DeleteViewRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_DeleteViewRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_ListSinksRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_ListSinksRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_ListSinksResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_ListSinksResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_GetSinkRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_GetSinkRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_CreateSinkRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_CreateSinkRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_UpdateSinkRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_UpdateSinkRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_DeleteSinkRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_DeleteSinkRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_CreateLinkRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_CreateLinkRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_DeleteLinkRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_DeleteLinkRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_ListLinksRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_ListLinksRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_ListLinksResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_ListLinksResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_GetLinkRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_GetLinkRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_LogExclusion_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_LogExclusion_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_ListExclusionsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_ListExclusionsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_ListExclusionsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_ListExclusionsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_GetExclusionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_GetExclusionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_CreateExclusionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_CreateExclusionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_UpdateExclusionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_UpdateExclusionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_DeleteExclusionRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_DeleteExclusionRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_GetCmekSettingsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_GetCmekSettingsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_UpdateCmekSettingsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_UpdateCmekSettingsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_CmekSettings_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_CmekSettings_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_GetSettingsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_GetSettingsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_UpdateSettingsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_UpdateSettingsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_Settings_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_Settings_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_CopyLogEntriesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_CopyLogEntriesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_CopyLogEntriesMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_CopyLogEntriesMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_CopyLogEntriesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_CopyLogEntriesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_BucketMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_BucketMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_LinkMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_LinkMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_LocationMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_LocationMetadata_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/logging/v2/logging_config.proto" + + "\022\021google.logging.v2\032\034google/api/annotati" + + "ons.proto\032\027google/api/client.proto\032\037goog" + + "le/api/field_behavior.proto\032\031google/api/" + + "resource.proto\032#google/longrunning/opera" + + "tions.proto\032\033google/protobuf/empty.proto\032" + + " google/protobuf/field_mask.proto\032\037google/protobuf/timestamp.proto\"\215\001\n" + + "\013IndexConfig\022\027\n\n" + + "field_path\030\001 \001(\tB\003\340A\002\022/\n" + + "\004type\030\002 \001(\0162\034.google.logging.v2.IndexTypeB\003\340A\002\0224\n" + + "\013create_time\030\003" + + " \001(\0132\032.google.protobuf.TimestampB\003\340A\003\"\325\005\n" + + "\tLogBucket\022\021\n" + + "\004name\030\001 \001(\tB\003\340A\003\022\023\n" + + "\013description\030\003 \001(\t\0224\n" + + "\013create_time\030\004 \001(\0132\032.google.protobuf.TimestampB\003\340A\003\0224\n" + + "\013update_time\030\005" + + " \001(\0132\032.google.protobuf.TimestampB\003\340A\003\022\026\n" + + "\016retention_days\030\013 \001(\005\022\016\n" + + "\006locked\030\t \001(\010\022?\n" + + "\017lifecycle_state\030\014 \001(\0162!" + + ".google.logging.v2.LifecycleStateB\003\340A\003\022\031\n" + + "\021analytics_enabled\030\016 \001(\010\022\031\n" + + "\021restricted_fields\030\017 \003(\t\0225\n\r" + + "index_configs\030\021 \003(\0132\036.google.logging.v2.IndexConfig\0226\n\r" + + "cmek_settings\030\023" + + " \001(\0132\037.google.logging.v2.CmekSettings:\245\002\352A\241\002\n" + + " logging.googleapis.com/LogBucket\0228projects/{project}/locations/{loca" + + "tion}/buckets/{bucket}\022Borganizations/{organization}/locations/{location}/bucket" + + "s/{bucket}\0226folders/{folder}/locations/{location}/buckets/{bucket}\022GbillingAccou" + + "nts/{billing_account}/locations/{location}/buckets/{bucket}\"\202\004\n" + + "\007LogView\022\014\n" + + "\004name\030\001 \001(\t\022\023\n" + + "\013description\030\003 \001(\t\0224\n" + + "\013create_time\030\004 \001(\0132\032.google.protobuf.TimestampB\003\340A\003\0224\n" + + "\013update_time\030\005" + + " \001(\0132\032.google.protobuf.TimestampB\003\340A\003\022\016\n" + + "\006filter\030\007 \001(\t:\327\002\352A\323\002\n" + + "\036logging.googleapis.com/LogView\022Eprojects/" + + "{project}/locations/{location}/buckets/{bucket}/views/{view}\022Oorganizations/{org" + + "anization}/locations/{location}/buckets/{bucket}/views/{view}\022Cfolders/{folder}/" + + "locations/{location}/buckets/{bucket}/views/{view}\022TbillingAccounts/{billing_acc" + + "ount}/locations/{location}/buckets/{bucket}/views/{view}\"\205\006\n" + + "\007LogSink\022\021\n" + + "\004name\030\001 \001(\tB\003\340A\002\022\036\n" + + "\013destination\030\003 \001(\tB\t\340A\002\372A\003\n" + + "\001*\022\023\n" + + "\006filter\030\005 \001(\tB\003\340A\001\022\030\n" + + "\013description\030\022 \001(\tB\003\340A\001\022\025\n" + + "\010disabled\030\023 \001(\010B\003\340A\001\0228\n\n" + + "exclusions\030\020 \003(\0132\037.google.logging.v2.LogExclusionB\003\340A\001\022K\n" + + "\025output_version_format\030\006 \001(\0162(" + + ".google.logging.v2.LogSink.VersionFormatB\002\030\001\022\034\n" + + "\017writer_identity\030\010 \001(\tB\003\340A\003\022\035\n" + + "\020include_children\030\t \001(\010B\003\340A\001\022C\n" + + "\020bigquery_options\030\014" + + " \001(\0132\".google.logging.v2.BigQueryOptionsB\003\340A\001H\000\0224\n" + + "\013create_time\030\r" + + " \001(\0132\032.google.protobuf.TimestampB\003\340A\003\0224\n" + + "\013update_time\030\016 \001(\0132\032.google.protobuf.TimestampB\003\340A\003\"?\n\r" + + "VersionFormat\022\036\n" + + "\032VERSION_FORMAT_UNSPECIFIED\020\000\022\006\n" + + "\002V2\020\001\022\006\n" + + "\002V1\020\002:\277\001\352A\273\001\n" + + "\036logging.googleapis.com/LogSink\022\037projects/{pr" + + "oject}/sinks/{sink}\022)organizations/{orga" + + "nization}/sinks/{sink}\022\035folders/{folder}" + + "/sinks/{sink}\022.billingAccounts/{billing_account}/sinks/{sink}B\t\n" + + "\007options\"*\n" + + "\017BigQueryDataset\022\027\n\n" + + "dataset_id\030\001 \001(\tB\003\340A\003\"\265\004\n" + + "\004Link\022\014\n" + + "\004name\030\001 \001(\t\022\023\n" + + "\013description\030\002 \001(\t\0224\n" + + "\013create_time\030\003 \001(\0132\032.google.protobuf.TimestampB\003\340A\003\022?\n" + + "\017lifecycle_state\030\004 \001(\0162" + + "!.google.logging.v2.LifecycleStateB\003\340A\003\022<\n" + + "\020bigquery_dataset\030\005" + + " \001(\0132\".google.logging.v2.BigQueryDataset:\324\002\352A\320\002\n" + + "\033logging.googleapis.com/Link\022Eprojects/{project}/lo" + + "cations/{location}/buckets/{bucket}/links/{link}\022Oorganizations/{organization}/l" + + "ocations/{location}/buckets/{bucket}/links/{link}\022Cfolders/{folder}/locations/{l" + + "ocation}/buckets/{bucket}/links/{link}\022TbillingAccounts/{billing_account}/locati" + + "ons/{location}/buckets/{bucket}/links/{link}\"g\n" + + "\017BigQueryOptions\022#\n" + + "\026use_partitioned_tables\030\001 \001(\010B\003\340A\001\022/\n" + + "\"uses_timestamp_column_partitioning\030\003 \001(\010B\003\340A\003\"\177\n" + + "\022ListBucketsRequest\0228\n" + + "\006parent\030\001 \001(\tB(\340A\002\372A\"\022" + + " logging.googleapis.com/LogBucket\022\027\n\n" + + "page_token\030\002 \001(\tB\003\340A\001\022\026\n" + + "\tpage_size\030\003 \001(\005B\003\340A\001\"]\n" + + "\023ListBucketsResponse\022-\n" + + "\007buckets\030\001 \003(\0132\034.google.logging.v2.LogBucket\022\027\n" + + "\017next_page_token\030\002 \001(\t\"\232\001\n" + + "\023CreateBucketRequest\0228\n" + + "\006parent\030\001 \001(\tB(\340A\002\372A\"\022" + + " logging.googleapis.com/LogBucket\022\026\n" + + "\tbucket_id\030\002 \001(\tB\003\340A\002\0221\n" + + "\006bucket\030\003" + + " \001(\0132\034.google.logging.v2.LogBucketB\003\340A\002\"\266\001\n" + + "\023UpdateBucketRequest\0226\n" + + "\004name\030\001 \001(\tB(\340A\002\372A\"\n" + + " logging.googleapis.com/LogBucket\0221\n" + + "\006bucket\030\002 \001(\0132\034.google.logging.v2.LogBucketB\003\340A\002\0224\n" + + "\013update_mask\030\004 \001(\0132\032.google.protobuf.FieldMaskB\003\340A\002\"J\n" + + "\020GetBucketRequest\0226\n" + + "\004name\030\001 \001(\tB(\340A\002\372A\"\n" + + " logging.googleapis.com/LogBucket\"M\n" + + "\023DeleteBucketRequest\0226\n" + + "\004name\030\001 \001(\tB(\340A\002\372A\"\n" + + " logging.googleapis.com/LogBucket\"O\n" + + "\025UndeleteBucketRequest\0226\n" + + "\004name\030\001 \001(\tB(\340A\002\372A\"\n" + + " logging.googleapis.com/LogBucket\"X\n" + + "\020ListViewsRequest\022\023\n" + + "\006parent\030\001 \001(\tB\003\340A\002\022\027\n\n" + + "page_token\030\002 \001(\tB\003\340A\001\022\026\n" + + "\tpage_size\030\003 \001(\005B\003\340A\001\"W\n" + + "\021ListViewsResponse\022)\n" + + "\005views\030\001 \003(\0132\032.google.logging.v2.LogView\022\027\n" + + "\017next_page_token\030\002 \001(\t\"m\n" + + "\021CreateViewRequest\022\023\n" + + "\006parent\030\001 \001(\tB\003\340A\002\022\024\n" + + "\007view_id\030\002 \001(\tB\003\340A\002\022-\n" + + "\004view\030\003 \001(\0132\032.google.logging.v2.LogViewB\003\340A\002\"\213\001\n" + + "\021UpdateViewRequest\022\021\n" + + "\004name\030\001 \001(\tB\003\340A\002\022-\n" + + "\004view\030\002 \001(\0132\032.google.logging.v2.LogViewB\003\340A\002\0224\n" + + "\013update_mask\030\004 \001(\0132\032.google.protobuf.FieldMaskB\003\340A\001\"F\n" + + "\016GetViewRequest\0224\n" + + "\004name\030\001 \001(\tB&\340A\002\372A \n" + + "\036logging.googleapis.com/LogView\"I\n" + + "\021DeleteViewRequest\0224\n" + + "\004name\030\001 \001(\tB&\340A\002\372A \n" + + "\036logging.googleapis.com/LogView\"{\n" + + "\020ListSinksRequest\0226\n" + + "\006parent\030\001 \001(\tB&\340A\002\372A" + + " \022\036logging.googleapis.com/LogSink\022\027\n\n" + + "page_token\030\002 \001(\tB\003\340A\001\022\026\n" + + "\tpage_size\030\003 \001(\005B\003\340A\001\"W\n" + + "\021ListSinksResponse\022)\n" + + "\005sinks\030\001 \003(\0132\032.google.logging.v2.LogSink\022\027\n" + + "\017next_page_token\030\002 \001(\t\"K\n" + + "\016GetSinkRequest\0229\n" + + "\tsink_name\030\001 \001(\tB&\340A\002\372A \n" + + "\036logging.googleapis.com/LogSink\"\237\001\n" + + "\021CreateSinkRequest\0226\n" + + "\006parent\030\001 \001(\tB&\340A\002\372A" + + " \022\036logging.googleapis.com/LogSink\022-\n" + + "\004sink\030\002 \001(\0132\032.google.logging.v2.LogSinkB\003\340A\002\022#\n" + + "\026unique_writer_identity\030\003 \001(\010B\003\340A\001\"\330\001\n" + + "\021UpdateSinkRequest\0229\n" + + "\tsink_name\030\001 \001(\tB&\340A\002\372A \n" + + "\036logging.googleapis.com/LogSink\022-\n" + + "\004sink\030\002 \001(\0132\032.google.logging.v2.LogSinkB\003\340A\002\022#\n" + + "\026unique_writer_identity\030\003 \001(\010B\003\340A\001\0224\n" + + "\013update_mask\030\004 \001(\0132\032.google.protobuf.FieldMaskB\003\340A\001\"N\n" + + "\021DeleteSinkRequest\0229\n" + + "\tsink_name\030\001 \001(\tB&\340A\002\372A \n" + + "\036logging.googleapis.com/LogSink\"\212\001\n" + + "\021CreateLinkRequest\0223\n" + + "\006parent\030\001 \001(" + + "\tB#\340A\002\372A\035\022\033logging.googleapis.com/Link\022*\n" + + "\004link\030\002 \001(\0132\027.google.logging.v2.LinkB\003\340A\002\022\024\n" + + "\007link_id\030\003 \001(\tB\003\340A\002\"F\n" + + "\021DeleteLinkRequest\0221\n" + + "\004name\030\001 \001(\tB#\340A\002\372A\035\n" + + "\033logging.googleapis.com/Link\"x\n" + + "\020ListLinksRequest\0223\n" + + "\006parent\030\001 \001(" + + "\tB#\340A\002\372A\035\022\033logging.googleapis.com/Link\022\027\n\n" + + "page_token\030\002 \001(\tB\003\340A\001\022\026\n" + + "\tpage_size\030\003 \001(\005B\003\340A\001\"T\n" + + "\021ListLinksResponse\022&\n" + + "\005links\030\001 \003(\0132\027.google.logging.v2.Link\022\027\n" + + "\017next_page_token\030\002 \001(\t\"C\n" + + "\016GetLinkRequest\0221\n" + + "\004name\030\001 \001(\tB#\340A\002\372A\035\n" + + "\033logging.googleapis.com/Link\"\302\003\n" + + "\014LogExclusion\022\021\n" + + "\004name\030\001 \001(\tB\003\340A\002\022\030\n" + + "\013description\030\002 \001(\tB\003\340A\001\022\023\n" + + "\006filter\030\003 \001(\tB\003\340A\002\022\025\n" + + "\010disabled\030\004 \001(\010B\003\340A\001\0224\n" + + "\013create_time\030\005 \001(\0132\032.google.protobuf.TimestampB\003\340A\003\0224\n" + + "\013update_time\030\006" + + " \001(\0132\032.google.protobuf.TimestampB\003\340A\003:\354\001\352A\350\001\n" + + "#logging.googleapis.com/LogExclusion\022)projects" + + "/{project}/exclusions/{exclusion}\0223organizations/{organization}/exclusions/{excl" + + "usion}\022\'folders/{folder}/exclusions/{exc" + + "lusion}\0228billingAccounts/{billing_account}/exclusions/{exclusion}\"\205\001\n" + + "\025ListExclusionsRequest\022;\n" + + "\006parent\030\001 \001(" + + "\tB+\340A\002\372A%\022#logging.googleapis.com/LogExclusion\022\027\n\n" + + "page_token\030\002 \001(\tB\003\340A\001\022\026\n" + + "\tpage_size\030\003 \001(\005B\003\340A\001\"f\n" + + "\026ListExclusionsResponse\0223\n\n" + + "exclusions\030\001 \003(\0132\037.google.logging.v2.LogExclusion\022\027\n" + + "\017next_page_token\030\002 \001(\t\"P\n" + + "\023GetExclusionRequest\0229\n" + + "\004name\030\001 \001(\tB+\340A\002\372A%\n" + + "#logging.googleapis.com/LogExclusion\"\216\001\n" + + "\026CreateExclusionRequest\022;\n" + + "\006parent\030\001 \001(" + + "\tB+\340A\002\372A%\022#logging.googleapis.com/LogExclusion\0227\n" + + "\texclusion\030\002" + + " \001(\0132\037.google.logging.v2.LogExclusionB\003\340A\002\"\302\001\n" + + "\026UpdateExclusionRequest\0229\n" + + "\004name\030\001 \001(\tB+\340A\002\372A%\n" + + "#logging.googleapis.com/LogExclusion\0227\n" + + "\texclusion\030\002 \001(\0132\037.google.logging.v2.LogExclusionB\003\340A\002\0224\n" + + "\013update_mask\030\003 \001(\0132\032.google.protobuf.FieldMaskB\003\340A\002\"S\n" + + "\026DeleteExclusionRequest\0229\n" + + "\004name\030\001 \001(\tB+\340A\002\372A%\n" + + "#logging.googleapis.com/LogExclusion\"S\n" + + "\026GetCmekSettingsRequest\0229\n" + + "\004name\030\001 \001(\tB+\340A\002\372A%\n" + + "#logging.googleapis.com/CmekSettings\"\241\001\n" + + "\031UpdateCmekSettingsRequest\022\021\n" + + "\004name\030\001 \001(\tB\003\340A\002\022;\n\r" + + "cmek_settings\030\002" + + " \001(\0132\037.google.logging.v2.CmekSettingsB\003\340A\002\0224\n" + + "\013update_mask\030\003" + + " \001(\0132\032.google.protobuf.FieldMaskB\003\340A\001\"\275\002\n" + + "\014CmekSettings\022\021\n" + + "\004name\030\001 \001(\tB\003\340A\003\022\024\n" + + "\014kms_key_name\030\002 \001(\t\022\034\n" + + "\024kms_key_version_name\030\004 \001(\t\022\037\n" + + "\022service_account_id\030\003 \001(\tB\003\340A\003:\304\001\352A\300\001\n" + + "#logging.googleapis.com/CmekSettings\022\037projects/{" + + "project}/cmekSettings\022)organizations/{or" + + "ganization}/cmekSettings\022\035folders/{folde" + + "r}/cmekSettings\022.billingAccounts/{billing_account}/cmekSettings\"K\n" + + "\022GetSettingsRequest\0225\n" + + "\004name\030\001 \001(\tB\'\340A\002\372A!\n" + + "\037logging.googleapis.com/Settings\"\224\001\n" + + "\025UpdateSettingsRequest\022\021\n" + + "\004name\030\001 \001(\tB\003\340A\002\0222\n" + + "\010settings\030\002 \001(\0132\033.google.logging.v2.SettingsB\003\340A\002\0224\n" + + "\013update_mask\030\003" + + " \001(\0132\032.google.protobuf.FieldMaskB\003\340A\001\"\322\002\n" + + "\010Settings\022\021\n" + + "\004name\030\001 \001(\tB\003\340A\003\022\031\n" + + "\014kms_key_name\030\002 \001(\tB\003\340A\001\022#\n" + + "\026kms_service_account_id\030\003 \001(\tB\003\340A\003\022\035\n" + + "\020storage_location\030\004 \001(\tB\003\340A\001\022!\n" + + "\024disable_default_sink\030\005 \001(\010B\003\340A\001:\260\001\352A\254\001\n" + + "\037logging.googleapis.com/Settings\022\033projects/{project}/settin" + + "gs\022%organizations/{organization}/setting" + + "s\022\031folders/{folder}/settings\022*billingAccounts/{billing_account}/settings\"Y\n" + + "\025CopyLogEntriesRequest\022\021\n" + + "\004name\030\001 \001(\tB\003\340A\002\022\023\n" + + "\006filter\030\003 \001(\tB\003\340A\001\022\030\n" + + "\013destination\030\004 \001(\tB\003\340A\002\"\256\002\n" + + "\026CopyLogEntriesMetadata\022.\n\n" + + "start_time\030\001 \001(\0132\032.google.protobuf.Timestamp\022,\n" + + "\010end_time\030\002 \001(\0132\032.google.protobuf.Timestamp\0220\n" + + "\005state\030\003 \001(\0162!.google.logging.v2.OperationState\022\036\n" + + "\026cancellation_requested\030\004 \001(\010\0229\n" + + "\007request\030\005 \001(\0132(.google.logging.v2.CopyLogEntriesRequest\022\020\n" + + "\010progress\030\006 \001(\005\022\027\n" + + "\017writer_identity\030\007 \001(\t\":\n" + + "\026CopyLogEntriesResponse\022 \n" + + "\030log_entries_copied_count\030\001 \001(\003\"\275\002\n" + + "\016BucketMetadata\022.\n\n" + + "start_time\030\001 \001(\0132\032.google.protobuf.Timestamp\022,\n" + + "\010end_time\030\002 \001(\0132\032.google.protobuf.Timestamp\0220\n" + + "\005state\030\003 \001(\0162!.google.logging.v2.OperationState\022G\n" + + "\025create_bucket_request\030\004 \001" + + "(\0132&.google.logging.v2.CreateBucketRequestH\000\022G\n" + + "\025update_bucket_request\030\005" + + " \001(\0132&.google.logging.v2.UpdateBucketRequestH\000B\t\n" + + "\007request\"\263\002\n" + + "\014LinkMetadata\022.\n\n" + + "start_time\030\001 \001(\0132\032.google.protobuf.Timestamp\022,\n" + + "\010end_time\030\002 \001(\0132\032.google.protobuf.Timestamp\0220\n" + + "\005state\030\003 \001(\0162!.google.logging.v2.OperationState\022C\n" + + "\023create_link_request\030\004 \001(\0132$" + + ".google.logging.v2.CreateLinkRequestH\000\022C\n" + + "\023delete_link_request\030\005 \001(\0132$.google.logging.v2.DeleteLinkRequestH\000B" + + "\t\n" + + "\007request\"1\n" + + "\020LocationMetadata\022\035\n" + + "\025log_analytics_enabled\030\001 \001(\010*\364\001\n" + + "\016OperationState\022\037\n" + + "\033OPERATION_STATE_UNSPECIFIED\020\000\022\035\n" + + "\031OPERATION_STATE_SCHEDULED\020\001\022+\n" + + "\'OPERATION_STATE_WAITING_FOR_PERMISSIONS\020\002\022\033\n" + + "\027OPERATION_STATE_RUNNING\020\003\022\035\n" + + "\031OPERATION_STATE_SUCCEEDED\020\004\022\032\n" + + "\026OPERATION_STATE_FAILED\020\005\022\035\n" + + "\031OPERATION_STATE_CANCELLED\020\006*{\n" + + "\016LifecycleState\022\037\n" + + "\033LIFECYCLE_STATE_UNSPECIFIED\020\000\022\n\n" + + "\006ACTIVE\020\001\022\024\n" + + "\020DELETE_REQUESTED\020\002\022\014\n" + + "\010UPDATING\020\003\022\014\n" + + "\010CREATING\020\004\022\n\n" + + "\006FAILED\020\005*V\n" + + "\tIndexType\022\032\n" + + "\026INDEX_TYPE_UNSPECIFIED\020\000\022\025\n" + + "\021INDEX_TYPE_STRING\020\001\022\026\n" + + "\022INDEX_TYPE_INTEGER\020\0022\237Y\n" + + "\017ConfigServiceV2\022\334\002\n" + + "\013ListBuckets\022%.google.logging.v2.ListBucketsRequest\032&.google.loggin" + + "g.v2.ListBucketsResponse\"\375\001\332A\006parent\202\323\344\223" + + "\002\355\001\022$/v2/{parent=*/*/locations/*}/bucket" + + "sZ-\022+/v2/{parent=projects/*/locations/*}/bucketsZ2\0220/v2/{parent=organizations/*/" + + "locations/*}/bucketsZ,\022*/v2/{parent=folders/*/locations/*}/bucketsZ4\0222/v2/{paren" + + "t=billingAccounts/*/locations/*}/buckets\022\305\002\n" + + "\tGetBucket\022#.google.logging.v2.GetBucketRequest\032\034.google.logging.v2.LogBucke" + + "t\"\364\001\202\323\344\223\002\355\001\022$/v2/{name=*/*/locations/*/b" + + "uckets/*}Z-\022+/v2/{name=projects/*/locations/*/buckets/*}Z2\0220/v2/{name=organizati" + + "ons/*/locations/*/buckets/*}Z,\022*/v2/{name=folders/*/locations/*/buckets/*}Z4\0222/v" + + "2/{name=billingAccounts/*/locations/*/buckets/*}\022\323\003\n" + + "\021CreateBucketAsync\022&.google." + + "logging.v2.CreateBucketRequest\032\035.google.longrunning.Operation\"\366\002\312A\033\n" + + "\tLogBucket\022\016BucketMetadata\202\323\344\223\002\321\002\"0/v2/{parent=*/*/l" + + "ocations/*}/buckets:createAsync:\006bucketZA\"7/v2/{parent=projects/*/locations/*}/b" + + "uckets:createAsync:\006bucketZF\"/v2/{parent=billingAccounts/*/lo" + + "cations/*}/buckets:createAsync:\006bucket\022\323\003\n" + + "\021UpdateBucketAsync\022&.google.logging.v2" + + ".UpdateBucketRequest\032\035.google.longrunning.Operation\"\366\002\312A\033\n" + + "\tLogBucket\022\016BucketMeta" + + "data\202\323\344\223\002\321\002\"0/v2/{name=*/*/locations/*/b" + + "uckets/*}:updateAsync:\006bucketZA\"7/v2/{name=projects/*/locations/*/buckets/*}:upd" + + "ateAsync:\006bucketZF\"/v" + + "2/{name=billingAccounts/*/locations/*/buckets/*}:updateAsync:\006bucket\022\363\002\n" + + "\014CreateBucket\022&.google.logging.v2.CreateBucketRe" + + "quest\032\034.google.logging.v2.LogBucket\"\234\002\202\323" + + "\344\223\002\225\002\"$/v2/{parent=*/*/locations/*}/buck" + + "ets:\006bucketZ5\"+/v2/{parent=projects/*/lo" + + "cations/*}/buckets:\006bucketZ:\"0/v2/{paren" + + "t=organizations/*/locations/*}/buckets:\006bucketZ4\"*/v2/{parent=folders/*/location" + + "s/*}/buckets:\006bucketZ<\"2/v2/{parent=bill" + + "ingAccounts/*/locations/*}/buckets:\006bucket\022\363\002\n" + + "\014UpdateBucket\022&.google.logging.v2.UpdateBucketRequest\032\034.google.logging.v2." + + "LogBucket\"\234\002\202\323\344\223\002\225\0022$/v2/{name=*/*/locat" + + "ions/*/buckets/*}:\006bucketZ52+/v2/{name=projects/*/locations/*/buckets/*}:\006bucket" + + "Z:20/v2/{name=organizations/*/locations/*/buckets/*}:\006bucketZ42*/v2/{name=folder" + + "s/*/locations/*/buckets/*}:\006bucketZ<22/v" + + "2/{name=billingAccounts/*/locations/*/buckets/*}:\006bucket\022\305\002\n" + + "\014DeleteBucket\022&.google.logging.v2.DeleteBucketRequest\032\026.goog" + + "le.protobuf.Empty\"\364\001\202\323\344\223\002\355\001*$/v2/{name=*" + + "/*/locations/*/buckets/*}Z-*+/v2/{name=projects/*/locations/*/buckets/*}Z2*0/v2/" + + "{name=organizations/*/locations/*/buckets/*}Z,**/v2/{name=folders/*/locations/*/" + + "buckets/*}Z4*2/v2/{name=billingAccounts/*/locations/*/buckets/*}\022\205\003\n" + + "\016UndeleteBucket\022(.google.logging.v2.UndeleteBucketRe" + + "quest\032\026.google.protobuf.Empty\"\260\002\202\323\344\223\002\251\002\"" + + "-/v2/{name=*/*/locations/*/buckets/*}:undelete:\001*Z9\"4/v2/{name=projects/*/locati" + + "ons/*/buckets/*}:undelete:\001*Z>\"9/v2/{name=organizations/*/locations/*/buckets/*}" + + ":undelete:\001*Z8\"3/v2/{name=folders/*/loca" + + "tions/*/buckets/*}:undelete:\001*Z@\";/v2/{n" + + "ame=billingAccounts/*/locations/*/buckets/*}:undelete:\001*\022\376\002\n" + + "\tListViews\022#.google.logging.v2.ListViewsRequest\032$.google.log" + + "ging.v2.ListViewsResponse\"\245\002\332A\006parent\202\323\344" + + "\223\002\225\002\022,/v2/{parent=*/*/locations/*/bucket" + + "s/*}/viewsZ5\0223/v2/{parent=projects/*/locations/*/buckets/*}/viewsZ:\0228/v2/{parent" + + "=organizations/*/locations/*/buckets/*}/viewsZ4\0222/v2/{parent=folders/*/locations" + + "/*/buckets/*}/viewsZ<\022:/v2/{parent=billi" + + "ngAccounts/*/locations/*/buckets/*}/views\022\347\002\n" + + "\007GetView\022!.google.logging.v2.GetVie" + + "wRequest\032\032.google.logging.v2.LogView\"\234\002\202" + + "\323\344\223\002\225\002\022,/v2/{name=*/*/locations/*/bucket" + + "s/*/views/*}Z5\0223/v2/{name=projects/*/locations/*/buckets/*/views/*}Z:\0228/v2/{name" + + "=organizations/*/locations/*/buckets/*/views/*}Z4\0222/v2/{name=folders/*/locations" + + "/*/buckets/*/views/*}Z<\022:/v2/{name=billi" + + "ngAccounts/*/locations/*/buckets/*/views/*}\022\213\003\n\n" + + "CreateView\022$.google.logging.v2.CreateViewRequest\032\032.google.logging.v2.Log" + + "View\"\272\002\202\323\344\223\002\263\002\",/v2/{parent=*/*/location" + + "s/*/buckets/*}/views:\004viewZ;\"3/v2/{parent=projects/*/locations/*/buckets/*}/view" + + "s:\004viewZ@\"8/v2/{parent=organizations/*/l" + + "ocations/*/buckets/*}/views:\004viewZ:\"2/v2/{parent=folders/*/locations/*/buckets/*" + + "}/views:\004viewZB\":/v2/{parent=billingAcco" + + "unts/*/locations/*/buckets/*}/views:\004view\022\213\003\n\n" + + "UpdateView\022$.google.logging.v2.UpdateViewRequest\032\032.google.logging.v2.LogVi" + + "ew\"\272\002\202\323\344\223\002\263\0022,/v2/{name=*/*/locations/*/" + + "buckets/*/views/*}:\004viewZ;23/v2/{name=projects/*/locations/*/buckets/*/views/*}:" + + "\004viewZ@28/v2/{name=organizations/*/locations/*/buckets/*/views/*}:\004viewZ:22/v2/{" + + "name=folders/*/locations/*/buckets/*/views/*}:\004viewZB2:/v2/{name=billingAccounts" + + "/*/locations/*/buckets/*/views/*}:\004view\022\351\002\n\n" + + "DeleteView\022$.google.logging.v2.Delet" + + "eViewRequest\032\026.google.protobuf.Empty\"\234\002\202" + + "\323\344\223\002\225\002*,/v2/{name=*/*/locations/*/bucket" + + "s/*/views/*}Z5*3/v2/{name=projects/*/locations/*/buckets/*/views/*}Z:*8/v2/{name" + + "=organizations/*/locations/*/buckets/*/views/*}Z4*2/v2/{name=folders/*/locations" + + "/*/buckets/*/views/*}Z<*:/v2/{name=billi" + + "ngAccounts/*/locations/*/buckets/*/views/*}\022\220\002\n" + + "\tListSinks\022#.google.logging.v2.ListSinksRequest\032$.google.logging.v2.ListS" + + "inksResponse\"\267\001\332A\006parent\202\323\344\223\002\247\001\022\026/v2/{pa" + + "rent=*/*}/sinksZ\037\022\035/v2/{parent=projects/" + + "*}/sinksZ$\022\"/v2/{parent=organizations/*}" + + "/sinksZ\036\022\034/v2/{parent=folders/*}/sinksZ&" + + "\022$/v2/{parent=billingAccounts/*}/sinks\022\236\002\n" + + "\007GetSink\022!.google.logging.v2.GetSinkRequest\032\032.google.logging.v2.LogSink\"\323\001\332A" + + "\tsink_name\202\323\344\223\002\300\001\022\033/v2/{sink_name=*/*/sink" + + "s/*}Z$\022\"/v2/{sink_name=projects/*/sinks/" + + "*}Z)\022\'/v2/{sink_name=organizations/*/sin" + + "ks/*}Z#\022!/v2/{sink_name=folders/*/sinks/" + + "*}Z+\022)/v2/{sink_name=billingAccounts/*/sinks/*}\022\253\002\n\n" + + "CreateSink\022$.google.logging.v2.CreateSinkRequest\032\032.google.logging.v2" + + ".LogSink\"\332\001\332A\013parent,sink\202\323\344\223\002\305\001\"\026/v2/{p" + + "arent=*/*}/sinks:\004sinkZ%\"\035/v2/{parent=pr" + + "ojects/*}/sinks:\004sinkZ*\"\"/v2/{parent=org" + + "anizations/*}/sinks:\004sinkZ$\"\034/v2/{parent" + + "=folders/*}/sinks:\004sinkZ,\"$/v2/{parent=billingAccounts/*}/sinks:\004sink\022\237\004\n\n" + + "UpdateSink\022$.google.logging.v2.UpdateSinkReque" + + "st\032\032.google.logging.v2.LogSink\"\316\003\332A\032sink" + + "_name,sink,update_mask\332A\016sink_name,sink\202" + + "\323\344\223\002\231\003\032\033/v2/{sink_name=*/*/sinks/*}:\004sin" + + "kZ*\032\"/v2/{sink_name=projects/*/sinks/*}:" + + "\004sinkZ/\032\'/v2/{sink_name=organizations/*/" + + "sinks/*}:\004sinkZ)\032!/v2/{sink_name=folders" + + "/*/sinks/*}:\004sinkZ1\032)/v2/{sink_name=bill" + + "ingAccounts/*/sinks/*}:\004sinkZ*2\"/v2/{sin", + "k_name=projects/*/sinks/*}:\004sinkZ/2\'/v2/" + + "{sink_name=organizations/*/sinks/*}:\004sin" + + "kZ)2!/v2/{sink_name=folders/*/sinks/*}:\004" + + "sinkZ12)/v2/{sink_name=billingAccounts/*" + + "/sinks/*}:\004sink\022\240\002\n\nDeleteSink\022$.google." + + "logging.v2.DeleteSinkRequest\032\026.google.pr" + + "otobuf.Empty\"\323\001\332A\tsink_name\202\323\344\223\002\300\001*\033/v2/" + + "{sink_name=*/*/sinks/*}Z$*\"/v2/{sink_nam" + + "e=projects/*/sinks/*}Z)*\'/v2/{sink_name=" + + "organizations/*/sinks/*}Z#*!/v2/{sink_na" + + "me=folders/*/sinks/*}Z+*)/v2/{sink_name=" + + "billingAccounts/*/sinks/*}\022\273\003\n\nCreateLin" + + "k\022$.google.logging.v2.CreateLinkRequest\032" + + "\035.google.longrunning.Operation\"\347\002\312A\024\n\004Li" + + "nk\022\014LinkMetadata\332A\023parent,link,link_id\202\323" + + "\344\223\002\263\002\",/v2/{parent=*/*/locations/*/bucke" + + "ts/*}/links:\004linkZ;\"3/v2/{parent=project" + + "s/*/locations/*/buckets/*}/links:\004linkZ@" + + "\"8/v2/{parent=organizations/*/locations/" + + "*/buckets/*}/links:\004linkZ:\"2/v2/{parent=" + + "folders/*/locations/*/buckets/*}/links:\004" + + "linkZB\":/v2/{parent=billingAccounts/*/lo" + + "cations/*/buckets/*}/links:\004link\022\237\003\n\nDel" + + "eteLink\022$.google.logging.v2.DeleteLinkRe" + + "quest\032\035.google.longrunning.Operation\"\313\002\312" + + "A%\n\025google.protobuf.Empty\022\014LinkMetadata\332" + + "A\004name\202\323\344\223\002\225\002*,/v2/{name=*/*/locations/*" + + "/buckets/*/links/*}Z5*3/v2/{name=project" + + "s/*/locations/*/buckets/*/links/*}Z:*8/v" + + "2/{name=organizations/*/locations/*/buck" + + "ets/*/links/*}Z4*2/v2/{name=folders/*/lo" + + "cations/*/buckets/*/links/*}Z<*:/v2/{nam" + + "e=billingAccounts/*/locations/*/buckets/" + + "*/links/*}\022\376\002\n\tListLinks\022#.google.loggin" + + "g.v2.ListLinksRequest\032$.google.logging.v" + + "2.ListLinksResponse\"\245\002\332A\006parent\202\323\344\223\002\225\002\022," + + "/v2/{parent=*/*/locations/*/buckets/*}/l" + + "inksZ5\0223/v2/{parent=projects/*/locations" + + "/*/buckets/*}/linksZ:\0228/v2/{parent=organ" + + "izations/*/locations/*/buckets/*}/linksZ" + + "4\0222/v2/{parent=folders/*/locations/*/buc" + + "kets/*}/linksZ<\022:/v2/{parent=billingAcco" + + "unts/*/locations/*/buckets/*}/links\022\353\002\n\007" + + "GetLink\022!.google.logging.v2.GetLinkReque" + + "st\032\027.google.logging.v2.Link\"\243\002\332A\004name\202\323\344" + + "\223\002\225\002\022,/v2/{name=*/*/locations/*/buckets/" + + "*/links/*}Z5\0223/v2/{name=projects/*/locat" + + "ions/*/buckets/*/links/*}Z:\0228/v2/{name=o" + + "rganizations/*/locations/*/buckets/*/lin" + + "ks/*}Z4\0222/v2/{name=folders/*/locations/*" + + "/buckets/*/links/*}Z<\022:/v2/{name=billing" + + "Accounts/*/locations/*/buckets/*/links/*" + + "}\022\270\002\n\016ListExclusions\022(.google.logging.v2" + + ".ListExclusionsRequest\032).google.logging." + + "v2.ListExclusionsResponse\"\320\001\332A\006parent\202\323\344" + + "\223\002\300\001\022\033/v2/{parent=*/*}/exclusionsZ$\022\"/v2" + + "/{parent=projects/*}/exclusionsZ)\022\'/v2/{" + + "parent=organizations/*}/exclusionsZ#\022!/v" + + "2/{parent=folders/*}/exclusionsZ+\022)/v2/{" + + "parent=billingAccounts/*}/exclusions\022\250\002\n" + + "\014GetExclusion\022&.google.logging.v2.GetExc" + + "lusionRequest\032\037.google.logging.v2.LogExc" + + "lusion\"\316\001\332A\004name\202\323\344\223\002\300\001\022\033/v2/{name=*/*/e" + + "xclusions/*}Z$\022\"/v2/{name=projects/*/exc" + + "lusions/*}Z)\022\'/v2/{name=organizations/*/" + + "exclusions/*}Z#\022!/v2/{name=folders/*/exc" + + "lusions/*}Z+\022)/v2/{name=billingAccounts/" + + "*/exclusions/*}\022\361\002\n\017CreateExclusion\022).go" + + "ogle.logging.v2.CreateExclusionRequest\032\037" + + ".google.logging.v2.LogExclusion\"\221\002\332A\020par" + + "ent,exclusion\202\323\344\223\002\367\001\"\033/v2/{parent=*/*}/e" + + "xclusions:\texclusionZ/\"\"/v2/{parent=proj" + + "ects/*}/exclusions:\texclusionZ4\"\'/v2/{pa" + + "rent=organizations/*}/exclusions:\texclus" + + "ionZ.\"!/v2/{parent=folders/*}/exclusions" + + ":\texclusionZ6\")/v2/{parent=billingAccoun" + + "ts/*}/exclusions:\texclusion\022\373\002\n\017UpdateEx" + + "clusion\022).google.logging.v2.UpdateExclus" + + "ionRequest\032\037.google.logging.v2.LogExclus" + + "ion\"\233\002\332A\032name,exclusion,update_mask\202\323\344\223\002" + + "\367\0012\033/v2/{name=*/*/exclusions/*}:\texclusi" + + "onZ/2\"/v2/{name=projects/*/exclusions/*}" + + ":\texclusionZ42\'/v2/{name=organizations/*" + + "/exclusions/*}:\texclusionZ.2!/v2/{name=f" + + "olders/*/exclusions/*}:\texclusionZ62)/v2" + + "/{name=billingAccounts/*/exclusions/*}:\t" + + "exclusion\022\245\002\n\017DeleteExclusion\022).google.l" + + "ogging.v2.DeleteExclusionRequest\032\026.googl" + + "e.protobuf.Empty\"\316\001\332A\004name\202\323\344\223\002\300\001*\033/v2/{" + + "name=*/*/exclusions/*}Z$*\"/v2/{name=proj" + + "ects/*/exclusions/*}Z)*\'/v2/{name=organi" + + "zations/*/exclusions/*}Z#*!/v2/{name=fol" + + "ders/*/exclusions/*}Z+*)/v2/{name=billin" + + "gAccounts/*/exclusions/*}\022\247\002\n\017GetCmekSet" + + "tings\022).google.logging.v2.GetCmekSetting" + + "sRequest\032\037.google.logging.v2.CmekSetting" + + "s\"\307\001\202\323\344\223\002\300\001\022\033/v2/{name=*/*}/cmekSettings" + + "Z$\022\"/v2/{name=projects/*}/cmekSettingsZ)" + + "\022\'/v2/{name=organizations/*}/cmekSetting" + + "sZ#\022!/v2/{name=folders/*}/cmekSettingsZ+" + + "\022)/v2/{name=billingAccounts/*}/cmekSetti" + + "ngs\022\321\001\n\022UpdateCmekSettings\022,.google.logg" + + "ing.v2.UpdateCmekSettingsRequest\032\037.googl" + + "e.logging.v2.CmekSettings\"l\202\323\344\223\002f2\033/v2/{" + + "name=*/*}/cmekSettings:\rcmek_settingsZ82" + + "\'/v2/{name=organizations/*}/cmekSettings" + + ":\rcmek_settings\022\216\002\n\013GetSettings\022%.google" + + ".logging.v2.GetSettingsRequest\032\033.google." + + "logging.v2.Settings\"\272\001\332A\004name\202\323\344\223\002\254\001\022\027/v" + + "2/{name=*/*}/settingsZ \022\036/v2/{name=proje" + + "cts/*}/settingsZ%\022#/v2/{name=organizatio" + + "ns/*}/settingsZ\037\022\035/v2/{name=folders/*}/s" + + "ettingsZ\'\022%/v2/{name=billingAccounts/*}/" + + "settings\022\366\001\n\016UpdateSettings\022(.google.log" + + "ging.v2.UpdateSettingsRequest\032\033.google.l" + + "ogging.v2.Settings\"\234\001\332A\024settings,update_" + + "mask\202\323\344\223\002\1772\027/v2/{name=*/*}/settings:\010set" + + "tingsZ/2#/v2/{name=organizations/*}/sett" + + "ings:\010settingsZ)2\035/v2/{name=folders/*}/s" + + "ettings:\010settings\022\251\001\n\016CopyLogEntries\022(.g" + + "oogle.logging.v2.CopyLogEntriesRequest\032\035" + + ".google.longrunning.Operation\"N\312A0\n\026Copy" + + "LogEntriesResponse\022\026CopyLogEntriesMetada" + + "ta\202\323\344\223\002\025\"\020/v2/entries:copy:\001*\032\337\001\312A\026loggi" + + "ng.googleapis.com\322A\302\001https://www.googlea" + + "pis.com/auth/cloud-platform,https://www." + + "googleapis.com/auth/cloud-platform.read-" + + "only,https://www.googleapis.com/auth/log" + + "ging.admin,https://www.googleapis.com/au" + + "th/logging.readB\326\003\n\025com.google.logging.v" + + "2B\022LoggingConfigProtoP\001Z5cloud.google.co" + + "m/go/logging/apiv2/loggingpb;loggingpb\370\001" + + "\001\252\002\027Google.Cloud.Logging.V2\312\002\027Google\\Clo" + + "ud\\Logging\\V2\352\002\032Google::Cloud::Logging::" + + "V2\352A`\n+logging.googleapis.com/Organizati" + + "onLocation\0221organizations/{organization}" + + "/locations/{location}\352AN\n%logging.google" + + "apis.com/FolderLocation\022%folders/{folder" + + "}/locations/{location}\352Ag\n-logging.googl" + + "eapis.com/BillingAccountLocation\0226billin" + + "gAccounts/{billing_account}/locations/{l" + + "ocation}b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_logging_v2_IndexConfig_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_logging_v2_IndexConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_IndexConfig_descriptor, + new java.lang.String[] { + "FieldPath", "Type", "CreateTime", + }); + internal_static_google_logging_v2_LogBucket_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_logging_v2_LogBucket_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_LogBucket_descriptor, + new java.lang.String[] { + "Name", + "Description", + "CreateTime", + "UpdateTime", + "RetentionDays", + "Locked", + "LifecycleState", + "AnalyticsEnabled", + "RestrictedFields", + "IndexConfigs", + "CmekSettings", + }); + internal_static_google_logging_v2_LogView_descriptor = getDescriptor().getMessageTypes().get(2); + internal_static_google_logging_v2_LogView_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_LogView_descriptor, + new java.lang.String[] { + "Name", "Description", "CreateTime", "UpdateTime", "Filter", + }); + internal_static_google_logging_v2_LogSink_descriptor = getDescriptor().getMessageTypes().get(3); + internal_static_google_logging_v2_LogSink_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_LogSink_descriptor, + new java.lang.String[] { + "Name", + "Destination", + "Filter", + "Description", + "Disabled", + "Exclusions", + "OutputVersionFormat", + "WriterIdentity", + "IncludeChildren", + "BigqueryOptions", + "CreateTime", + "UpdateTime", + "Options", + }); + internal_static_google_logging_v2_BigQueryDataset_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_logging_v2_BigQueryDataset_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_BigQueryDataset_descriptor, + new java.lang.String[] { + "DatasetId", + }); + internal_static_google_logging_v2_Link_descriptor = getDescriptor().getMessageTypes().get(5); + internal_static_google_logging_v2_Link_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_Link_descriptor, + new java.lang.String[] { + "Name", "Description", "CreateTime", "LifecycleState", "BigqueryDataset", + }); + internal_static_google_logging_v2_BigQueryOptions_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_logging_v2_BigQueryOptions_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_BigQueryOptions_descriptor, + new java.lang.String[] { + "UsePartitionedTables", "UsesTimestampColumnPartitioning", + }); + internal_static_google_logging_v2_ListBucketsRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_logging_v2_ListBucketsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_ListBucketsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageToken", "PageSize", + }); + internal_static_google_logging_v2_ListBucketsResponse_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_logging_v2_ListBucketsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_ListBucketsResponse_descriptor, + new java.lang.String[] { + "Buckets", "NextPageToken", + }); + internal_static_google_logging_v2_CreateBucketRequest_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_logging_v2_CreateBucketRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_CreateBucketRequest_descriptor, + new java.lang.String[] { + "Parent", "BucketId", "Bucket", + }); + internal_static_google_logging_v2_UpdateBucketRequest_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_logging_v2_UpdateBucketRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_UpdateBucketRequest_descriptor, + new java.lang.String[] { + "Name", "Bucket", "UpdateMask", + }); + internal_static_google_logging_v2_GetBucketRequest_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_logging_v2_GetBucketRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_GetBucketRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_logging_v2_DeleteBucketRequest_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_logging_v2_DeleteBucketRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_DeleteBucketRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_logging_v2_UndeleteBucketRequest_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_logging_v2_UndeleteBucketRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_UndeleteBucketRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_logging_v2_ListViewsRequest_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_logging_v2_ListViewsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_ListViewsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageToken", "PageSize", + }); + internal_static_google_logging_v2_ListViewsResponse_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_logging_v2_ListViewsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_ListViewsResponse_descriptor, + new java.lang.String[] { + "Views", "NextPageToken", + }); + internal_static_google_logging_v2_CreateViewRequest_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_google_logging_v2_CreateViewRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_CreateViewRequest_descriptor, + new java.lang.String[] { + "Parent", "ViewId", "View", + }); + internal_static_google_logging_v2_UpdateViewRequest_descriptor = + getDescriptor().getMessageTypes().get(17); + internal_static_google_logging_v2_UpdateViewRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_UpdateViewRequest_descriptor, + new java.lang.String[] { + "Name", "View", "UpdateMask", + }); + internal_static_google_logging_v2_GetViewRequest_descriptor = + getDescriptor().getMessageTypes().get(18); + internal_static_google_logging_v2_GetViewRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_GetViewRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_logging_v2_DeleteViewRequest_descriptor = + getDescriptor().getMessageTypes().get(19); + internal_static_google_logging_v2_DeleteViewRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_DeleteViewRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_logging_v2_ListSinksRequest_descriptor = + getDescriptor().getMessageTypes().get(20); + internal_static_google_logging_v2_ListSinksRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_ListSinksRequest_descriptor, + new java.lang.String[] { + "Parent", "PageToken", "PageSize", + }); + internal_static_google_logging_v2_ListSinksResponse_descriptor = + getDescriptor().getMessageTypes().get(21); + internal_static_google_logging_v2_ListSinksResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_ListSinksResponse_descriptor, + new java.lang.String[] { + "Sinks", "NextPageToken", + }); + internal_static_google_logging_v2_GetSinkRequest_descriptor = + getDescriptor().getMessageTypes().get(22); + internal_static_google_logging_v2_GetSinkRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_GetSinkRequest_descriptor, + new java.lang.String[] { + "SinkName", + }); + internal_static_google_logging_v2_CreateSinkRequest_descriptor = + getDescriptor().getMessageTypes().get(23); + internal_static_google_logging_v2_CreateSinkRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_CreateSinkRequest_descriptor, + new java.lang.String[] { + "Parent", "Sink", "UniqueWriterIdentity", + }); + internal_static_google_logging_v2_UpdateSinkRequest_descriptor = + getDescriptor().getMessageTypes().get(24); + internal_static_google_logging_v2_UpdateSinkRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_UpdateSinkRequest_descriptor, + new java.lang.String[] { + "SinkName", "Sink", "UniqueWriterIdentity", "UpdateMask", + }); + internal_static_google_logging_v2_DeleteSinkRequest_descriptor = + getDescriptor().getMessageTypes().get(25); + internal_static_google_logging_v2_DeleteSinkRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_DeleteSinkRequest_descriptor, + new java.lang.String[] { + "SinkName", + }); + internal_static_google_logging_v2_CreateLinkRequest_descriptor = + getDescriptor().getMessageTypes().get(26); + internal_static_google_logging_v2_CreateLinkRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_CreateLinkRequest_descriptor, + new java.lang.String[] { + "Parent", "Link", "LinkId", + }); + internal_static_google_logging_v2_DeleteLinkRequest_descriptor = + getDescriptor().getMessageTypes().get(27); + internal_static_google_logging_v2_DeleteLinkRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_DeleteLinkRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_logging_v2_ListLinksRequest_descriptor = + getDescriptor().getMessageTypes().get(28); + internal_static_google_logging_v2_ListLinksRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_ListLinksRequest_descriptor, + new java.lang.String[] { + "Parent", "PageToken", "PageSize", + }); + internal_static_google_logging_v2_ListLinksResponse_descriptor = + getDescriptor().getMessageTypes().get(29); + internal_static_google_logging_v2_ListLinksResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_ListLinksResponse_descriptor, + new java.lang.String[] { + "Links", "NextPageToken", + }); + internal_static_google_logging_v2_GetLinkRequest_descriptor = + getDescriptor().getMessageTypes().get(30); + internal_static_google_logging_v2_GetLinkRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_GetLinkRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_logging_v2_LogExclusion_descriptor = + getDescriptor().getMessageTypes().get(31); + internal_static_google_logging_v2_LogExclusion_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_LogExclusion_descriptor, + new java.lang.String[] { + "Name", "Description", "Filter", "Disabled", "CreateTime", "UpdateTime", + }); + internal_static_google_logging_v2_ListExclusionsRequest_descriptor = + getDescriptor().getMessageTypes().get(32); + internal_static_google_logging_v2_ListExclusionsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_ListExclusionsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageToken", "PageSize", + }); + internal_static_google_logging_v2_ListExclusionsResponse_descriptor = + getDescriptor().getMessageTypes().get(33); + internal_static_google_logging_v2_ListExclusionsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_ListExclusionsResponse_descriptor, + new java.lang.String[] { + "Exclusions", "NextPageToken", + }); + internal_static_google_logging_v2_GetExclusionRequest_descriptor = + getDescriptor().getMessageTypes().get(34); + internal_static_google_logging_v2_GetExclusionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_GetExclusionRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_logging_v2_CreateExclusionRequest_descriptor = + getDescriptor().getMessageTypes().get(35); + internal_static_google_logging_v2_CreateExclusionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_CreateExclusionRequest_descriptor, + new java.lang.String[] { + "Parent", "Exclusion", + }); + internal_static_google_logging_v2_UpdateExclusionRequest_descriptor = + getDescriptor().getMessageTypes().get(36); + internal_static_google_logging_v2_UpdateExclusionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_UpdateExclusionRequest_descriptor, + new java.lang.String[] { + "Name", "Exclusion", "UpdateMask", + }); + internal_static_google_logging_v2_DeleteExclusionRequest_descriptor = + getDescriptor().getMessageTypes().get(37); + internal_static_google_logging_v2_DeleteExclusionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_DeleteExclusionRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_logging_v2_GetCmekSettingsRequest_descriptor = + getDescriptor().getMessageTypes().get(38); + internal_static_google_logging_v2_GetCmekSettingsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_GetCmekSettingsRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_logging_v2_UpdateCmekSettingsRequest_descriptor = + getDescriptor().getMessageTypes().get(39); + internal_static_google_logging_v2_UpdateCmekSettingsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_UpdateCmekSettingsRequest_descriptor, + new java.lang.String[] { + "Name", "CmekSettings", "UpdateMask", + }); + internal_static_google_logging_v2_CmekSettings_descriptor = + getDescriptor().getMessageTypes().get(40); + internal_static_google_logging_v2_CmekSettings_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_CmekSettings_descriptor, + new java.lang.String[] { + "Name", "KmsKeyName", "KmsKeyVersionName", "ServiceAccountId", + }); + internal_static_google_logging_v2_GetSettingsRequest_descriptor = + getDescriptor().getMessageTypes().get(41); + internal_static_google_logging_v2_GetSettingsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_GetSettingsRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_logging_v2_UpdateSettingsRequest_descriptor = + getDescriptor().getMessageTypes().get(42); + internal_static_google_logging_v2_UpdateSettingsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_UpdateSettingsRequest_descriptor, + new java.lang.String[] { + "Name", "Settings", "UpdateMask", + }); + internal_static_google_logging_v2_Settings_descriptor = + getDescriptor().getMessageTypes().get(43); + internal_static_google_logging_v2_Settings_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_Settings_descriptor, + new java.lang.String[] { + "Name", "KmsKeyName", "KmsServiceAccountId", "StorageLocation", "DisableDefaultSink", + }); + internal_static_google_logging_v2_CopyLogEntriesRequest_descriptor = + getDescriptor().getMessageTypes().get(44); + internal_static_google_logging_v2_CopyLogEntriesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_CopyLogEntriesRequest_descriptor, + new java.lang.String[] { + "Name", "Filter", "Destination", + }); + internal_static_google_logging_v2_CopyLogEntriesMetadata_descriptor = + getDescriptor().getMessageTypes().get(45); + internal_static_google_logging_v2_CopyLogEntriesMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_CopyLogEntriesMetadata_descriptor, + new java.lang.String[] { + "StartTime", + "EndTime", + "State", + "CancellationRequested", + "Request", + "Progress", + "WriterIdentity", + }); + internal_static_google_logging_v2_CopyLogEntriesResponse_descriptor = + getDescriptor().getMessageTypes().get(46); + internal_static_google_logging_v2_CopyLogEntriesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_CopyLogEntriesResponse_descriptor, + new java.lang.String[] { + "LogEntriesCopiedCount", + }); + internal_static_google_logging_v2_BucketMetadata_descriptor = + getDescriptor().getMessageTypes().get(47); + internal_static_google_logging_v2_BucketMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_BucketMetadata_descriptor, + new java.lang.String[] { + "StartTime", + "EndTime", + "State", + "CreateBucketRequest", + "UpdateBucketRequest", + "Request", + }); + internal_static_google_logging_v2_LinkMetadata_descriptor = + getDescriptor().getMessageTypes().get(48); + internal_static_google_logging_v2_LinkMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_LinkMetadata_descriptor, + new java.lang.String[] { + "StartTime", "EndTime", "State", "CreateLinkRequest", "DeleteLinkRequest", "Request", + }); + internal_static_google_logging_v2_LocationMetadata_descriptor = + getDescriptor().getMessageTypes().get(49); + internal_static_google_logging_v2_LocationMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_LocationMetadata_descriptor, + new java.lang.String[] { + "LogAnalyticsEnabled", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.methodSignature); + registry.add(com.google.api.ClientProto.oauthScopes); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceDefinition); + registry.add(com.google.api.ResourceProto.resourceReference); + registry.add(com.google.longrunning.OperationsProto.operationInfo); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LoggingMetricsProto.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LoggingMetricsProto.java new file mode 100644 index 000000000000..3c4f72e3d627 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LoggingMetricsProto.java @@ -0,0 +1,266 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_metrics.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public final class LoggingMetricsProto { + private LoggingMetricsProto() {} + + 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_logging_v2_LogMetric_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_LogMetric_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_LogMetric_LabelExtractorsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_LogMetric_LabelExtractorsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_ListLogMetricsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_ListLogMetricsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_ListLogMetricsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_ListLogMetricsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_GetLogMetricRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_GetLogMetricRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_CreateLogMetricRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_CreateLogMetricRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_UpdateLogMetricRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_UpdateLogMetricRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_DeleteLogMetricRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_DeleteLogMetricRequest_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/logging/v2/logging_metrics.prot" + + "o\022\021google.logging.v2\032\034google/api/annotat" + + "ions.proto\032\027google/api/client.proto\032\035goo" + + "gle/api/distribution.proto\032\037google/api/f" + + "ield_behavior.proto\032\027google/api/metric.p" + + "roto\032\031google/api/resource.proto\032\033google/" + + "protobuf/empty.proto\032\037google/protobuf/timestamp.proto\"\275\005\n" + + "\tLogMetric\022\021\n" + + "\004name\030\001 \001(\tB\003\340A\002\022\030\n" + + "\013description\030\002 \001(\tB\003\340A\001\022\023\n" + + "\006filter\030\003 \001(\tB\003\340A\002\022\030\n" + + "\013bucket_name\030\r" + + " \001(\tB\003\340A\001\022\025\n" + + "\010disabled\030\014 \001(\010B\003\340A\001\022<\n" + + "\021metric_descriptor\030\005" + + " \001(\0132\034.google.api.MetricDescriptorB\003\340A\001\022\034\n" + + "\017value_extractor\030\006 \001(\tB\003\340A\001\022P\n" + + "\020label_extractors\030\007" + + " \003(\01321.google.logging.v2.LogMetric.LabelExtractorsEntryB\003\340A\001\022C\n" + + "\016bucket_options\030\010" + + " \001(\0132&.google.api.Distribution.BucketOptionsB\003\340A\001\0224\n" + + "\013create_time\030\t \001(\0132\032.google.protobuf.TimestampB\003\340A\003\0224\n" + + "\013update_time\030\n" + + " \001(\0132\032.google.protobuf.TimestampB\003\340A\003\022<\n" + + "\007version\030\004" + + " \001(\0162\'.google.logging.v2.LogMetric.ApiVersionB\002\030\001\0326\n" + + "\024LabelExtractorsEntry\022\013\n" + + "\003key\030\001 \001(\t\022\r\n" + + "\005value\030\002 \001(\t:\0028\001\"\034\n\n" + + "ApiVersion\022\006\n" + + "\002V2\020\000\022\006\n" + + "\002V1\020\001:J\352AG\n" + + " logging.googleapis.com/LogMetric\022#projects/{project}/metrics/{metric}\"\215\001\n" + + "\025ListLogMetricsRequest\022C\n" + + "\006parent\030\001 \001(\tB3\340A\002\372A-\n" + + "+cloudresourcemanager.googleapis.com/Project\022\027\n\n" + + "page_token\030\002 \001(\tB\003\340A\001\022\026\n" + + "\tpage_size\030\003 \001(\005B\003\340A\001\"`\n" + + "\026ListLogMetricsResponse\022-\n" + + "\007metrics\030\001 \003(\0132\034.google.logging.v2.LogMetric\022\027\n" + + "\017next_page_token\030\002 \001(\t\"T\n" + + "\023GetLogMetricRequest\022=\n" + + "\013metric_name\030\001 \001(\tB(\340A\002\372A\"\n" + + " logging.googleapis.com/LogMetric\"\205\001\n" + + "\026CreateLogMetricRequest\0228\n" + + "\006parent\030\001 \001(\tB(\340A\002\372A\"\022" + + " logging.googleapis.com/LogMetric\0221\n" + + "\006metric\030\002" + + " \001(\0132\034.google.logging.v2.LogMetricB\003\340A\002\"\212\001\n" + + "\026UpdateLogMetricRequest\022=\n" + + "\013metric_name\030\001 \001(\tB(\340A\002\372A\"\n" + + " logging.googleapis.com/LogMetric\0221\n" + + "\006metric\030\002 \001(\0132\034.google.logging.v2.LogMetricB\003\340A\002\"W\n" + + "\026DeleteLogMetricRequest\022=\n" + + "\013metric_name\030\001 \001(\tB(\340A\002\372A\"\n" + + " logging.googleapis.com/LogMetric2\256\010\n" + + "\020MetricsServiceV2\022\227\001\n" + + "\016ListLogMetrics\022(.google.logging.v2.ListLogM" + + "etricsRequest\032).google.logging.v2.ListLo" + + "gMetricsResponse\"0\332A\006parent\202\323\344\223\002!\022\037/v2/{parent=projects/*}/metrics\022\222\001\n" + + "\014GetLogMetric\022&.google.logging.v2.GetLogMetricRequ" + + "est\032\034.google.logging.v2.LogMetric\"<\332A\013me" + + "tric_name\202\323\344\223\002(\022&/v2/{metric_name=projects/*/metrics/*}\022\233\001\n" + + "\017CreateLogMetric\022).go" + + "ogle.logging.v2.CreateLogMetricRequest\032\034.google.logging.v2.LogMetric\"?\332A\r" + + "parent," + + "metric\202\323\344\223\002)\"\037/v2/{parent=projects/*}/metrics:\006metric\022\247\001\n" + + "\017UpdateLogMetric\022).google.logging.v2.UpdateLogMetricRequest\032\034.g" + + "oogle.logging.v2.LogMetric\"K\332A\022metric_na" + + "me,metric\202\323\344\223\0020\032&/v2/{metric_name=projects/*/metrics/*}:\006metric\022\222\001\n" + + "\017DeleteLogMetric\022).google.logging.v2.DeleteLogMetricR" + + "equest\032\026.google.protobuf.Empty\"<\332A\013metri" + + "c_name\202\323\344\223\002(*&/v2/{metric_name=projects/" + + "*/metrics/*}\032\215\002\312A\026logging.googleapis.com" + + "\322A\360\001https://www.googleapis.com/auth/clou" + + "d-platform,https://www.googleapis.com/auth/cloud-platform.read-only,https://www." + + "googleapis.com/auth/logging.admin,https://www.googleapis.com/auth/logging.read,h" + + "ttps://www.googleapis.com/auth/logging.writeB\271\001\n" + + "\025com.google.logging.v2B\023LoggingMetricsProtoP\001Z5cloud.google.com/go/loggi" + + "ng/apiv2/loggingpb;loggingpb\370\001\001\252\002\027Google" + + ".Cloud.Logging.V2\312\002\027Google\\Cloud\\Logging" + + "\\V2\352\002\032Google::Cloud::Logging::V2b\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.DistributionProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.MetricProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_logging_v2_LogMetric_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_logging_v2_LogMetric_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_LogMetric_descriptor, + new java.lang.String[] { + "Name", + "Description", + "Filter", + "BucketName", + "Disabled", + "MetricDescriptor", + "ValueExtractor", + "LabelExtractors", + "BucketOptions", + "CreateTime", + "UpdateTime", + "Version", + }); + internal_static_google_logging_v2_LogMetric_LabelExtractorsEntry_descriptor = + internal_static_google_logging_v2_LogMetric_descriptor.getNestedTypes().get(0); + internal_static_google_logging_v2_LogMetric_LabelExtractorsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_LogMetric_LabelExtractorsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_logging_v2_ListLogMetricsRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_logging_v2_ListLogMetricsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_ListLogMetricsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageToken", "PageSize", + }); + internal_static_google_logging_v2_ListLogMetricsResponse_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_logging_v2_ListLogMetricsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_ListLogMetricsResponse_descriptor, + new java.lang.String[] { + "Metrics", "NextPageToken", + }); + internal_static_google_logging_v2_GetLogMetricRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_logging_v2_GetLogMetricRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_GetLogMetricRequest_descriptor, + new java.lang.String[] { + "MetricName", + }); + internal_static_google_logging_v2_CreateLogMetricRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_logging_v2_CreateLogMetricRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_CreateLogMetricRequest_descriptor, + new java.lang.String[] { + "Parent", "Metric", + }); + internal_static_google_logging_v2_UpdateLogMetricRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_logging_v2_UpdateLogMetricRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_UpdateLogMetricRequest_descriptor, + new java.lang.String[] { + "MetricName", "Metric", + }); + internal_static_google_logging_v2_DeleteLogMetricRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_logging_v2_DeleteLogMetricRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_DeleteLogMetricRequest_descriptor, + new java.lang.String[] { + "MetricName", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.methodSignature); + registry.add(com.google.api.ClientProto.oauthScopes); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.DistributionProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.MetricProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LoggingProto.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LoggingProto.java new file mode 100644 index 000000000000..61cb2d7dbd89 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LoggingProto.java @@ -0,0 +1,369 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public final class LoggingProto { + private LoggingProto() {} + + 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_logging_v2_DeleteLogRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_DeleteLogRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_WriteLogEntriesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_WriteLogEntriesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_WriteLogEntriesRequest_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_WriteLogEntriesRequest_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_WriteLogEntriesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_WriteLogEntriesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_WriteLogEntriesPartialErrors_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_WriteLogEntriesPartialErrors_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_WriteLogEntriesPartialErrors_LogEntryErrorsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_WriteLogEntriesPartialErrors_LogEntryErrorsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_ListLogEntriesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_ListLogEntriesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_ListLogEntriesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_ListLogEntriesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_ListMonitoredResourceDescriptorsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_ListMonitoredResourceDescriptorsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_ListMonitoredResourceDescriptorsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_ListMonitoredResourceDescriptorsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_ListLogsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_ListLogsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_ListLogsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_ListLogsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_TailLogEntriesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_TailLogEntriesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_TailLogEntriesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_TailLogEntriesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_logging_v2_TailLogEntriesResponse_SuppressionInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_logging_v2_TailLogEntriesResponse_SuppressionInfo_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" + + "\037google/logging/v2/logging.proto\022\021googl" + + "e.logging.v2\032\034google/api/annotations.pro" + + "to\032\027google/api/client.proto\032\037google/api/" + + "field_behavior.proto\032#google/api/monitor" + + "ed_resource.proto\032\031google/api/resource.p" + + "roto\032!google/logging/v2/log_entry.proto\032" + + "\036google/protobuf/duration.proto\032\033google/" + + "protobuf/empty.proto\032\027google/rpc/status.proto\"H\n" + + "\020DeleteLogRequest\0224\n" + + "\010log_name\030\001 \001(\tB\"\340A\002\372A\034\n" + + "\032logging.googleapis.com/Log\"\346\002\n" + + "\026WriteLogEntriesRequest\0224\n" + + "\010log_name\030\001 \001(\tB\"\340A\001\372A\034\n" + + "\032logging.googleapis.com/Log\0224\n" + + "\010resource\030\002 \001(\0132\035.google.api.MonitoredResourceB\003\340A\001\022J\n" + + "\006labels\030\003 \003(\01325.google." + + "logging.v2.WriteLogEntriesRequest.LabelsEntryB\003\340A\001\0221\n" + + "\007entries\030\004 \003(\0132\033.google.logging.v2.LogEntryB\003\340A\002\022\034\n" + + "\017partial_success\030\005 \001(\010B\003\340A\001\022\024\n" + + "\007dry_run\030\006 \001(\010B\003\340A\001\032-\n" + + "\013LabelsEntry\022\013\n" + + "\003key\030\001 \001(\t\022\r\n" + + "\005value\030\002 \001(\t:\0028\001\"\031\n" + + "\027WriteLogEntriesResponse\"\310\001\n" + + "\034WriteLogEntriesPartialErrors\022]\n" + + "\020log_entry_errors\030\001" + + " \003(\0132C.google.logging.v2.WriteLogEntriesPartialErrors.LogEntryErrorsEntry\032I\n" + + "\023LogEntryErrorsEntry\022\013\n" + + "\003key\030\001 \001(\005\022!\n" + + "\005value\030\002 \001(\0132\022.google.rpc.Status:\0028\001\"\260\001\n" + + "\025ListLogEntriesRequest\022:\n" + + "\016resource_names\030\010 \003(" + + "\tB\"\340A\002\372A\034\022\032logging.googleapis.com/Log\022\023\n" + + "\006filter\030\002 \001(\tB\003\340A\001\022\025\n" + + "\010order_by\030\003 \001(\tB\003\340A\001\022\026\n" + + "\tpage_size\030\004 \001(\005B\003\340A\001\022\027\n\n" + + "page_token\030\005 \001(\tB\003\340A\001\"_\n" + + "\026ListLogEntriesResponse\022,\n" + + "\007entries\030\001 \003(\0132\033.google.logging.v2.LogEntry\022\027\n" + + "\017next_page_token\030\002 \001(\t\"Z\n" + + "\'ListMonitoredResourceDescriptorsRequest\022\026\n" + + "\tpage_size\030\001 \001(\005B\003\340A\001\022\027\n\n" + + "page_token\030\002 \001(\tB\003\340A\001\"\212\001\n" + + "(ListMonitoredResourceDescriptorsResponse\022E\n" + + "\024resource_descriptors\030\001" + + " \003(\0132\'.google.api.MonitoredResourceDescriptor\022\027\n" + + "\017next_page_token\030\002 \001(\t\"\262\001\n" + + "\017ListLogsRequest\0222\n" + + "\006parent\030\001 \001(" + + "\tB\"\340A\002\372A\034\022\032logging.googleapis.com/Log\022:\n" + + "\016resource_names\030\010 \003(" + + "\tB\"\340A\001\372A\034\022\032logging.googleapis.com/Log\022\026\n" + + "\tpage_size\030\002 \001(\005B\003\340A\001\022\027\n\n" + + "page_token\030\003 \001(\tB\003\340A\001\">\n" + + "\020ListLogsResponse\022\021\n" + + "\tlog_names\030\003 \003(\t\022\027\n" + + "\017next_page_token\030\002 \001(\t\"\200\001\n" + + "\025TailLogEntriesRequest\022\033\n" + + "\016resource_names\030\001 \003(\tB\003\340A\002\022\023\n" + + "\006filter\030\002 \001(\tB\003\340A\001\0225\n\r" + + "buffer_window\030\003" + + " \001(\0132\031.google.protobuf.DurationB\003\340A\001\"\337\002\n" + + "\026TailLogEntriesResponse\022,\n" + + "\007entries\030\001 \003(\0132\033.google.logging.v2.LogEntry\022S\n" + + "\020suppression_info\030\002" + + " \003(\01329.google.logging.v2.TailLogEntriesResponse.SuppressionInfo\032\301\001\n" + + "\017SuppressionInfo\022P\n" + + "\006reason\030\001 \001(\0162@.google.l" + + "ogging.v2.TailLogEntriesResponse.SuppressionInfo.Reason\022\030\n" + + "\020suppressed_count\030\002 \001(\005\"B\n" + + "\006Reason\022\026\n" + + "\022REASON_UNSPECIFIED\020\000\022\016\n\n" + + "RATE_LIMIT\020\001\022\020\n" + + "\014NOT_CONSUMED\020\0022\351\r\n" + + "\020LoggingServiceV2\022\223\002\n" + + "\tDeleteLog\022#.google.loggin" + + "g.v2.DeleteLogRequest\032\026.google.protobuf.Empty\"\310\001\332A\010log_name\202\323\344\223\002\266\001*" + + " /v2/{log_name=projects/*/logs/*}Z\033*\031/v2/{log_name=*/" + + "*/logs/*}Z\'*%/v2/{log_name=organizations/*/logs/*}Z!*\037/v2/{log_name=folders/*/lo" + + "gs/*}Z)*\'/v2/{log_name=billingAccounts/*/logs/*}\022\251\001\n" + + "\017WriteLogEntries\022).google.lo" + + "gging.v2.WriteLogEntriesRequest\032*.google.logging.v2.WriteLogEntriesResponse\"?\332A" + + " log_name,resource,labels,entries\202\323\344\223\002\026\"\021/v2/entries:write:\001*\022\243\001\n" + + "\016ListLogEntries\022(.google.logging.v2.ListLogEntriesReques" + + "t\032).google.logging.v2.ListLogEntriesResp" + + "onse\"<\332A\036resource_names,filter,order_by\202\323\344\223\002\025\"\020/v2/entries:list:\001*\022\305\001\n" + + " ListMonitoredResourceDescriptors\022:.google.logging" + + ".v2.ListMonitoredResourceDescriptorsRequ" + + "est\032;.google.logging.v2.ListMonitoredResourceDescriptorsResponse\"(\202\323\344\223\002\"\022" + + " /v2/monitoredResourceDescriptors\022\213\004\n" + + "\010ListLogs\022\".google.logging.v2.ListLogsRequest\032#.go" + + "ogle.logging.v2.ListLogsResponse\"\265\003\332A\006pa" + + "rent\202\323\344\223\002\245\003\022\025/v2/{parent=*/*}/logsZ\036\022\034/v" + + "2/{parent=projects/*}/logsZ#\022!/v2/{paren" + + "t=organizations/*}/logsZ\035\022\033/v2/{parent=f" + + "olders/*}/logsZ%\022#/v2/{parent=billingAccounts/*}/logsZ<\022:/v2/{parent=projects/*/" + + "locations/*/buckets/*/views/*}/logsZA\022?/v2/{parent=organizations/*/locations/*/b" + + "uckets/*/views/*}/logsZ;\0229/v2/{parent=folders/*/locations/*/buckets/*/views/*}/l" + + "ogsZC\022A/v2/{parent=billingAccounts/*/locations/*/buckets/*/views/*}/logs\022\206\001\n" + + "\016TailLogEntries\022(.google.logging.v2.TailLogE" + + "ntriesRequest\032).google.logging.v2.TailLo" + + "gEntriesResponse\"\033\202\323\344\223\002\025\"\020/v2/entries:ta" + + "il:\001*(\0010\001\032\215\002\312A\026logging.googleapis.com\322A\360" + + "\001https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/" + + "cloud-platform.read-only,https://www.googleapis.com/auth/logging.admin,https://w" + + "ww.googleapis.com/auth/logging.read,http" + + "s://www.googleapis.com/auth/logging.writeB\262\001\n" + + "\025com.google.logging.v2B\014LoggingProtoP\001Z5cloud.google.com/go/logging/apiv2/l" + + "oggingpb;loggingpb\370\001\001\252\002\027Google.Cloud.Log" + + "ging.V2\312\002\027Google\\Cloud\\Logging\\V2\352\002\032Goog" + + "le::Cloud::Logging::V2b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.MonitoredResourceProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.logging.v2.LogEntryProto.getDescriptor(), + com.google.protobuf.DurationProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.rpc.StatusProto.getDescriptor(), + }); + internal_static_google_logging_v2_DeleteLogRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_logging_v2_DeleteLogRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_DeleteLogRequest_descriptor, + new java.lang.String[] { + "LogName", + }); + internal_static_google_logging_v2_WriteLogEntriesRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_logging_v2_WriteLogEntriesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_WriteLogEntriesRequest_descriptor, + new java.lang.String[] { + "LogName", "Resource", "Labels", "Entries", "PartialSuccess", "DryRun", + }); + internal_static_google_logging_v2_WriteLogEntriesRequest_LabelsEntry_descriptor = + internal_static_google_logging_v2_WriteLogEntriesRequest_descriptor.getNestedTypes().get(0); + internal_static_google_logging_v2_WriteLogEntriesRequest_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_WriteLogEntriesRequest_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_logging_v2_WriteLogEntriesResponse_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_logging_v2_WriteLogEntriesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_WriteLogEntriesResponse_descriptor, + new java.lang.String[] {}); + internal_static_google_logging_v2_WriteLogEntriesPartialErrors_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_logging_v2_WriteLogEntriesPartialErrors_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_WriteLogEntriesPartialErrors_descriptor, + new java.lang.String[] { + "LogEntryErrors", + }); + internal_static_google_logging_v2_WriteLogEntriesPartialErrors_LogEntryErrorsEntry_descriptor = + internal_static_google_logging_v2_WriteLogEntriesPartialErrors_descriptor + .getNestedTypes() + .get(0); + internal_static_google_logging_v2_WriteLogEntriesPartialErrors_LogEntryErrorsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_WriteLogEntriesPartialErrors_LogEntryErrorsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_logging_v2_ListLogEntriesRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_logging_v2_ListLogEntriesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_ListLogEntriesRequest_descriptor, + new java.lang.String[] { + "ResourceNames", "Filter", "OrderBy", "PageSize", "PageToken", + }); + internal_static_google_logging_v2_ListLogEntriesResponse_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_logging_v2_ListLogEntriesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_ListLogEntriesResponse_descriptor, + new java.lang.String[] { + "Entries", "NextPageToken", + }); + internal_static_google_logging_v2_ListMonitoredResourceDescriptorsRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_logging_v2_ListMonitoredResourceDescriptorsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_ListMonitoredResourceDescriptorsRequest_descriptor, + new java.lang.String[] { + "PageSize", "PageToken", + }); + internal_static_google_logging_v2_ListMonitoredResourceDescriptorsResponse_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_logging_v2_ListMonitoredResourceDescriptorsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_ListMonitoredResourceDescriptorsResponse_descriptor, + new java.lang.String[] { + "ResourceDescriptors", "NextPageToken", + }); + internal_static_google_logging_v2_ListLogsRequest_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_logging_v2_ListLogsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_ListLogsRequest_descriptor, + new java.lang.String[] { + "Parent", "ResourceNames", "PageSize", "PageToken", + }); + internal_static_google_logging_v2_ListLogsResponse_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_logging_v2_ListLogsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_ListLogsResponse_descriptor, + new java.lang.String[] { + "LogNames", "NextPageToken", + }); + internal_static_google_logging_v2_TailLogEntriesRequest_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_logging_v2_TailLogEntriesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_TailLogEntriesRequest_descriptor, + new java.lang.String[] { + "ResourceNames", "Filter", "BufferWindow", + }); + internal_static_google_logging_v2_TailLogEntriesResponse_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_logging_v2_TailLogEntriesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_TailLogEntriesResponse_descriptor, + new java.lang.String[] { + "Entries", "SuppressionInfo", + }); + internal_static_google_logging_v2_TailLogEntriesResponse_SuppressionInfo_descriptor = + internal_static_google_logging_v2_TailLogEntriesResponse_descriptor.getNestedTypes().get(0); + internal_static_google_logging_v2_TailLogEntriesResponse_SuppressionInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_logging_v2_TailLogEntriesResponse_SuppressionInfo_descriptor, + new java.lang.String[] { + "Reason", "SuppressedCount", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.methodSignature); + registry.add(com.google.api.ClientProto.oauthScopes); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.MonitoredResourceProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.logging.v2.LogEntryProto.getDescriptor(); + com.google.protobuf.DurationProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.rpc.StatusProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/OperationState.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/OperationState.java new file mode 100644 index 000000000000..247dc095cb84 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/OperationState.java @@ -0,0 +1,275 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * List of different operation states.
+ * High level state of the operation. This is used to report the job's
+ * current state to the user. Once a long running operation is created,
+ * the current state of the operation can be queried even before the
+ * operation is finished and the final result is available.
+ * 
+ * + * Protobuf enum {@code google.logging.v2.OperationState} + */ +public enum OperationState implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Should not be used.
+   * 
+ * + * OPERATION_STATE_UNSPECIFIED = 0; + */ + OPERATION_STATE_UNSPECIFIED(0), + /** + * + * + *
+   * The operation is scheduled.
+   * 
+ * + * OPERATION_STATE_SCHEDULED = 1; + */ + OPERATION_STATE_SCHEDULED(1), + /** + * + * + *
+   * Waiting for necessary permissions.
+   * 
+ * + * OPERATION_STATE_WAITING_FOR_PERMISSIONS = 2; + */ + OPERATION_STATE_WAITING_FOR_PERMISSIONS(2), + /** + * + * + *
+   * The operation is running.
+   * 
+ * + * OPERATION_STATE_RUNNING = 3; + */ + OPERATION_STATE_RUNNING(3), + /** + * + * + *
+   * The operation was completed successfully.
+   * 
+ * + * OPERATION_STATE_SUCCEEDED = 4; + */ + OPERATION_STATE_SUCCEEDED(4), + /** + * + * + *
+   * The operation failed.
+   * 
+ * + * OPERATION_STATE_FAILED = 5; + */ + OPERATION_STATE_FAILED(5), + /** + * + * + *
+   * The operation was cancelled by the user.
+   * 
+ * + * OPERATION_STATE_CANCELLED = 6; + */ + OPERATION_STATE_CANCELLED(6), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * Should not be used.
+   * 
+ * + * OPERATION_STATE_UNSPECIFIED = 0; + */ + public static final int OPERATION_STATE_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+   * The operation is scheduled.
+   * 
+ * + * OPERATION_STATE_SCHEDULED = 1; + */ + public static final int OPERATION_STATE_SCHEDULED_VALUE = 1; + + /** + * + * + *
+   * Waiting for necessary permissions.
+   * 
+ * + * OPERATION_STATE_WAITING_FOR_PERMISSIONS = 2; + */ + public static final int OPERATION_STATE_WAITING_FOR_PERMISSIONS_VALUE = 2; + + /** + * + * + *
+   * The operation is running.
+   * 
+ * + * OPERATION_STATE_RUNNING = 3; + */ + public static final int OPERATION_STATE_RUNNING_VALUE = 3; + + /** + * + * + *
+   * The operation was completed successfully.
+   * 
+ * + * OPERATION_STATE_SUCCEEDED = 4; + */ + public static final int OPERATION_STATE_SUCCEEDED_VALUE = 4; + + /** + * + * + *
+   * The operation failed.
+   * 
+ * + * OPERATION_STATE_FAILED = 5; + */ + public static final int OPERATION_STATE_FAILED_VALUE = 5; + + /** + * + * + *
+   * The operation was cancelled by the user.
+   * 
+ * + * OPERATION_STATE_CANCELLED = 6; + */ + public static final int OPERATION_STATE_CANCELLED_VALUE = 6; + + 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 OperationState 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 OperationState forNumber(int value) { + switch (value) { + case 0: + return OPERATION_STATE_UNSPECIFIED; + case 1: + return OPERATION_STATE_SCHEDULED; + case 2: + return OPERATION_STATE_WAITING_FOR_PERMISSIONS; + case 3: + return OPERATION_STATE_RUNNING; + case 4: + return OPERATION_STATE_SUCCEEDED; + case 5: + return OPERATION_STATE_FAILED; + case 6: + return OPERATION_STATE_CANCELLED; + 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 OperationState findValueByNumber(int number) { + return OperationState.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.logging.v2.LoggingConfigProto.getDescriptor().getEnumTypes().get(0); + } + + private static final OperationState[] VALUES = values(); + + public static OperationState 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 OperationState(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.logging.v2.OperationState) +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/OrganizationLocationName.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/OrganizationLocationName.java new file mode 100644 index 000000000000..926ce4f31332 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/OrganizationLocationName.java @@ -0,0 +1,192 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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.logging.v2; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class OrganizationLocationName implements ResourceName { + private static final PathTemplate ORGANIZATION_LOCATION = + PathTemplate.createWithoutUrlEncoding("organizations/{organization}/locations/{location}"); + private volatile Map fieldValuesMap; + private final String organization; + private final String location; + + @Deprecated + protected OrganizationLocationName() { + organization = null; + location = null; + } + + private OrganizationLocationName(Builder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + location = Preconditions.checkNotNull(builder.getLocation()); + } + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static OrganizationLocationName of(String organization, String location) { + return newBuilder().setOrganization(organization).setLocation(location).build(); + } + + public static String format(String organization, String location) { + return newBuilder().setOrganization(organization).setLocation(location).build().toString(); + } + + public static OrganizationLocationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + ORGANIZATION_LOCATION.validatedMatch( + formattedString, "OrganizationLocationName.parse: formattedString not in valid format"); + return of(matchMap.get("organization"), matchMap.get("location")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (OrganizationLocationName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return ORGANIZATION_LOCATION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (organization != null) { + fieldMapBuilder.put("organization", organization); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return ORGANIZATION_LOCATION.instantiate("organization", organization, "location", location); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + OrganizationLocationName that = ((OrganizationLocationName) o); + return Objects.equals(this.organization, that.organization) + && Objects.equals(this.location, that.location); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(organization); + h *= 1000003; + h ^= Objects.hashCode(location); + return h; + } + + /** Builder for organizations/{organization}/locations/{location}. */ + public static class Builder { + private String organization; + private String location; + + protected Builder() {} + + public String getOrganization() { + return organization; + } + + public String getLocation() { + return location; + } + + public Builder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + private Builder(OrganizationLocationName organizationLocationName) { + this.organization = organizationLocationName.organization; + this.location = organizationLocationName.location; + } + + public OrganizationLocationName build() { + return new OrganizationLocationName(this); + } + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/OrganizationName.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/OrganizationName.java new file mode 100644 index 000000000000..410cabf020a8 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/OrganizationName.java @@ -0,0 +1,168 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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.logging.v2; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class OrganizationName implements ResourceName { + private static final PathTemplate ORGANIZATION = + PathTemplate.createWithoutUrlEncoding("organizations/{organization}"); + private volatile Map fieldValuesMap; + private final String organization; + + @Deprecated + protected OrganizationName() { + organization = null; + } + + private OrganizationName(Builder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + } + + public String getOrganization() { + return organization; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static OrganizationName of(String organization) { + return newBuilder().setOrganization(organization).build(); + } + + public static String format(String organization) { + return newBuilder().setOrganization(organization).build().toString(); + } + + public static OrganizationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + ORGANIZATION.validatedMatch( + formattedString, "OrganizationName.parse: formattedString not in valid format"); + return of(matchMap.get("organization")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (OrganizationName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return ORGANIZATION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (organization != null) { + fieldMapBuilder.put("organization", organization); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return ORGANIZATION.instantiate("organization", organization); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + OrganizationName that = ((OrganizationName) o); + return Objects.equals(this.organization, that.organization); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(organization); + return h; + } + + /** Builder for organizations/{organization}. */ + public static class Builder { + private String organization; + + protected Builder() {} + + public String getOrganization() { + return organization; + } + + public Builder setOrganization(String organization) { + this.organization = organization; + return this; + } + + private Builder(OrganizationName organizationName) { + this.organization = organizationName.organization; + } + + public OrganizationName build() { + return new OrganizationName(this); + } + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ProjectName.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ProjectName.java new file mode 100644 index 000000000000..4b576f153471 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ProjectName.java @@ -0,0 +1,168 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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.logging.v2; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class ProjectName implements ResourceName { + private static final PathTemplate PROJECT = + PathTemplate.createWithoutUrlEncoding("projects/{project}"); + private volatile Map fieldValuesMap; + private final String project; + + @Deprecated + protected ProjectName() { + project = null; + } + + private ProjectName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + } + + public String getProject() { + return project; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static ProjectName of(String project) { + return newBuilder().setProject(project).build(); + } + + public static String format(String project) { + return newBuilder().setProject(project).build().toString(); + } + + public static ProjectName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT.validatedMatch( + formattedString, "ProjectName.parse: formattedString not in valid format"); + return of(matchMap.get("project")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (ProjectName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT.instantiate("project", project); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + ProjectName that = ((ProjectName) o); + return Objects.equals(this.project, that.project); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + return h; + } + + /** Builder for projects/{project}. */ + public static class Builder { + private String project; + + protected Builder() {} + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + private Builder(ProjectName projectName) { + this.project = projectName.project; + } + + public ProjectName build() { + return new ProjectName(this); + } + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/Settings.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/Settings.java new file mode 100644 index 000000000000..242320e09b46 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/Settings.java @@ -0,0 +1,1579 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * Describes the settings associated with a project, folder, organization,
+ * billing account, or flexible resource.
+ * 
+ * + * Protobuf type {@code google.logging.v2.Settings} + */ +public final class Settings extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.Settings) + SettingsOrBuilder { + private static final long serialVersionUID = 0L; + + // Use Settings.newBuilder() to construct. + private Settings(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Settings() { + name_ = ""; + kmsKeyName_ = ""; + kmsServiceAccountId_ = ""; + storageLocation_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Settings(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_Settings_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_Settings_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.Settings.class, com.google.logging.v2.Settings.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Output only. The resource name of the settings.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * Output only. The resource name of the settings.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KMS_KEY_NAME_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object kmsKeyName_ = ""; + + /** + * + * + *
+   * Optional. The resource name for the configured Cloud KMS key.
+   *
+   * KMS key name format:
+   *
+   *     "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]"
+   *
+   * For example:
+   *
+   *   `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key"`
+   *
+   *
+   *
+   * To enable CMEK for the Log Router, set this field to a valid
+   * `kms_key_name` for which the associated service account has the required
+   * `roles/cloudkms.cryptoKeyEncrypterDecrypter` role assigned for the key.
+   *
+   * The Cloud KMS key used by the Log Router can be updated by changing the
+   * `kms_key_name` to a new valid key name. Encryption operations that are in
+   * progress will be completed with the key that was in use when they started.
+   * Decryption operations will be completed using the key that was used at the
+   * time of encryption unless access to that key has been revoked.
+   *
+   * To disable CMEK for the Log Router, set this field to an empty string.
+   *
+   * See [Enabling CMEK for Log
+   * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+   * for more information.
+   * 
+ * + * string kms_key_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The kmsKeyName. + */ + @java.lang.Override + public java.lang.String getKmsKeyName() { + java.lang.Object ref = kmsKeyName_; + 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(); + kmsKeyName_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The resource name for the configured Cloud KMS key.
+   *
+   * KMS key name format:
+   *
+   *     "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]"
+   *
+   * For example:
+   *
+   *   `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key"`
+   *
+   *
+   *
+   * To enable CMEK for the Log Router, set this field to a valid
+   * `kms_key_name` for which the associated service account has the required
+   * `roles/cloudkms.cryptoKeyEncrypterDecrypter` role assigned for the key.
+   *
+   * The Cloud KMS key used by the Log Router can be updated by changing the
+   * `kms_key_name` to a new valid key name. Encryption operations that are in
+   * progress will be completed with the key that was in use when they started.
+   * Decryption operations will be completed using the key that was used at the
+   * time of encryption unless access to that key has been revoked.
+   *
+   * To disable CMEK for the Log Router, set this field to an empty string.
+   *
+   * See [Enabling CMEK for Log
+   * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+   * for more information.
+   * 
+ * + * string kms_key_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for kmsKeyName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKmsKeyNameBytes() { + java.lang.Object ref = kmsKeyName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKeyName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KMS_SERVICE_ACCOUNT_ID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object kmsServiceAccountId_ = ""; + + /** + * + * + *
+   * Output only. The service account that will be used by the Log Router to
+   * access your Cloud KMS key.
+   *
+   * Before enabling CMEK for Log Router, you must first assign the role
+   * `roles/cloudkms.cryptoKeyEncrypterDecrypter` to the service account that
+   * the Log Router will use to access your Cloud KMS key. Use
+   * [GetSettings][google.logging.v2.ConfigServiceV2.GetSettings] to
+   * obtain the service account ID.
+   *
+   * See [Enabling CMEK for Log
+   * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+   * for more information.
+   * 
+ * + * string kms_service_account_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The kmsServiceAccountId. + */ + @java.lang.Override + public java.lang.String getKmsServiceAccountId() { + java.lang.Object ref = kmsServiceAccountId_; + 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(); + kmsServiceAccountId_ = s; + return s; + } + } + + /** + * + * + *
+   * Output only. The service account that will be used by the Log Router to
+   * access your Cloud KMS key.
+   *
+   * Before enabling CMEK for Log Router, you must first assign the role
+   * `roles/cloudkms.cryptoKeyEncrypterDecrypter` to the service account that
+   * the Log Router will use to access your Cloud KMS key. Use
+   * [GetSettings][google.logging.v2.ConfigServiceV2.GetSettings] to
+   * obtain the service account ID.
+   *
+   * See [Enabling CMEK for Log
+   * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+   * for more information.
+   * 
+ * + * string kms_service_account_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for kmsServiceAccountId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKmsServiceAccountIdBytes() { + java.lang.Object ref = kmsServiceAccountId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsServiceAccountId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STORAGE_LOCATION_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object storageLocation_ = ""; + + /** + * + * + *
+   * Optional. The Cloud region that will be used for _Default and _Required log
+   * buckets for newly created projects and folders. For example `europe-west1`.
+   * This setting does not affect the location of custom log buckets.
+   * 
+ * + * string storage_location = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The storageLocation. + */ + @java.lang.Override + public java.lang.String getStorageLocation() { + java.lang.Object ref = storageLocation_; + 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(); + storageLocation_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. The Cloud region that will be used for _Default and _Required log
+   * buckets for newly created projects and folders. For example `europe-west1`.
+   * This setting does not affect the location of custom log buckets.
+   * 
+ * + * string storage_location = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for storageLocation. + */ + @java.lang.Override + public com.google.protobuf.ByteString getStorageLocationBytes() { + java.lang.Object ref = storageLocation_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + storageLocation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISABLE_DEFAULT_SINK_FIELD_NUMBER = 5; + private boolean disableDefaultSink_ = false; + + /** + * + * + *
+   * Optional. If set to true, the _Default sink in newly created projects and
+   * folders will created in a disabled state. This can be used to automatically
+   * disable log ingestion if there is already an aggregated sink configured in
+   * the hierarchy. The _Default sink can be re-enabled manually if needed.
+   * 
+ * + * bool disable_default_sink = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The disableDefaultSink. + */ + @java.lang.Override + public boolean getDisableDefaultSink() { + return disableDefaultSink_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kmsKeyName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, kmsKeyName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kmsServiceAccountId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, kmsServiceAccountId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(storageLocation_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, storageLocation_); + } + if (disableDefaultSink_ != false) { + output.writeBool(5, disableDefaultSink_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kmsKeyName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, kmsKeyName_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kmsServiceAccountId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, kmsServiceAccountId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(storageLocation_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, storageLocation_); + } + if (disableDefaultSink_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, disableDefaultSink_); + } + size += getUnknownFields().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.logging.v2.Settings)) { + return super.equals(obj); + } + com.google.logging.v2.Settings other = (com.google.logging.v2.Settings) obj; + + if (!getName().equals(other.getName())) return false; + if (!getKmsKeyName().equals(other.getKmsKeyName())) return false; + if (!getKmsServiceAccountId().equals(other.getKmsServiceAccountId())) return false; + if (!getStorageLocation().equals(other.getStorageLocation())) return false; + if (getDisableDefaultSink() != other.getDisableDefaultSink()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + KMS_KEY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getKmsKeyName().hashCode(); + hash = (37 * hash) + KMS_SERVICE_ACCOUNT_ID_FIELD_NUMBER; + hash = (53 * hash) + getKmsServiceAccountId().hashCode(); + hash = (37 * hash) + STORAGE_LOCATION_FIELD_NUMBER; + hash = (53 * hash) + getStorageLocation().hashCode(); + hash = (37 * hash) + DISABLE_DEFAULT_SINK_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDisableDefaultSink()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.Settings parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.Settings parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.Settings parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.Settings 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.logging.v2.Settings parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.Settings parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.Settings parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.Settings 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.logging.v2.Settings parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.Settings 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.logging.v2.Settings parseFrom(com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.Settings 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.logging.v2.Settings 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; + } + + /** + * + * + *
+   * Describes the settings associated with a project, folder, organization,
+   * billing account, or flexible resource.
+   * 
+ * + * Protobuf type {@code google.logging.v2.Settings} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.Settings) + com.google.logging.v2.SettingsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_Settings_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_Settings_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.Settings.class, com.google.logging.v2.Settings.Builder.class); + } + + // Construct using com.google.logging.v2.Settings.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + kmsKeyName_ = ""; + kmsServiceAccountId_ = ""; + storageLocation_ = ""; + disableDefaultSink_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_Settings_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.Settings getDefaultInstanceForType() { + return com.google.logging.v2.Settings.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.Settings build() { + com.google.logging.v2.Settings result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.Settings buildPartial() { + com.google.logging.v2.Settings result = new com.google.logging.v2.Settings(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.logging.v2.Settings result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.kmsKeyName_ = kmsKeyName_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.kmsServiceAccountId_ = kmsServiceAccountId_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.storageLocation_ = storageLocation_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.disableDefaultSink_ = disableDefaultSink_; + } + } + + @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.logging.v2.Settings) { + return mergeFrom((com.google.logging.v2.Settings) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.Settings other) { + if (other == com.google.logging.v2.Settings.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getKmsKeyName().isEmpty()) { + kmsKeyName_ = other.kmsKeyName_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getKmsServiceAccountId().isEmpty()) { + kmsServiceAccountId_ = other.kmsServiceAccountId_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getStorageLocation().isEmpty()) { + storageLocation_ = other.storageLocation_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.getDisableDefaultSink() != false) { + setDisableDefaultSink(other.getDisableDefaultSink()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + kmsKeyName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + kmsServiceAccountId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + storageLocation_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 40: + { + disableDefaultSink_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 40 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Output only. The resource name of the settings.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Output only. The resource name of the settings.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Output only. The resource name of the settings.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The resource name of the settings.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The resource name of the settings.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object kmsKeyName_ = ""; + + /** + * + * + *
+     * Optional. The resource name for the configured Cloud KMS key.
+     *
+     * KMS key name format:
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key"`
+     *
+     *
+     *
+     * To enable CMEK for the Log Router, set this field to a valid
+     * `kms_key_name` for which the associated service account has the required
+     * `roles/cloudkms.cryptoKeyEncrypterDecrypter` role assigned for the key.
+     *
+     * The Cloud KMS key used by the Log Router can be updated by changing the
+     * `kms_key_name` to a new valid key name. Encryption operations that are in
+     * progress will be completed with the key that was in use when they started.
+     * Decryption operations will be completed using the key that was used at the
+     * time of encryption unless access to that key has been revoked.
+     *
+     * To disable CMEK for the Log Router, set this field to an empty string.
+     *
+     * See [Enabling CMEK for Log
+     * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+     * for more information.
+     * 
+ * + * string kms_key_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The kmsKeyName. + */ + public java.lang.String getKmsKeyName() { + java.lang.Object ref = kmsKeyName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kmsKeyName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The resource name for the configured Cloud KMS key.
+     *
+     * KMS key name format:
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key"`
+     *
+     *
+     *
+     * To enable CMEK for the Log Router, set this field to a valid
+     * `kms_key_name` for which the associated service account has the required
+     * `roles/cloudkms.cryptoKeyEncrypterDecrypter` role assigned for the key.
+     *
+     * The Cloud KMS key used by the Log Router can be updated by changing the
+     * `kms_key_name` to a new valid key name. Encryption operations that are in
+     * progress will be completed with the key that was in use when they started.
+     * Decryption operations will be completed using the key that was used at the
+     * time of encryption unless access to that key has been revoked.
+     *
+     * To disable CMEK for the Log Router, set this field to an empty string.
+     *
+     * See [Enabling CMEK for Log
+     * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+     * for more information.
+     * 
+ * + * string kms_key_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for kmsKeyName. + */ + public com.google.protobuf.ByteString getKmsKeyNameBytes() { + java.lang.Object ref = kmsKeyName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKeyName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The resource name for the configured Cloud KMS key.
+     *
+     * KMS key name format:
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key"`
+     *
+     *
+     *
+     * To enable CMEK for the Log Router, set this field to a valid
+     * `kms_key_name` for which the associated service account has the required
+     * `roles/cloudkms.cryptoKeyEncrypterDecrypter` role assigned for the key.
+     *
+     * The Cloud KMS key used by the Log Router can be updated by changing the
+     * `kms_key_name` to a new valid key name. Encryption operations that are in
+     * progress will be completed with the key that was in use when they started.
+     * Decryption operations will be completed using the key that was used at the
+     * time of encryption unless access to that key has been revoked.
+     *
+     * To disable CMEK for the Log Router, set this field to an empty string.
+     *
+     * See [Enabling CMEK for Log
+     * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+     * for more information.
+     * 
+ * + * string kms_key_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The kmsKeyName to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kmsKeyName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The resource name for the configured Cloud KMS key.
+     *
+     * KMS key name format:
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key"`
+     *
+     *
+     *
+     * To enable CMEK for the Log Router, set this field to a valid
+     * `kms_key_name` for which the associated service account has the required
+     * `roles/cloudkms.cryptoKeyEncrypterDecrypter` role assigned for the key.
+     *
+     * The Cloud KMS key used by the Log Router can be updated by changing the
+     * `kms_key_name` to a new valid key name. Encryption operations that are in
+     * progress will be completed with the key that was in use when they started.
+     * Decryption operations will be completed using the key that was used at the
+     * time of encryption unless access to that key has been revoked.
+     *
+     * To disable CMEK for the Log Router, set this field to an empty string.
+     *
+     * See [Enabling CMEK for Log
+     * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+     * for more information.
+     * 
+ * + * string kms_key_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearKmsKeyName() { + kmsKeyName_ = getDefaultInstance().getKmsKeyName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The resource name for the configured Cloud KMS key.
+     *
+     * KMS key name format:
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key"`
+     *
+     *
+     *
+     * To enable CMEK for the Log Router, set this field to a valid
+     * `kms_key_name` for which the associated service account has the required
+     * `roles/cloudkms.cryptoKeyEncrypterDecrypter` role assigned for the key.
+     *
+     * The Cloud KMS key used by the Log Router can be updated by changing the
+     * `kms_key_name` to a new valid key name. Encryption operations that are in
+     * progress will be completed with the key that was in use when they started.
+     * Decryption operations will be completed using the key that was used at the
+     * time of encryption unless access to that key has been revoked.
+     *
+     * To disable CMEK for the Log Router, set this field to an empty string.
+     *
+     * See [Enabling CMEK for Log
+     * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+     * for more information.
+     * 
+ * + * string kms_key_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for kmsKeyName to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kmsKeyName_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object kmsServiceAccountId_ = ""; + + /** + * + * + *
+     * Output only. The service account that will be used by the Log Router to
+     * access your Cloud KMS key.
+     *
+     * Before enabling CMEK for Log Router, you must first assign the role
+     * `roles/cloudkms.cryptoKeyEncrypterDecrypter` to the service account that
+     * the Log Router will use to access your Cloud KMS key. Use
+     * [GetSettings][google.logging.v2.ConfigServiceV2.GetSettings] to
+     * obtain the service account ID.
+     *
+     * See [Enabling CMEK for Log
+     * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+     * for more information.
+     * 
+ * + * string kms_service_account_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The kmsServiceAccountId. + */ + public java.lang.String getKmsServiceAccountId() { + java.lang.Object ref = kmsServiceAccountId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kmsServiceAccountId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Output only. The service account that will be used by the Log Router to
+     * access your Cloud KMS key.
+     *
+     * Before enabling CMEK for Log Router, you must first assign the role
+     * `roles/cloudkms.cryptoKeyEncrypterDecrypter` to the service account that
+     * the Log Router will use to access your Cloud KMS key. Use
+     * [GetSettings][google.logging.v2.ConfigServiceV2.GetSettings] to
+     * obtain the service account ID.
+     *
+     * See [Enabling CMEK for Log
+     * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+     * for more information.
+     * 
+ * + * string kms_service_account_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for kmsServiceAccountId. + */ + public com.google.protobuf.ByteString getKmsServiceAccountIdBytes() { + java.lang.Object ref = kmsServiceAccountId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsServiceAccountId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Output only. The service account that will be used by the Log Router to
+     * access your Cloud KMS key.
+     *
+     * Before enabling CMEK for Log Router, you must first assign the role
+     * `roles/cloudkms.cryptoKeyEncrypterDecrypter` to the service account that
+     * the Log Router will use to access your Cloud KMS key. Use
+     * [GetSettings][google.logging.v2.ConfigServiceV2.GetSettings] to
+     * obtain the service account ID.
+     *
+     * See [Enabling CMEK for Log
+     * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+     * for more information.
+     * 
+ * + * string kms_service_account_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The kmsServiceAccountId to set. + * @return This builder for chaining. + */ + public Builder setKmsServiceAccountId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + kmsServiceAccountId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The service account that will be used by the Log Router to
+     * access your Cloud KMS key.
+     *
+     * Before enabling CMEK for Log Router, you must first assign the role
+     * `roles/cloudkms.cryptoKeyEncrypterDecrypter` to the service account that
+     * the Log Router will use to access your Cloud KMS key. Use
+     * [GetSettings][google.logging.v2.ConfigServiceV2.GetSettings] to
+     * obtain the service account ID.
+     *
+     * See [Enabling CMEK for Log
+     * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+     * for more information.
+     * 
+ * + * string kms_service_account_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearKmsServiceAccountId() { + kmsServiceAccountId_ = getDefaultInstance().getKmsServiceAccountId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + + /** + * + * + *
+     * Output only. The service account that will be used by the Log Router to
+     * access your Cloud KMS key.
+     *
+     * Before enabling CMEK for Log Router, you must first assign the role
+     * `roles/cloudkms.cryptoKeyEncrypterDecrypter` to the service account that
+     * the Log Router will use to access your Cloud KMS key. Use
+     * [GetSettings][google.logging.v2.ConfigServiceV2.GetSettings] to
+     * obtain the service account ID.
+     *
+     * See [Enabling CMEK for Log
+     * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+     * for more information.
+     * 
+ * + * string kms_service_account_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for kmsServiceAccountId to set. + * @return This builder for chaining. + */ + public Builder setKmsServiceAccountIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + kmsServiceAccountId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object storageLocation_ = ""; + + /** + * + * + *
+     * Optional. The Cloud region that will be used for _Default and _Required log
+     * buckets for newly created projects and folders. For example `europe-west1`.
+     * This setting does not affect the location of custom log buckets.
+     * 
+ * + * string storage_location = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The storageLocation. + */ + public java.lang.String getStorageLocation() { + java.lang.Object ref = storageLocation_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + storageLocation_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. The Cloud region that will be used for _Default and _Required log
+     * buckets for newly created projects and folders. For example `europe-west1`.
+     * This setting does not affect the location of custom log buckets.
+     * 
+ * + * string storage_location = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for storageLocation. + */ + public com.google.protobuf.ByteString getStorageLocationBytes() { + java.lang.Object ref = storageLocation_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + storageLocation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. The Cloud region that will be used for _Default and _Required log
+     * buckets for newly created projects and folders. For example `europe-west1`.
+     * This setting does not affect the location of custom log buckets.
+     * 
+ * + * string storage_location = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The storageLocation to set. + * @return This builder for chaining. + */ + public Builder setStorageLocation(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + storageLocation_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The Cloud region that will be used for _Default and _Required log
+     * buckets for newly created projects and folders. For example `europe-west1`.
+     * This setting does not affect the location of custom log buckets.
+     * 
+ * + * string storage_location = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearStorageLocation() { + storageLocation_ = getDefaultInstance().getStorageLocation(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The Cloud region that will be used for _Default and _Required log
+     * buckets for newly created projects and folders. For example `europe-west1`.
+     * This setting does not affect the location of custom log buckets.
+     * 
+ * + * string storage_location = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for storageLocation to set. + * @return This builder for chaining. + */ + public Builder setStorageLocationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + storageLocation_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private boolean disableDefaultSink_; + + /** + * + * + *
+     * Optional. If set to true, the _Default sink in newly created projects and
+     * folders will created in a disabled state. This can be used to automatically
+     * disable log ingestion if there is already an aggregated sink configured in
+     * the hierarchy. The _Default sink can be re-enabled manually if needed.
+     * 
+ * + * bool disable_default_sink = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The disableDefaultSink. + */ + @java.lang.Override + public boolean getDisableDefaultSink() { + return disableDefaultSink_; + } + + /** + * + * + *
+     * Optional. If set to true, the _Default sink in newly created projects and
+     * folders will created in a disabled state. This can be used to automatically
+     * disable log ingestion if there is already an aggregated sink configured in
+     * the hierarchy. The _Default sink can be re-enabled manually if needed.
+     * 
+ * + * bool disable_default_sink = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The disableDefaultSink to set. + * @return This builder for chaining. + */ + public Builder setDisableDefaultSink(boolean value) { + + disableDefaultSink_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. If set to true, the _Default sink in newly created projects and
+     * folders will created in a disabled state. This can be used to automatically
+     * disable log ingestion if there is already an aggregated sink configured in
+     * the hierarchy. The _Default sink can be re-enabled manually if needed.
+     * 
+ * + * bool disable_default_sink = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDisableDefaultSink() { + bitField0_ = (bitField0_ & ~0x00000010); + disableDefaultSink_ = 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.logging.v2.Settings) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.Settings) + private static final com.google.logging.v2.Settings DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.Settings(); + } + + public static com.google.logging.v2.Settings getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Settings parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.Settings getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/SettingsName.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/SettingsName.java new file mode 100644 index 000000000000..ef6e1807b2ff --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/SettingsName.java @@ -0,0 +1,368 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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.logging.v2; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.pathtemplate.ValidationException; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class SettingsName implements ResourceName { + private static final PathTemplate PROJECT = + PathTemplate.createWithoutUrlEncoding("projects/{project}/settings"); + private static final PathTemplate ORGANIZATION = + PathTemplate.createWithoutUrlEncoding("organizations/{organization}/settings"); + private static final PathTemplate FOLDER = + PathTemplate.createWithoutUrlEncoding("folders/{folder}/settings"); + private static final PathTemplate BILLING_ACCOUNT = + PathTemplate.createWithoutUrlEncoding("billingAccounts/{billing_account}/settings"); + private volatile Map fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; + private final String project; + private final String organization; + private final String folder; + private final String billingAccount; + + @Deprecated + protected SettingsName() { + project = null; + organization = null; + folder = null; + billingAccount = null; + } + + private SettingsName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + organization = null; + folder = null; + billingAccount = null; + pathTemplate = PROJECT; + } + + private SettingsName(OrganizationBuilder builder) { + organization = Preconditions.checkNotNull(builder.getOrganization()); + project = null; + folder = null; + billingAccount = null; + pathTemplate = ORGANIZATION; + } + + private SettingsName(FolderBuilder builder) { + folder = Preconditions.checkNotNull(builder.getFolder()); + project = null; + organization = null; + billingAccount = null; + pathTemplate = FOLDER; + } + + private SettingsName(BillingAccountBuilder builder) { + billingAccount = Preconditions.checkNotNull(builder.getBillingAccount()); + project = null; + organization = null; + folder = null; + pathTemplate = BILLING_ACCOUNT; + } + + public String getProject() { + return project; + } + + public String getOrganization() { + return organization; + } + + public String getFolder() { + return folder; + } + + public String getBillingAccount() { + return billingAccount; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public static Builder newProjectBuilder() { + return new Builder(); + } + + public static OrganizationBuilder newOrganizationBuilder() { + return new OrganizationBuilder(); + } + + public static FolderBuilder newFolderBuilder() { + return new FolderBuilder(); + } + + public static BillingAccountBuilder newBillingAccountBuilder() { + return new BillingAccountBuilder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static SettingsName of(String project) { + return newBuilder().setProject(project).build(); + } + + public static SettingsName ofProjectName(String project) { + return newBuilder().setProject(project).build(); + } + + public static SettingsName ofOrganizationName(String organization) { + return newOrganizationBuilder().setOrganization(organization).build(); + } + + public static SettingsName ofFolderName(String folder) { + return newFolderBuilder().setFolder(folder).build(); + } + + public static SettingsName ofBillingAccountName(String billingAccount) { + return newBillingAccountBuilder().setBillingAccount(billingAccount).build(); + } + + public static String format(String project) { + return newBuilder().setProject(project).build().toString(); + } + + public static String formatProjectName(String project) { + return newBuilder().setProject(project).build().toString(); + } + + public static String formatOrganizationName(String organization) { + return newOrganizationBuilder().setOrganization(organization).build().toString(); + } + + public static String formatFolderName(String folder) { + return newFolderBuilder().setFolder(folder).build().toString(); + } + + public static String formatBillingAccountName(String billingAccount) { + return newBillingAccountBuilder().setBillingAccount(billingAccount).build().toString(); + } + + public static SettingsName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + if (PROJECT.matches(formattedString)) { + Map matchMap = PROJECT.match(formattedString); + return ofProjectName(matchMap.get("project")); + } else if (ORGANIZATION.matches(formattedString)) { + Map matchMap = ORGANIZATION.match(formattedString); + return ofOrganizationName(matchMap.get("organization")); + } else if (FOLDER.matches(formattedString)) { + Map matchMap = FOLDER.match(formattedString); + return ofFolderName(matchMap.get("folder")); + } else if (BILLING_ACCOUNT.matches(formattedString)) { + Map matchMap = BILLING_ACCOUNT.match(formattedString); + return ofBillingAccountName(matchMap.get("billing_account")); + } + throw new ValidationException("SettingsName.parse: formattedString not in valid format"); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (SettingsName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT.matches(formattedString) + || ORGANIZATION.matches(formattedString) + || FOLDER.matches(formattedString) + || BILLING_ACCOUNT.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (organization != null) { + fieldMapBuilder.put("organization", organization); + } + if (folder != null) { + fieldMapBuilder.put("folder", folder); + } + if (billingAccount != null) { + fieldMapBuilder.put("billing_account", billingAccount); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + SettingsName that = ((SettingsName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.organization, that.organization) + && Objects.equals(this.folder, that.folder) + && Objects.equals(this.billingAccount, that.billingAccount); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(fixedValue); + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(organization); + h *= 1000003; + h ^= Objects.hashCode(folder); + h *= 1000003; + h ^= Objects.hashCode(billingAccount); + return h; + } + + /** Builder for projects/{project}/settings. */ + public static class Builder { + private String project; + + protected Builder() {} + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + private Builder(SettingsName settingsName) { + Preconditions.checkArgument( + Objects.equals(settingsName.pathTemplate, PROJECT), + "toBuilder is only supported when SettingsName has the pattern of" + + " projects/{project}/settings"); + this.project = settingsName.project; + } + + public SettingsName build() { + return new SettingsName(this); + } + } + + /** Builder for organizations/{organization}/settings. */ + public static class OrganizationBuilder { + private String organization; + + protected OrganizationBuilder() {} + + public String getOrganization() { + return organization; + } + + public OrganizationBuilder setOrganization(String organization) { + this.organization = organization; + return this; + } + + public SettingsName build() { + return new SettingsName(this); + } + } + + /** Builder for folders/{folder}/settings. */ + public static class FolderBuilder { + private String folder; + + protected FolderBuilder() {} + + public String getFolder() { + return folder; + } + + public FolderBuilder setFolder(String folder) { + this.folder = folder; + return this; + } + + public SettingsName build() { + return new SettingsName(this); + } + } + + /** Builder for billingAccounts/{billing_account}/settings. */ + public static class BillingAccountBuilder { + private String billingAccount; + + protected BillingAccountBuilder() {} + + public String getBillingAccount() { + return billingAccount; + } + + public BillingAccountBuilder setBillingAccount(String billingAccount) { + this.billingAccount = billingAccount; + return this; + } + + public SettingsName build() { + return new SettingsName(this); + } + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/SettingsOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/SettingsOrBuilder.java new file mode 100644 index 000000000000..2cc3f3bacbd5 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/SettingsOrBuilder.java @@ -0,0 +1,224 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface SettingsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.Settings) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The resource name of the settings.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Output only. The resource name of the settings.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. The resource name for the configured Cloud KMS key.
+   *
+   * KMS key name format:
+   *
+   *     "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]"
+   *
+   * For example:
+   *
+   *   `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key"`
+   *
+   *
+   *
+   * To enable CMEK for the Log Router, set this field to a valid
+   * `kms_key_name` for which the associated service account has the required
+   * `roles/cloudkms.cryptoKeyEncrypterDecrypter` role assigned for the key.
+   *
+   * The Cloud KMS key used by the Log Router can be updated by changing the
+   * `kms_key_name` to a new valid key name. Encryption operations that are in
+   * progress will be completed with the key that was in use when they started.
+   * Decryption operations will be completed using the key that was used at the
+   * time of encryption unless access to that key has been revoked.
+   *
+   * To disable CMEK for the Log Router, set this field to an empty string.
+   *
+   * See [Enabling CMEK for Log
+   * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+   * for more information.
+   * 
+ * + * string kms_key_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The kmsKeyName. + */ + java.lang.String getKmsKeyName(); + + /** + * + * + *
+   * Optional. The resource name for the configured Cloud KMS key.
+   *
+   * KMS key name format:
+   *
+   *     "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]"
+   *
+   * For example:
+   *
+   *   `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key"`
+   *
+   *
+   *
+   * To enable CMEK for the Log Router, set this field to a valid
+   * `kms_key_name` for which the associated service account has the required
+   * `roles/cloudkms.cryptoKeyEncrypterDecrypter` role assigned for the key.
+   *
+   * The Cloud KMS key used by the Log Router can be updated by changing the
+   * `kms_key_name` to a new valid key name. Encryption operations that are in
+   * progress will be completed with the key that was in use when they started.
+   * Decryption operations will be completed using the key that was used at the
+   * time of encryption unless access to that key has been revoked.
+   *
+   * To disable CMEK for the Log Router, set this field to an empty string.
+   *
+   * See [Enabling CMEK for Log
+   * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+   * for more information.
+   * 
+ * + * string kms_key_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for kmsKeyName. + */ + com.google.protobuf.ByteString getKmsKeyNameBytes(); + + /** + * + * + *
+   * Output only. The service account that will be used by the Log Router to
+   * access your Cloud KMS key.
+   *
+   * Before enabling CMEK for Log Router, you must first assign the role
+   * `roles/cloudkms.cryptoKeyEncrypterDecrypter` to the service account that
+   * the Log Router will use to access your Cloud KMS key. Use
+   * [GetSettings][google.logging.v2.ConfigServiceV2.GetSettings] to
+   * obtain the service account ID.
+   *
+   * See [Enabling CMEK for Log
+   * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+   * for more information.
+   * 
+ * + * string kms_service_account_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The kmsServiceAccountId. + */ + java.lang.String getKmsServiceAccountId(); + + /** + * + * + *
+   * Output only. The service account that will be used by the Log Router to
+   * access your Cloud KMS key.
+   *
+   * Before enabling CMEK for Log Router, you must first assign the role
+   * `roles/cloudkms.cryptoKeyEncrypterDecrypter` to the service account that
+   * the Log Router will use to access your Cloud KMS key. Use
+   * [GetSettings][google.logging.v2.ConfigServiceV2.GetSettings] to
+   * obtain the service account ID.
+   *
+   * See [Enabling CMEK for Log
+   * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+   * for more information.
+   * 
+ * + * string kms_service_account_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for kmsServiceAccountId. + */ + com.google.protobuf.ByteString getKmsServiceAccountIdBytes(); + + /** + * + * + *
+   * Optional. The Cloud region that will be used for _Default and _Required log
+   * buckets for newly created projects and folders. For example `europe-west1`.
+   * This setting does not affect the location of custom log buckets.
+   * 
+ * + * string storage_location = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The storageLocation. + */ + java.lang.String getStorageLocation(); + + /** + * + * + *
+   * Optional. The Cloud region that will be used for _Default and _Required log
+   * buckets for newly created projects and folders. For example `europe-west1`.
+   * This setting does not affect the location of custom log buckets.
+   * 
+ * + * string storage_location = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for storageLocation. + */ + com.google.protobuf.ByteString getStorageLocationBytes(); + + /** + * + * + *
+   * Optional. If set to true, the _Default sink in newly created projects and
+   * folders will created in a disabled state. This can be used to automatically
+   * disable log ingestion if there is already an aggregated sink configured in
+   * the hierarchy. The _Default sink can be re-enabled manually if needed.
+   * 
+ * + * bool disable_default_sink = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The disableDefaultSink. + */ + boolean getDisableDefaultSink(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/TailLogEntriesRequest.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/TailLogEntriesRequest.java new file mode 100644 index 000000000000..c772b8f6968c --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/TailLogEntriesRequest.java @@ -0,0 +1,1447 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * The parameters to `TailLogEntries`.
+ * 
+ * + * Protobuf type {@code google.logging.v2.TailLogEntriesRequest} + */ +public final class TailLogEntriesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.TailLogEntriesRequest) + TailLogEntriesRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use TailLogEntriesRequest.newBuilder() to construct. + private TailLogEntriesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TailLogEntriesRequest() { + resourceNames_ = com.google.protobuf.LazyStringArrayList.emptyList(); + filter_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new TailLogEntriesRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_TailLogEntriesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_TailLogEntriesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.TailLogEntriesRequest.class, + com.google.logging.v2.TailLogEntriesRequest.Builder.class); + } + + private int bitField0_; + public static final int RESOURCE_NAMES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList resourceNames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + /** + * + * + *
+   * Required. Name of a parent resource from which to retrieve log entries:
+   *
+   * *  `projects/[PROJECT_ID]`
+   * *  `organizations/[ORGANIZATION_ID]`
+   * *  `billingAccounts/[BILLING_ACCOUNT_ID]`
+   * *  `folders/[FOLDER_ID]`
+   *
+   * May alternatively be one or more views:
+   *
+   *  * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   * 
+ * + * repeated string resource_names = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the resourceNames. + */ + public com.google.protobuf.ProtocolStringList getResourceNamesList() { + return resourceNames_; + } + + /** + * + * + *
+   * Required. Name of a parent resource from which to retrieve log entries:
+   *
+   * *  `projects/[PROJECT_ID]`
+   * *  `organizations/[ORGANIZATION_ID]`
+   * *  `billingAccounts/[BILLING_ACCOUNT_ID]`
+   * *  `folders/[FOLDER_ID]`
+   *
+   * May alternatively be one or more views:
+   *
+   *  * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   * 
+ * + * repeated string resource_names = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of resourceNames. + */ + public int getResourceNamesCount() { + return resourceNames_.size(); + } + + /** + * + * + *
+   * Required. Name of a parent resource from which to retrieve log entries:
+   *
+   * *  `projects/[PROJECT_ID]`
+   * *  `organizations/[ORGANIZATION_ID]`
+   * *  `billingAccounts/[BILLING_ACCOUNT_ID]`
+   * *  `folders/[FOLDER_ID]`
+   *
+   * May alternatively be one or more views:
+   *
+   *  * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   * 
+ * + * repeated string resource_names = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The resourceNames at the given index. + */ + public java.lang.String getResourceNames(int index) { + return resourceNames_.get(index); + } + + /** + * + * + *
+   * Required. Name of a parent resource from which to retrieve log entries:
+   *
+   * *  `projects/[PROJECT_ID]`
+   * *  `organizations/[ORGANIZATION_ID]`
+   * *  `billingAccounts/[BILLING_ACCOUNT_ID]`
+   * *  `folders/[FOLDER_ID]`
+   *
+   * May alternatively be one or more views:
+   *
+   *  * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   * 
+ * + * repeated string resource_names = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the resourceNames at the given index. + */ + public com.google.protobuf.ByteString getResourceNamesBytes(int index) { + return resourceNames_.getByteString(index); + } + + public static final int FILTER_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + + /** + * + * + *
+   * Optional. Only log entries that match the filter are returned.  An empty
+   * filter matches all log entries in the resources listed in `resource_names`.
+   * Referencing a parent resource that is not listed in `resource_names` will
+   * cause the filter to return no results. The maximum length of a filter is
+   * 20,000 characters.
+   * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. Only log entries that match the filter are returned.  An empty
+   * filter matches all log entries in the resources listed in `resource_names`.
+   * Referencing a parent resource that is not listed in `resource_names` will
+   * cause the filter to return no results. The maximum length of a filter is
+   * 20,000 characters.
+   * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BUFFER_WINDOW_FIELD_NUMBER = 3; + private com.google.protobuf.Duration bufferWindow_; + + /** + * + * + *
+   * Optional. The amount of time to buffer log entries at the server before
+   * being returned to prevent out of order results due to late arriving log
+   * entries. Valid values are between 0-60000 milliseconds. Defaults to 2000
+   * milliseconds.
+   * 
+ * + * .google.protobuf.Duration buffer_window = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the bufferWindow field is set. + */ + @java.lang.Override + public boolean hasBufferWindow() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Optional. The amount of time to buffer log entries at the server before
+   * being returned to prevent out of order results due to late arriving log
+   * entries. Valid values are between 0-60000 milliseconds. Defaults to 2000
+   * milliseconds.
+   * 
+ * + * .google.protobuf.Duration buffer_window = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The bufferWindow. + */ + @java.lang.Override + public com.google.protobuf.Duration getBufferWindow() { + return bufferWindow_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : bufferWindow_; + } + + /** + * + * + *
+   * Optional. The amount of time to buffer log entries at the server before
+   * being returned to prevent out of order results due to late arriving log
+   * entries. Valid values are between 0-60000 milliseconds. Defaults to 2000
+   * milliseconds.
+   * 
+ * + * .google.protobuf.Duration buffer_window = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getBufferWindowOrBuilder() { + return bufferWindow_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : bufferWindow_; + } + + 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 < resourceNames_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, resourceNames_.getRaw(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, filter_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getBufferWindow()); + } + getUnknownFields().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 < resourceNames_.size(); i++) { + dataSize += computeStringSizeNoTag(resourceNames_.getRaw(i)); + } + size += dataSize; + size += 1 * getResourceNamesList().size(); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, filter_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getBufferWindow()); + } + size += getUnknownFields().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.logging.v2.TailLogEntriesRequest)) { + return super.equals(obj); + } + com.google.logging.v2.TailLogEntriesRequest other = + (com.google.logging.v2.TailLogEntriesRequest) obj; + + if (!getResourceNamesList().equals(other.getResourceNamesList())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (hasBufferWindow() != other.hasBufferWindow()) return false; + if (hasBufferWindow()) { + if (!getBufferWindow().equals(other.getBufferWindow())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getResourceNamesCount() > 0) { + hash = (37 * hash) + RESOURCE_NAMES_FIELD_NUMBER; + hash = (53 * hash) + getResourceNamesList().hashCode(); + } + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + if (hasBufferWindow()) { + hash = (37 * hash) + BUFFER_WINDOW_FIELD_NUMBER; + hash = (53 * hash) + getBufferWindow().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.TailLogEntriesRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.TailLogEntriesRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.TailLogEntriesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.TailLogEntriesRequest 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.logging.v2.TailLogEntriesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.TailLogEntriesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.TailLogEntriesRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.TailLogEntriesRequest 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.logging.v2.TailLogEntriesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.TailLogEntriesRequest 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.logging.v2.TailLogEntriesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.TailLogEntriesRequest 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.logging.v2.TailLogEntriesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The parameters to `TailLogEntries`.
+   * 
+ * + * Protobuf type {@code google.logging.v2.TailLogEntriesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.TailLogEntriesRequest) + com.google.logging.v2.TailLogEntriesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_TailLogEntriesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_TailLogEntriesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.TailLogEntriesRequest.class, + com.google.logging.v2.TailLogEntriesRequest.Builder.class); + } + + // Construct using com.google.logging.v2.TailLogEntriesRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getBufferWindowFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + resourceNames_ = com.google.protobuf.LazyStringArrayList.emptyList(); + filter_ = ""; + bufferWindow_ = null; + if (bufferWindowBuilder_ != null) { + bufferWindowBuilder_.dispose(); + bufferWindowBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_TailLogEntriesRequest_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.TailLogEntriesRequest getDefaultInstanceForType() { + return com.google.logging.v2.TailLogEntriesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.TailLogEntriesRequest build() { + com.google.logging.v2.TailLogEntriesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.TailLogEntriesRequest buildPartial() { + com.google.logging.v2.TailLogEntriesRequest result = + new com.google.logging.v2.TailLogEntriesRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.logging.v2.TailLogEntriesRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + resourceNames_.makeImmutable(); + result.resourceNames_ = resourceNames_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.filter_ = filter_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.bufferWindow_ = + bufferWindowBuilder_ == null ? bufferWindow_ : bufferWindowBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @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.logging.v2.TailLogEntriesRequest) { + return mergeFrom((com.google.logging.v2.TailLogEntriesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.TailLogEntriesRequest other) { + if (other == com.google.logging.v2.TailLogEntriesRequest.getDefaultInstance()) return this; + if (!other.resourceNames_.isEmpty()) { + if (resourceNames_.isEmpty()) { + resourceNames_ = other.resourceNames_; + bitField0_ |= 0x00000001; + } else { + ensureResourceNamesIsMutable(); + resourceNames_.addAll(other.resourceNames_); + } + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasBufferWindow()) { + mergeBufferWindow(other.getBufferWindow()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + 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(); + ensureResourceNamesIsMutable(); + resourceNames_.add(s); + break; + } // case 10 + case 18: + { + filter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getBufferWindowFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringArrayList resourceNames_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureResourceNamesIsMutable() { + if (!resourceNames_.isModifiable()) { + resourceNames_ = new com.google.protobuf.LazyStringArrayList(resourceNames_); + } + bitField0_ |= 0x00000001; + } + + /** + * + * + *
+     * Required. Name of a parent resource from which to retrieve log entries:
+     *
+     * *  `projects/[PROJECT_ID]`
+     * *  `organizations/[ORGANIZATION_ID]`
+     * *  `billingAccounts/[BILLING_ACCOUNT_ID]`
+     * *  `folders/[FOLDER_ID]`
+     *
+     * May alternatively be one or more views:
+     *
+     *  * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     * 
+ * + * repeated string resource_names = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the resourceNames. + */ + public com.google.protobuf.ProtocolStringList getResourceNamesList() { + resourceNames_.makeImmutable(); + return resourceNames_; + } + + /** + * + * + *
+     * Required. Name of a parent resource from which to retrieve log entries:
+     *
+     * *  `projects/[PROJECT_ID]`
+     * *  `organizations/[ORGANIZATION_ID]`
+     * *  `billingAccounts/[BILLING_ACCOUNT_ID]`
+     * *  `folders/[FOLDER_ID]`
+     *
+     * May alternatively be one or more views:
+     *
+     *  * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     * 
+ * + * repeated string resource_names = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of resourceNames. + */ + public int getResourceNamesCount() { + return resourceNames_.size(); + } + + /** + * + * + *
+     * Required. Name of a parent resource from which to retrieve log entries:
+     *
+     * *  `projects/[PROJECT_ID]`
+     * *  `organizations/[ORGANIZATION_ID]`
+     * *  `billingAccounts/[BILLING_ACCOUNT_ID]`
+     * *  `folders/[FOLDER_ID]`
+     *
+     * May alternatively be one or more views:
+     *
+     *  * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     * 
+ * + * repeated string resource_names = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The resourceNames at the given index. + */ + public java.lang.String getResourceNames(int index) { + return resourceNames_.get(index); + } + + /** + * + * + *
+     * Required. Name of a parent resource from which to retrieve log entries:
+     *
+     * *  `projects/[PROJECT_ID]`
+     * *  `organizations/[ORGANIZATION_ID]`
+     * *  `billingAccounts/[BILLING_ACCOUNT_ID]`
+     * *  `folders/[FOLDER_ID]`
+     *
+     * May alternatively be one or more views:
+     *
+     *  * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     * 
+ * + * repeated string resource_names = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the resourceNames at the given index. + */ + public com.google.protobuf.ByteString getResourceNamesBytes(int index) { + return resourceNames_.getByteString(index); + } + + /** + * + * + *
+     * Required. Name of a parent resource from which to retrieve log entries:
+     *
+     * *  `projects/[PROJECT_ID]`
+     * *  `organizations/[ORGANIZATION_ID]`
+     * *  `billingAccounts/[BILLING_ACCOUNT_ID]`
+     * *  `folders/[FOLDER_ID]`
+     *
+     * May alternatively be one or more views:
+     *
+     *  * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     * 
+ * + * repeated string resource_names = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index to set the value at. + * @param value The resourceNames to set. + * @return This builder for chaining. + */ + public Builder setResourceNames(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureResourceNamesIsMutable(); + resourceNames_.set(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Name of a parent resource from which to retrieve log entries:
+     *
+     * *  `projects/[PROJECT_ID]`
+     * *  `organizations/[ORGANIZATION_ID]`
+     * *  `billingAccounts/[BILLING_ACCOUNT_ID]`
+     * *  `folders/[FOLDER_ID]`
+     *
+     * May alternatively be one or more views:
+     *
+     *  * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     * 
+ * + * repeated string resource_names = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The resourceNames to add. + * @return This builder for chaining. + */ + public Builder addResourceNames(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureResourceNamesIsMutable(); + resourceNames_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Name of a parent resource from which to retrieve log entries:
+     *
+     * *  `projects/[PROJECT_ID]`
+     * *  `organizations/[ORGANIZATION_ID]`
+     * *  `billingAccounts/[BILLING_ACCOUNT_ID]`
+     * *  `folders/[FOLDER_ID]`
+     *
+     * May alternatively be one or more views:
+     *
+     *  * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     * 
+ * + * repeated string resource_names = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param values The resourceNames to add. + * @return This builder for chaining. + */ + public Builder addAllResourceNames(java.lang.Iterable values) { + ensureResourceNamesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, resourceNames_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Name of a parent resource from which to retrieve log entries:
+     *
+     * *  `projects/[PROJECT_ID]`
+     * *  `organizations/[ORGANIZATION_ID]`
+     * *  `billingAccounts/[BILLING_ACCOUNT_ID]`
+     * *  `folders/[FOLDER_ID]`
+     *
+     * May alternatively be one or more views:
+     *
+     *  * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     * 
+ * + * repeated string resource_names = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearResourceNames() { + resourceNames_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + ; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Name of a parent resource from which to retrieve log entries:
+     *
+     * *  `projects/[PROJECT_ID]`
+     * *  `organizations/[ORGANIZATION_ID]`
+     * *  `billingAccounts/[BILLING_ACCOUNT_ID]`
+     * *  `folders/[FOLDER_ID]`
+     *
+     * May alternatively be one or more views:
+     *
+     *  * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     *  * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+     * 
+ * + * repeated string resource_names = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes of the resourceNames to add. + * @return This builder for chaining. + */ + public Builder addResourceNamesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureResourceNamesIsMutable(); + resourceNames_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + + /** + * + * + *
+     * Optional. Only log entries that match the filter are returned.  An empty
+     * filter matches all log entries in the resources listed in `resource_names`.
+     * Referencing a parent resource that is not listed in `resource_names` will
+     * cause the filter to return no results. The maximum length of a filter is
+     * 20,000 characters.
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. Only log entries that match the filter are returned.  An empty
+     * filter matches all log entries in the resources listed in `resource_names`.
+     * Referencing a parent resource that is not listed in `resource_names` will
+     * cause the filter to return no results. The maximum length of a filter is
+     * 20,000 characters.
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. Only log entries that match the filter are returned.  An empty
+     * filter matches all log entries in the resources listed in `resource_names`.
+     * Referencing a parent resource that is not listed in `resource_names` will
+     * cause the filter to return no results. The maximum length of a filter is
+     * 20,000 characters.
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Only log entries that match the filter are returned.  An empty
+     * filter matches all log entries in the resources listed in `resource_names`.
+     * Referencing a parent resource that is not listed in `resource_names` will
+     * cause the filter to return no results. The maximum length of a filter is
+     * 20,000 characters.
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Only log entries that match the filter are returned.  An empty
+     * filter matches all log entries in the resources listed in `resource_names`.
+     * Referencing a parent resource that is not listed in `resource_names` will
+     * cause the filter to return no results. The maximum length of a filter is
+     * 20,000 characters.
+     * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + filter_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.protobuf.Duration bufferWindow_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + bufferWindowBuilder_; + + /** + * + * + *
+     * Optional. The amount of time to buffer log entries at the server before
+     * being returned to prevent out of order results due to late arriving log
+     * entries. Valid values are between 0-60000 milliseconds. Defaults to 2000
+     * milliseconds.
+     * 
+ * + * .google.protobuf.Duration buffer_window = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the bufferWindow field is set. + */ + public boolean hasBufferWindow() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Optional. The amount of time to buffer log entries at the server before
+     * being returned to prevent out of order results due to late arriving log
+     * entries. Valid values are between 0-60000 milliseconds. Defaults to 2000
+     * milliseconds.
+     * 
+ * + * .google.protobuf.Duration buffer_window = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The bufferWindow. + */ + public com.google.protobuf.Duration getBufferWindow() { + if (bufferWindowBuilder_ == null) { + return bufferWindow_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : bufferWindow_; + } else { + return bufferWindowBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. The amount of time to buffer log entries at the server before
+     * being returned to prevent out of order results due to late arriving log
+     * entries. Valid values are between 0-60000 milliseconds. Defaults to 2000
+     * milliseconds.
+     * 
+ * + * .google.protobuf.Duration buffer_window = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setBufferWindow(com.google.protobuf.Duration value) { + if (bufferWindowBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + bufferWindow_ = value; + } else { + bufferWindowBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The amount of time to buffer log entries at the server before
+     * being returned to prevent out of order results due to late arriving log
+     * entries. Valid values are between 0-60000 milliseconds. Defaults to 2000
+     * milliseconds.
+     * 
+ * + * .google.protobuf.Duration buffer_window = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setBufferWindow(com.google.protobuf.Duration.Builder builderForValue) { + if (bufferWindowBuilder_ == null) { + bufferWindow_ = builderForValue.build(); + } else { + bufferWindowBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The amount of time to buffer log entries at the server before
+     * being returned to prevent out of order results due to late arriving log
+     * entries. Valid values are between 0-60000 milliseconds. Defaults to 2000
+     * milliseconds.
+     * 
+ * + * .google.protobuf.Duration buffer_window = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeBufferWindow(com.google.protobuf.Duration value) { + if (bufferWindowBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && bufferWindow_ != null + && bufferWindow_ != com.google.protobuf.Duration.getDefaultInstance()) { + getBufferWindowBuilder().mergeFrom(value); + } else { + bufferWindow_ = value; + } + } else { + bufferWindowBuilder_.mergeFrom(value); + } + if (bufferWindow_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. The amount of time to buffer log entries at the server before
+     * being returned to prevent out of order results due to late arriving log
+     * entries. Valid values are between 0-60000 milliseconds. Defaults to 2000
+     * milliseconds.
+     * 
+ * + * .google.protobuf.Duration buffer_window = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearBufferWindow() { + bitField0_ = (bitField0_ & ~0x00000004); + bufferWindow_ = null; + if (bufferWindowBuilder_ != null) { + bufferWindowBuilder_.dispose(); + bufferWindowBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. The amount of time to buffer log entries at the server before
+     * being returned to prevent out of order results due to late arriving log
+     * entries. Valid values are between 0-60000 milliseconds. Defaults to 2000
+     * milliseconds.
+     * 
+ * + * .google.protobuf.Duration buffer_window = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.Duration.Builder getBufferWindowBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getBufferWindowFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. The amount of time to buffer log entries at the server before
+     * being returned to prevent out of order results due to late arriving log
+     * entries. Valid values are between 0-60000 milliseconds. Defaults to 2000
+     * milliseconds.
+     * 
+ * + * .google.protobuf.Duration buffer_window = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.DurationOrBuilder getBufferWindowOrBuilder() { + if (bufferWindowBuilder_ != null) { + return bufferWindowBuilder_.getMessageOrBuilder(); + } else { + return bufferWindow_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : bufferWindow_; + } + } + + /** + * + * + *
+     * Optional. The amount of time to buffer log entries at the server before
+     * being returned to prevent out of order results due to late arriving log
+     * entries. Valid values are between 0-60000 milliseconds. Defaults to 2000
+     * milliseconds.
+     * 
+ * + * .google.protobuf.Duration buffer_window = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getBufferWindowFieldBuilder() { + if (bufferWindowBuilder_ == null) { + bufferWindowBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getBufferWindow(), getParentForChildren(), isClean()); + bufferWindow_ = null; + } + return bufferWindowBuilder_; + } + + @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.logging.v2.TailLogEntriesRequest) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.TailLogEntriesRequest) + private static final com.google.logging.v2.TailLogEntriesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.TailLogEntriesRequest(); + } + + public static com.google.logging.v2.TailLogEntriesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TailLogEntriesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.TailLogEntriesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/TailLogEntriesRequestOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/TailLogEntriesRequestOrBuilder.java new file mode 100644 index 000000000000..102880e17723 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/TailLogEntriesRequestOrBuilder.java @@ -0,0 +1,211 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface TailLogEntriesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.TailLogEntriesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of a parent resource from which to retrieve log entries:
+   *
+   * *  `projects/[PROJECT_ID]`
+   * *  `organizations/[ORGANIZATION_ID]`
+   * *  `billingAccounts/[BILLING_ACCOUNT_ID]`
+   * *  `folders/[FOLDER_ID]`
+   *
+   * May alternatively be one or more views:
+   *
+   *  * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   * 
+ * + * repeated string resource_names = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the resourceNames. + */ + java.util.List getResourceNamesList(); + + /** + * + * + *
+   * Required. Name of a parent resource from which to retrieve log entries:
+   *
+   * *  `projects/[PROJECT_ID]`
+   * *  `organizations/[ORGANIZATION_ID]`
+   * *  `billingAccounts/[BILLING_ACCOUNT_ID]`
+   * *  `folders/[FOLDER_ID]`
+   *
+   * May alternatively be one or more views:
+   *
+   *  * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   * 
+ * + * repeated string resource_names = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of resourceNames. + */ + int getResourceNamesCount(); + + /** + * + * + *
+   * Required. Name of a parent resource from which to retrieve log entries:
+   *
+   * *  `projects/[PROJECT_ID]`
+   * *  `organizations/[ORGANIZATION_ID]`
+   * *  `billingAccounts/[BILLING_ACCOUNT_ID]`
+   * *  `folders/[FOLDER_ID]`
+   *
+   * May alternatively be one or more views:
+   *
+   *  * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   * 
+ * + * repeated string resource_names = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The resourceNames at the given index. + */ + java.lang.String getResourceNames(int index); + + /** + * + * + *
+   * Required. Name of a parent resource from which to retrieve log entries:
+   *
+   * *  `projects/[PROJECT_ID]`
+   * *  `organizations/[ORGANIZATION_ID]`
+   * *  `billingAccounts/[BILLING_ACCOUNT_ID]`
+   * *  `folders/[FOLDER_ID]`
+   *
+   * May alternatively be one or more views:
+   *
+   *  * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   *  * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
+   * 
+ * + * repeated string resource_names = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the resourceNames at the given index. + */ + com.google.protobuf.ByteString getResourceNamesBytes(int index); + + /** + * + * + *
+   * Optional. Only log entries that match the filter are returned.  An empty
+   * filter matches all log entries in the resources listed in `resource_names`.
+   * Referencing a parent resource that is not listed in `resource_names` will
+   * cause the filter to return no results. The maximum length of a filter is
+   * 20,000 characters.
+   * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + java.lang.String getFilter(); + + /** + * + * + *
+   * Optional. Only log entries that match the filter are returned.  An empty
+   * filter matches all log entries in the resources listed in `resource_names`.
+   * Referencing a parent resource that is not listed in `resource_names` will
+   * cause the filter to return no results. The maximum length of a filter is
+   * 20,000 characters.
+   * 
+ * + * string filter = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Optional. The amount of time to buffer log entries at the server before
+   * being returned to prevent out of order results due to late arriving log
+   * entries. Valid values are between 0-60000 milliseconds. Defaults to 2000
+   * milliseconds.
+   * 
+ * + * .google.protobuf.Duration buffer_window = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the bufferWindow field is set. + */ + boolean hasBufferWindow(); + + /** + * + * + *
+   * Optional. The amount of time to buffer log entries at the server before
+   * being returned to prevent out of order results due to late arriving log
+   * entries. Valid values are between 0-60000 milliseconds. Defaults to 2000
+   * milliseconds.
+   * 
+ * + * .google.protobuf.Duration buffer_window = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The bufferWindow. + */ + com.google.protobuf.Duration getBufferWindow(); + + /** + * + * + *
+   * Optional. The amount of time to buffer log entries at the server before
+   * being returned to prevent out of order results due to late arriving log
+   * entries. Valid values are between 0-60000 milliseconds. Defaults to 2000
+   * milliseconds.
+   * 
+ * + * .google.protobuf.Duration buffer_window = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.DurationOrBuilder getBufferWindowOrBuilder(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/TailLogEntriesResponse.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/TailLogEntriesResponse.java new file mode 100644 index 000000000000..6e2609fc181b --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/TailLogEntriesResponse.java @@ -0,0 +1,2584 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * Result returned from `TailLogEntries`.
+ * 
+ * + * Protobuf type {@code google.logging.v2.TailLogEntriesResponse} + */ +public final class TailLogEntriesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.TailLogEntriesResponse) + TailLogEntriesResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use TailLogEntriesResponse.newBuilder() to construct. + private TailLogEntriesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TailLogEntriesResponse() { + entries_ = java.util.Collections.emptyList(); + suppressionInfo_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new TailLogEntriesResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_TailLogEntriesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_TailLogEntriesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.TailLogEntriesResponse.class, + com.google.logging.v2.TailLogEntriesResponse.Builder.class); + } + + public interface SuppressionInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.TailLogEntriesResponse.SuppressionInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The reason that entries were omitted from the session.
+     * 
+ * + * .google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Reason reason = 1; + * + * @return The enum numeric value on the wire for reason. + */ + int getReasonValue(); + + /** + * + * + *
+     * The reason that entries were omitted from the session.
+     * 
+ * + * .google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Reason reason = 1; + * + * @return The reason. + */ + com.google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Reason getReason(); + + /** + * + * + *
+     * A lower bound on the count of entries omitted due to `reason`.
+     * 
+ * + * int32 suppressed_count = 2; + * + * @return The suppressedCount. + */ + int getSuppressedCount(); + } + + /** + * + * + *
+   * Information about entries that were omitted from the session.
+   * 
+ * + * Protobuf type {@code google.logging.v2.TailLogEntriesResponse.SuppressionInfo} + */ + public static final class SuppressionInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.TailLogEntriesResponse.SuppressionInfo) + SuppressionInfoOrBuilder { + private static final long serialVersionUID = 0L; + + // Use SuppressionInfo.newBuilder() to construct. + private SuppressionInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SuppressionInfo() { + reason_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SuppressionInfo(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_TailLogEntriesResponse_SuppressionInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_TailLogEntriesResponse_SuppressionInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.TailLogEntriesResponse.SuppressionInfo.class, + com.google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Builder.class); + } + + /** + * + * + *
+     * An indicator of why entries were omitted.
+     * 
+ * + * Protobuf enum {@code google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Reason} + */ + public enum Reason implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * Unexpected default.
+       * 
+ * + * REASON_UNSPECIFIED = 0; + */ + REASON_UNSPECIFIED(0), + /** + * + * + *
+       * Indicates suppression occurred due to relevant entries being
+       * received in excess of rate limits. For quotas and limits, see
+       * [Logging API quotas and
+       * limits](https://cloud.google.com/logging/quotas#api-limits).
+       * 
+ * + * RATE_LIMIT = 1; + */ + RATE_LIMIT(1), + /** + * + * + *
+       * Indicates suppression occurred due to the client not consuming
+       * responses quickly enough.
+       * 
+ * + * NOT_CONSUMED = 2; + */ + NOT_CONSUMED(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * Unexpected default.
+       * 
+ * + * REASON_UNSPECIFIED = 0; + */ + public static final int REASON_UNSPECIFIED_VALUE = 0; + + /** + * + * + *
+       * Indicates suppression occurred due to relevant entries being
+       * received in excess of rate limits. For quotas and limits, see
+       * [Logging API quotas and
+       * limits](https://cloud.google.com/logging/quotas#api-limits).
+       * 
+ * + * RATE_LIMIT = 1; + */ + public static final int RATE_LIMIT_VALUE = 1; + + /** + * + * + *
+       * Indicates suppression occurred due to the client not consuming
+       * responses quickly enough.
+       * 
+ * + * NOT_CONSUMED = 2; + */ + public static final int NOT_CONSUMED_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Reason 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 Reason forNumber(int value) { + switch (value) { + case 0: + return REASON_UNSPECIFIED; + case 1: + return RATE_LIMIT; + case 2: + return NOT_CONSUMED; + 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 Reason findValueByNumber(int number) { + return Reason.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.logging.v2.TailLogEntriesResponse.SuppressionInfo.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Reason[] VALUES = values(); + + public static Reason 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 Reason(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Reason) + } + + public static final int REASON_FIELD_NUMBER = 1; + private int reason_ = 0; + + /** + * + * + *
+     * The reason that entries were omitted from the session.
+     * 
+ * + * .google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Reason reason = 1; + * + * @return The enum numeric value on the wire for reason. + */ + @java.lang.Override + public int getReasonValue() { + return reason_; + } + + /** + * + * + *
+     * The reason that entries were omitted from the session.
+     * 
+ * + * .google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Reason reason = 1; + * + * @return The reason. + */ + @java.lang.Override + public com.google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Reason getReason() { + com.google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Reason result = + com.google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Reason.forNumber(reason_); + return result == null + ? com.google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Reason.UNRECOGNIZED + : result; + } + + public static final int SUPPRESSED_COUNT_FIELD_NUMBER = 2; + private int suppressedCount_ = 0; + + /** + * + * + *
+     * A lower bound on the count of entries omitted due to `reason`.
+     * 
+ * + * int32 suppressed_count = 2; + * + * @return The suppressedCount. + */ + @java.lang.Override + public int getSuppressedCount() { + return suppressedCount_; + } + + 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 (reason_ + != com.google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Reason.REASON_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, reason_); + } + if (suppressedCount_ != 0) { + output.writeInt32(2, suppressedCount_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (reason_ + != com.google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Reason.REASON_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, reason_); + } + if (suppressedCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, suppressedCount_); + } + size += getUnknownFields().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.logging.v2.TailLogEntriesResponse.SuppressionInfo)) { + return super.equals(obj); + } + com.google.logging.v2.TailLogEntriesResponse.SuppressionInfo other = + (com.google.logging.v2.TailLogEntriesResponse.SuppressionInfo) obj; + + if (reason_ != other.reason_) return false; + if (getSuppressedCount() != other.getSuppressedCount()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + REASON_FIELD_NUMBER; + hash = (53 * hash) + reason_; + hash = (37 * hash) + SUPPRESSED_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getSuppressedCount(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.TailLogEntriesResponse.SuppressionInfo parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.TailLogEntriesResponse.SuppressionInfo parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.TailLogEntriesResponse.SuppressionInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.TailLogEntriesResponse.SuppressionInfo 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.logging.v2.TailLogEntriesResponse.SuppressionInfo parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.TailLogEntriesResponse.SuppressionInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.TailLogEntriesResponse.SuppressionInfo parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.TailLogEntriesResponse.SuppressionInfo 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.logging.v2.TailLogEntriesResponse.SuppressionInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.TailLogEntriesResponse.SuppressionInfo 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.logging.v2.TailLogEntriesResponse.SuppressionInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.TailLogEntriesResponse.SuppressionInfo 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.logging.v2.TailLogEntriesResponse.SuppressionInfo 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; + } + + /** + * + * + *
+     * Information about entries that were omitted from the session.
+     * 
+ * + * Protobuf type {@code google.logging.v2.TailLogEntriesResponse.SuppressionInfo} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.TailLogEntriesResponse.SuppressionInfo) + com.google.logging.v2.TailLogEntriesResponse.SuppressionInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_TailLogEntriesResponse_SuppressionInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_TailLogEntriesResponse_SuppressionInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.TailLogEntriesResponse.SuppressionInfo.class, + com.google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Builder.class); + } + + // Construct using com.google.logging.v2.TailLogEntriesResponse.SuppressionInfo.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + reason_ = 0; + suppressedCount_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_TailLogEntriesResponse_SuppressionInfo_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.TailLogEntriesResponse.SuppressionInfo + getDefaultInstanceForType() { + return com.google.logging.v2.TailLogEntriesResponse.SuppressionInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.TailLogEntriesResponse.SuppressionInfo build() { + com.google.logging.v2.TailLogEntriesResponse.SuppressionInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.TailLogEntriesResponse.SuppressionInfo buildPartial() { + com.google.logging.v2.TailLogEntriesResponse.SuppressionInfo result = + new com.google.logging.v2.TailLogEntriesResponse.SuppressionInfo(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.logging.v2.TailLogEntriesResponse.SuppressionInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.reason_ = reason_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.suppressedCount_ = suppressedCount_; + } + } + + @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.logging.v2.TailLogEntriesResponse.SuppressionInfo) { + return mergeFrom((com.google.logging.v2.TailLogEntriesResponse.SuppressionInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.TailLogEntriesResponse.SuppressionInfo other) { + if (other + == com.google.logging.v2.TailLogEntriesResponse.SuppressionInfo.getDefaultInstance()) + return this; + if (other.reason_ != 0) { + setReasonValue(other.getReasonValue()); + } + if (other.getSuppressedCount() != 0) { + setSuppressedCount(other.getSuppressedCount()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + reason_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + suppressedCount_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int reason_ = 0; + + /** + * + * + *
+       * The reason that entries were omitted from the session.
+       * 
+ * + * .google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Reason reason = 1; + * + * @return The enum numeric value on the wire for reason. + */ + @java.lang.Override + public int getReasonValue() { + return reason_; + } + + /** + * + * + *
+       * The reason that entries were omitted from the session.
+       * 
+ * + * .google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Reason reason = 1; + * + * @param value The enum numeric value on the wire for reason to set. + * @return This builder for chaining. + */ + public Builder setReasonValue(int value) { + reason_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+       * The reason that entries were omitted from the session.
+       * 
+ * + * .google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Reason reason = 1; + * + * @return The reason. + */ + @java.lang.Override + public com.google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Reason getReason() { + com.google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Reason result = + com.google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Reason.forNumber(reason_); + return result == null + ? com.google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Reason.UNRECOGNIZED + : result; + } + + /** + * + * + *
+       * The reason that entries were omitted from the session.
+       * 
+ * + * .google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Reason reason = 1; + * + * @param value The reason to set. + * @return This builder for chaining. + */ + public Builder setReason( + com.google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Reason value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + reason_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+       * The reason that entries were omitted from the session.
+       * 
+ * + * .google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Reason reason = 1; + * + * @return This builder for chaining. + */ + public Builder clearReason() { + bitField0_ = (bitField0_ & ~0x00000001); + reason_ = 0; + onChanged(); + return this; + } + + private int suppressedCount_; + + /** + * + * + *
+       * A lower bound on the count of entries omitted due to `reason`.
+       * 
+ * + * int32 suppressed_count = 2; + * + * @return The suppressedCount. + */ + @java.lang.Override + public int getSuppressedCount() { + return suppressedCount_; + } + + /** + * + * + *
+       * A lower bound on the count of entries omitted due to `reason`.
+       * 
+ * + * int32 suppressed_count = 2; + * + * @param value The suppressedCount to set. + * @return This builder for chaining. + */ + public Builder setSuppressedCount(int value) { + + suppressedCount_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+       * A lower bound on the count of entries omitted due to `reason`.
+       * 
+ * + * int32 suppressed_count = 2; + * + * @return This builder for chaining. + */ + public Builder clearSuppressedCount() { + bitField0_ = (bitField0_ & ~0x00000002); + suppressedCount_ = 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.logging.v2.TailLogEntriesResponse.SuppressionInfo) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.TailLogEntriesResponse.SuppressionInfo) + private static final com.google.logging.v2.TailLogEntriesResponse.SuppressionInfo + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.TailLogEntriesResponse.SuppressionInfo(); + } + + public static com.google.logging.v2.TailLogEntriesResponse.SuppressionInfo + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SuppressionInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.TailLogEntriesResponse.SuppressionInfo + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int ENTRIES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List entries_; + + /** + * + * + *
+   * A list of log entries. Each response in the stream will order entries with
+   * increasing values of `LogEntry.timestamp`. Ordering is not guaranteed
+   * between separate responses.
+   * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + @java.lang.Override + public java.util.List getEntriesList() { + return entries_; + } + + /** + * + * + *
+   * A list of log entries. Each response in the stream will order entries with
+   * increasing values of `LogEntry.timestamp`. Ordering is not guaranteed
+   * between separate responses.
+   * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + @java.lang.Override + public java.util.List + getEntriesOrBuilderList() { + return entries_; + } + + /** + * + * + *
+   * A list of log entries. Each response in the stream will order entries with
+   * increasing values of `LogEntry.timestamp`. Ordering is not guaranteed
+   * between separate responses.
+   * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + @java.lang.Override + public int getEntriesCount() { + return entries_.size(); + } + + /** + * + * + *
+   * A list of log entries. Each response in the stream will order entries with
+   * increasing values of `LogEntry.timestamp`. Ordering is not guaranteed
+   * between separate responses.
+   * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + @java.lang.Override + public com.google.logging.v2.LogEntry getEntries(int index) { + return entries_.get(index); + } + + /** + * + * + *
+   * A list of log entries. Each response in the stream will order entries with
+   * increasing values of `LogEntry.timestamp`. Ordering is not guaranteed
+   * between separate responses.
+   * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + @java.lang.Override + public com.google.logging.v2.LogEntryOrBuilder getEntriesOrBuilder(int index) { + return entries_.get(index); + } + + public static final int SUPPRESSION_INFO_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private java.util.List + suppressionInfo_; + + /** + * + * + *
+   * If entries that otherwise would have been included in the session were not
+   * sent back to the client, counts of relevant entries omitted from the
+   * session with the reason that they were not included. There will be at most
+   * one of each reason per response. The counts represent the number of
+   * suppressed entries since the last streamed response.
+   * 
+ * + * repeated .google.logging.v2.TailLogEntriesResponse.SuppressionInfo suppression_info = 2; + * + */ + @java.lang.Override + public java.util.List + getSuppressionInfoList() { + return suppressionInfo_; + } + + /** + * + * + *
+   * If entries that otherwise would have been included in the session were not
+   * sent back to the client, counts of relevant entries omitted from the
+   * session with the reason that they were not included. There will be at most
+   * one of each reason per response. The counts represent the number of
+   * suppressed entries since the last streamed response.
+   * 
+ * + * repeated .google.logging.v2.TailLogEntriesResponse.SuppressionInfo suppression_info = 2; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.logging.v2.TailLogEntriesResponse.SuppressionInfoOrBuilder> + getSuppressionInfoOrBuilderList() { + return suppressionInfo_; + } + + /** + * + * + *
+   * If entries that otherwise would have been included in the session were not
+   * sent back to the client, counts of relevant entries omitted from the
+   * session with the reason that they were not included. There will be at most
+   * one of each reason per response. The counts represent the number of
+   * suppressed entries since the last streamed response.
+   * 
+ * + * repeated .google.logging.v2.TailLogEntriesResponse.SuppressionInfo suppression_info = 2; + * + */ + @java.lang.Override + public int getSuppressionInfoCount() { + return suppressionInfo_.size(); + } + + /** + * + * + *
+   * If entries that otherwise would have been included in the session were not
+   * sent back to the client, counts of relevant entries omitted from the
+   * session with the reason that they were not included. There will be at most
+   * one of each reason per response. The counts represent the number of
+   * suppressed entries since the last streamed response.
+   * 
+ * + * repeated .google.logging.v2.TailLogEntriesResponse.SuppressionInfo suppression_info = 2; + * + */ + @java.lang.Override + public com.google.logging.v2.TailLogEntriesResponse.SuppressionInfo getSuppressionInfo( + int index) { + return suppressionInfo_.get(index); + } + + /** + * + * + *
+   * If entries that otherwise would have been included in the session were not
+   * sent back to the client, counts of relevant entries omitted from the
+   * session with the reason that they were not included. There will be at most
+   * one of each reason per response. The counts represent the number of
+   * suppressed entries since the last streamed response.
+   * 
+ * + * repeated .google.logging.v2.TailLogEntriesResponse.SuppressionInfo suppression_info = 2; + * + */ + @java.lang.Override + public com.google.logging.v2.TailLogEntriesResponse.SuppressionInfoOrBuilder + getSuppressionInfoOrBuilder(int index) { + return suppressionInfo_.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 { + for (int i = 0; i < entries_.size(); i++) { + output.writeMessage(1, entries_.get(i)); + } + for (int i = 0; i < suppressionInfo_.size(); i++) { + output.writeMessage(2, suppressionInfo_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < entries_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, entries_.get(i)); + } + for (int i = 0; i < suppressionInfo_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, suppressionInfo_.get(i)); + } + size += getUnknownFields().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.logging.v2.TailLogEntriesResponse)) { + return super.equals(obj); + } + com.google.logging.v2.TailLogEntriesResponse other = + (com.google.logging.v2.TailLogEntriesResponse) obj; + + if (!getEntriesList().equals(other.getEntriesList())) return false; + if (!getSuppressionInfoList().equals(other.getSuppressionInfoList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getEntriesCount() > 0) { + hash = (37 * hash) + ENTRIES_FIELD_NUMBER; + hash = (53 * hash) + getEntriesList().hashCode(); + } + if (getSuppressionInfoCount() > 0) { + hash = (37 * hash) + SUPPRESSION_INFO_FIELD_NUMBER; + hash = (53 * hash) + getSuppressionInfoList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.TailLogEntriesResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.TailLogEntriesResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.TailLogEntriesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.TailLogEntriesResponse 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.logging.v2.TailLogEntriesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.TailLogEntriesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.TailLogEntriesResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.TailLogEntriesResponse 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.logging.v2.TailLogEntriesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.TailLogEntriesResponse 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.logging.v2.TailLogEntriesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.TailLogEntriesResponse 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.logging.v2.TailLogEntriesResponse 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; + } + + /** + * + * + *
+   * Result returned from `TailLogEntries`.
+   * 
+ * + * Protobuf type {@code google.logging.v2.TailLogEntriesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.TailLogEntriesResponse) + com.google.logging.v2.TailLogEntriesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_TailLogEntriesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_TailLogEntriesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.TailLogEntriesResponse.class, + com.google.logging.v2.TailLogEntriesResponse.Builder.class); + } + + // Construct using com.google.logging.v2.TailLogEntriesResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (entriesBuilder_ == null) { + entries_ = java.util.Collections.emptyList(); + } else { + entries_ = null; + entriesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + if (suppressionInfoBuilder_ == null) { + suppressionInfo_ = java.util.Collections.emptyList(); + } else { + suppressionInfo_ = null; + suppressionInfoBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_TailLogEntriesResponse_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.TailLogEntriesResponse getDefaultInstanceForType() { + return com.google.logging.v2.TailLogEntriesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.TailLogEntriesResponse build() { + com.google.logging.v2.TailLogEntriesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.TailLogEntriesResponse buildPartial() { + com.google.logging.v2.TailLogEntriesResponse result = + new com.google.logging.v2.TailLogEntriesResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.logging.v2.TailLogEntriesResponse result) { + if (entriesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + entries_ = java.util.Collections.unmodifiableList(entries_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.entries_ = entries_; + } else { + result.entries_ = entriesBuilder_.build(); + } + if (suppressionInfoBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + suppressionInfo_ = java.util.Collections.unmodifiableList(suppressionInfo_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.suppressionInfo_ = suppressionInfo_; + } else { + result.suppressionInfo_ = suppressionInfoBuilder_.build(); + } + } + + private void buildPartial0(com.google.logging.v2.TailLogEntriesResponse result) { + int from_bitField0_ = bitField0_; + } + + @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.logging.v2.TailLogEntriesResponse) { + return mergeFrom((com.google.logging.v2.TailLogEntriesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.TailLogEntriesResponse other) { + if (other == com.google.logging.v2.TailLogEntriesResponse.getDefaultInstance()) return this; + if (entriesBuilder_ == null) { + if (!other.entries_.isEmpty()) { + if (entries_.isEmpty()) { + entries_ = other.entries_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureEntriesIsMutable(); + entries_.addAll(other.entries_); + } + onChanged(); + } + } else { + if (!other.entries_.isEmpty()) { + if (entriesBuilder_.isEmpty()) { + entriesBuilder_.dispose(); + entriesBuilder_ = null; + entries_ = other.entries_; + bitField0_ = (bitField0_ & ~0x00000001); + entriesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getEntriesFieldBuilder() + : null; + } else { + entriesBuilder_.addAllMessages(other.entries_); + } + } + } + if (suppressionInfoBuilder_ == null) { + if (!other.suppressionInfo_.isEmpty()) { + if (suppressionInfo_.isEmpty()) { + suppressionInfo_ = other.suppressionInfo_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureSuppressionInfoIsMutable(); + suppressionInfo_.addAll(other.suppressionInfo_); + } + onChanged(); + } + } else { + if (!other.suppressionInfo_.isEmpty()) { + if (suppressionInfoBuilder_.isEmpty()) { + suppressionInfoBuilder_.dispose(); + suppressionInfoBuilder_ = null; + suppressionInfo_ = other.suppressionInfo_; + bitField0_ = (bitField0_ & ~0x00000002); + suppressionInfoBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getSuppressionInfoFieldBuilder() + : null; + } else { + suppressionInfoBuilder_.addAllMessages(other.suppressionInfo_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.logging.v2.LogEntry m = + input.readMessage(com.google.logging.v2.LogEntry.parser(), extensionRegistry); + if (entriesBuilder_ == null) { + ensureEntriesIsMutable(); + entries_.add(m); + } else { + entriesBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + com.google.logging.v2.TailLogEntriesResponse.SuppressionInfo m = + input.readMessage( + com.google.logging.v2.TailLogEntriesResponse.SuppressionInfo.parser(), + extensionRegistry); + if (suppressionInfoBuilder_ == null) { + ensureSuppressionInfoIsMutable(); + suppressionInfo_.add(m); + } else { + suppressionInfoBuilder_.addMessage(m); + } + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List entries_ = + java.util.Collections.emptyList(); + + private void ensureEntriesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + entries_ = new java.util.ArrayList(entries_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.logging.v2.LogEntry, + com.google.logging.v2.LogEntry.Builder, + com.google.logging.v2.LogEntryOrBuilder> + entriesBuilder_; + + /** + * + * + *
+     * A list of log entries. Each response in the stream will order entries with
+     * increasing values of `LogEntry.timestamp`. Ordering is not guaranteed
+     * between separate responses.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + public java.util.List getEntriesList() { + if (entriesBuilder_ == null) { + return java.util.Collections.unmodifiableList(entries_); + } else { + return entriesBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * A list of log entries. Each response in the stream will order entries with
+     * increasing values of `LogEntry.timestamp`. Ordering is not guaranteed
+     * between separate responses.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + public int getEntriesCount() { + if (entriesBuilder_ == null) { + return entries_.size(); + } else { + return entriesBuilder_.getCount(); + } + } + + /** + * + * + *
+     * A list of log entries. Each response in the stream will order entries with
+     * increasing values of `LogEntry.timestamp`. Ordering is not guaranteed
+     * between separate responses.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + public com.google.logging.v2.LogEntry getEntries(int index) { + if (entriesBuilder_ == null) { + return entries_.get(index); + } else { + return entriesBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * A list of log entries. Each response in the stream will order entries with
+     * increasing values of `LogEntry.timestamp`. Ordering is not guaranteed
+     * between separate responses.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + public Builder setEntries(int index, com.google.logging.v2.LogEntry value) { + if (entriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEntriesIsMutable(); + entries_.set(index, value); + onChanged(); + } else { + entriesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * A list of log entries. Each response in the stream will order entries with
+     * increasing values of `LogEntry.timestamp`. Ordering is not guaranteed
+     * between separate responses.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + public Builder setEntries(int index, com.google.logging.v2.LogEntry.Builder builderForValue) { + if (entriesBuilder_ == null) { + ensureEntriesIsMutable(); + entries_.set(index, builderForValue.build()); + onChanged(); + } else { + entriesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of log entries. Each response in the stream will order entries with
+     * increasing values of `LogEntry.timestamp`. Ordering is not guaranteed
+     * between separate responses.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + public Builder addEntries(com.google.logging.v2.LogEntry value) { + if (entriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEntriesIsMutable(); + entries_.add(value); + onChanged(); + } else { + entriesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * A list of log entries. Each response in the stream will order entries with
+     * increasing values of `LogEntry.timestamp`. Ordering is not guaranteed
+     * between separate responses.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + public Builder addEntries(int index, com.google.logging.v2.LogEntry value) { + if (entriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEntriesIsMutable(); + entries_.add(index, value); + onChanged(); + } else { + entriesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * A list of log entries. Each response in the stream will order entries with
+     * increasing values of `LogEntry.timestamp`. Ordering is not guaranteed
+     * between separate responses.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + public Builder addEntries(com.google.logging.v2.LogEntry.Builder builderForValue) { + if (entriesBuilder_ == null) { + ensureEntriesIsMutable(); + entries_.add(builderForValue.build()); + onChanged(); + } else { + entriesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of log entries. Each response in the stream will order entries with
+     * increasing values of `LogEntry.timestamp`. Ordering is not guaranteed
+     * between separate responses.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + public Builder addEntries(int index, com.google.logging.v2.LogEntry.Builder builderForValue) { + if (entriesBuilder_ == null) { + ensureEntriesIsMutable(); + entries_.add(index, builderForValue.build()); + onChanged(); + } else { + entriesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * A list of log entries. Each response in the stream will order entries with
+     * increasing values of `LogEntry.timestamp`. Ordering is not guaranteed
+     * between separate responses.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + public Builder addAllEntries( + java.lang.Iterable values) { + if (entriesBuilder_ == null) { + ensureEntriesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, entries_); + onChanged(); + } else { + entriesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * A list of log entries. Each response in the stream will order entries with
+     * increasing values of `LogEntry.timestamp`. Ordering is not guaranteed
+     * between separate responses.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + public Builder clearEntries() { + if (entriesBuilder_ == null) { + entries_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + entriesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * A list of log entries. Each response in the stream will order entries with
+     * increasing values of `LogEntry.timestamp`. Ordering is not guaranteed
+     * between separate responses.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + public Builder removeEntries(int index) { + if (entriesBuilder_ == null) { + ensureEntriesIsMutable(); + entries_.remove(index); + onChanged(); + } else { + entriesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * A list of log entries. Each response in the stream will order entries with
+     * increasing values of `LogEntry.timestamp`. Ordering is not guaranteed
+     * between separate responses.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + public com.google.logging.v2.LogEntry.Builder getEntriesBuilder(int index) { + return getEntriesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * A list of log entries. Each response in the stream will order entries with
+     * increasing values of `LogEntry.timestamp`. Ordering is not guaranteed
+     * between separate responses.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + public com.google.logging.v2.LogEntryOrBuilder getEntriesOrBuilder(int index) { + if (entriesBuilder_ == null) { + return entries_.get(index); + } else { + return entriesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * A list of log entries. Each response in the stream will order entries with
+     * increasing values of `LogEntry.timestamp`. Ordering is not guaranteed
+     * between separate responses.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + public java.util.List + getEntriesOrBuilderList() { + if (entriesBuilder_ != null) { + return entriesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(entries_); + } + } + + /** + * + * + *
+     * A list of log entries. Each response in the stream will order entries with
+     * increasing values of `LogEntry.timestamp`. Ordering is not guaranteed
+     * between separate responses.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + public com.google.logging.v2.LogEntry.Builder addEntriesBuilder() { + return getEntriesFieldBuilder() + .addBuilder(com.google.logging.v2.LogEntry.getDefaultInstance()); + } + + /** + * + * + *
+     * A list of log entries. Each response in the stream will order entries with
+     * increasing values of `LogEntry.timestamp`. Ordering is not guaranteed
+     * between separate responses.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + public com.google.logging.v2.LogEntry.Builder addEntriesBuilder(int index) { + return getEntriesFieldBuilder() + .addBuilder(index, com.google.logging.v2.LogEntry.getDefaultInstance()); + } + + /** + * + * + *
+     * A list of log entries. Each response in the stream will order entries with
+     * increasing values of `LogEntry.timestamp`. Ordering is not guaranteed
+     * between separate responses.
+     * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + public java.util.List getEntriesBuilderList() { + return getEntriesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.logging.v2.LogEntry, + com.google.logging.v2.LogEntry.Builder, + com.google.logging.v2.LogEntryOrBuilder> + getEntriesFieldBuilder() { + if (entriesBuilder_ == null) { + entriesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.logging.v2.LogEntry, + com.google.logging.v2.LogEntry.Builder, + com.google.logging.v2.LogEntryOrBuilder>( + entries_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + entries_ = null; + } + return entriesBuilder_; + } + + private java.util.List + suppressionInfo_ = java.util.Collections.emptyList(); + + private void ensureSuppressionInfoIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + suppressionInfo_ = + new java.util.ArrayList( + suppressionInfo_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.logging.v2.TailLogEntriesResponse.SuppressionInfo, + com.google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Builder, + com.google.logging.v2.TailLogEntriesResponse.SuppressionInfoOrBuilder> + suppressionInfoBuilder_; + + /** + * + * + *
+     * If entries that otherwise would have been included in the session were not
+     * sent back to the client, counts of relevant entries omitted from the
+     * session with the reason that they were not included. There will be at most
+     * one of each reason per response. The counts represent the number of
+     * suppressed entries since the last streamed response.
+     * 
+ * + * + * repeated .google.logging.v2.TailLogEntriesResponse.SuppressionInfo suppression_info = 2; + * + */ + public java.util.List + getSuppressionInfoList() { + if (suppressionInfoBuilder_ == null) { + return java.util.Collections.unmodifiableList(suppressionInfo_); + } else { + return suppressionInfoBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * If entries that otherwise would have been included in the session were not
+     * sent back to the client, counts of relevant entries omitted from the
+     * session with the reason that they were not included. There will be at most
+     * one of each reason per response. The counts represent the number of
+     * suppressed entries since the last streamed response.
+     * 
+ * + * + * repeated .google.logging.v2.TailLogEntriesResponse.SuppressionInfo suppression_info = 2; + * + */ + public int getSuppressionInfoCount() { + if (suppressionInfoBuilder_ == null) { + return suppressionInfo_.size(); + } else { + return suppressionInfoBuilder_.getCount(); + } + } + + /** + * + * + *
+     * If entries that otherwise would have been included in the session were not
+     * sent back to the client, counts of relevant entries omitted from the
+     * session with the reason that they were not included. There will be at most
+     * one of each reason per response. The counts represent the number of
+     * suppressed entries since the last streamed response.
+     * 
+ * + * + * repeated .google.logging.v2.TailLogEntriesResponse.SuppressionInfo suppression_info = 2; + * + */ + public com.google.logging.v2.TailLogEntriesResponse.SuppressionInfo getSuppressionInfo( + int index) { + if (suppressionInfoBuilder_ == null) { + return suppressionInfo_.get(index); + } else { + return suppressionInfoBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * If entries that otherwise would have been included in the session were not
+     * sent back to the client, counts of relevant entries omitted from the
+     * session with the reason that they were not included. There will be at most
+     * one of each reason per response. The counts represent the number of
+     * suppressed entries since the last streamed response.
+     * 
+ * + * + * repeated .google.logging.v2.TailLogEntriesResponse.SuppressionInfo suppression_info = 2; + * + */ + public Builder setSuppressionInfo( + int index, com.google.logging.v2.TailLogEntriesResponse.SuppressionInfo value) { + if (suppressionInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSuppressionInfoIsMutable(); + suppressionInfo_.set(index, value); + onChanged(); + } else { + suppressionInfoBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * If entries that otherwise would have been included in the session were not
+     * sent back to the client, counts of relevant entries omitted from the
+     * session with the reason that they were not included. There will be at most
+     * one of each reason per response. The counts represent the number of
+     * suppressed entries since the last streamed response.
+     * 
+ * + * + * repeated .google.logging.v2.TailLogEntriesResponse.SuppressionInfo suppression_info = 2; + * + */ + public Builder setSuppressionInfo( + int index, + com.google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Builder builderForValue) { + if (suppressionInfoBuilder_ == null) { + ensureSuppressionInfoIsMutable(); + suppressionInfo_.set(index, builderForValue.build()); + onChanged(); + } else { + suppressionInfoBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * If entries that otherwise would have been included in the session were not
+     * sent back to the client, counts of relevant entries omitted from the
+     * session with the reason that they were not included. There will be at most
+     * one of each reason per response. The counts represent the number of
+     * suppressed entries since the last streamed response.
+     * 
+ * + * + * repeated .google.logging.v2.TailLogEntriesResponse.SuppressionInfo suppression_info = 2; + * + */ + public Builder addSuppressionInfo( + com.google.logging.v2.TailLogEntriesResponse.SuppressionInfo value) { + if (suppressionInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSuppressionInfoIsMutable(); + suppressionInfo_.add(value); + onChanged(); + } else { + suppressionInfoBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * If entries that otherwise would have been included in the session were not
+     * sent back to the client, counts of relevant entries omitted from the
+     * session with the reason that they were not included. There will be at most
+     * one of each reason per response. The counts represent the number of
+     * suppressed entries since the last streamed response.
+     * 
+ * + * + * repeated .google.logging.v2.TailLogEntriesResponse.SuppressionInfo suppression_info = 2; + * + */ + public Builder addSuppressionInfo( + int index, com.google.logging.v2.TailLogEntriesResponse.SuppressionInfo value) { + if (suppressionInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSuppressionInfoIsMutable(); + suppressionInfo_.add(index, value); + onChanged(); + } else { + suppressionInfoBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * If entries that otherwise would have been included in the session were not
+     * sent back to the client, counts of relevant entries omitted from the
+     * session with the reason that they were not included. There will be at most
+     * one of each reason per response. The counts represent the number of
+     * suppressed entries since the last streamed response.
+     * 
+ * + * + * repeated .google.logging.v2.TailLogEntriesResponse.SuppressionInfo suppression_info = 2; + * + */ + public Builder addSuppressionInfo( + com.google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Builder builderForValue) { + if (suppressionInfoBuilder_ == null) { + ensureSuppressionInfoIsMutable(); + suppressionInfo_.add(builderForValue.build()); + onChanged(); + } else { + suppressionInfoBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * If entries that otherwise would have been included in the session were not
+     * sent back to the client, counts of relevant entries omitted from the
+     * session with the reason that they were not included. There will be at most
+     * one of each reason per response. The counts represent the number of
+     * suppressed entries since the last streamed response.
+     * 
+ * + * + * repeated .google.logging.v2.TailLogEntriesResponse.SuppressionInfo suppression_info = 2; + * + */ + public Builder addSuppressionInfo( + int index, + com.google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Builder builderForValue) { + if (suppressionInfoBuilder_ == null) { + ensureSuppressionInfoIsMutable(); + suppressionInfo_.add(index, builderForValue.build()); + onChanged(); + } else { + suppressionInfoBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * If entries that otherwise would have been included in the session were not
+     * sent back to the client, counts of relevant entries omitted from the
+     * session with the reason that they were not included. There will be at most
+     * one of each reason per response. The counts represent the number of
+     * suppressed entries since the last streamed response.
+     * 
+ * + * + * repeated .google.logging.v2.TailLogEntriesResponse.SuppressionInfo suppression_info = 2; + * + */ + public Builder addAllSuppressionInfo( + java.lang.Iterable + values) { + if (suppressionInfoBuilder_ == null) { + ensureSuppressionInfoIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, suppressionInfo_); + onChanged(); + } else { + suppressionInfoBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * If entries that otherwise would have been included in the session were not
+     * sent back to the client, counts of relevant entries omitted from the
+     * session with the reason that they were not included. There will be at most
+     * one of each reason per response. The counts represent the number of
+     * suppressed entries since the last streamed response.
+     * 
+ * + * + * repeated .google.logging.v2.TailLogEntriesResponse.SuppressionInfo suppression_info = 2; + * + */ + public Builder clearSuppressionInfo() { + if (suppressionInfoBuilder_ == null) { + suppressionInfo_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + suppressionInfoBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * If entries that otherwise would have been included in the session were not
+     * sent back to the client, counts of relevant entries omitted from the
+     * session with the reason that they were not included. There will be at most
+     * one of each reason per response. The counts represent the number of
+     * suppressed entries since the last streamed response.
+     * 
+ * + * + * repeated .google.logging.v2.TailLogEntriesResponse.SuppressionInfo suppression_info = 2; + * + */ + public Builder removeSuppressionInfo(int index) { + if (suppressionInfoBuilder_ == null) { + ensureSuppressionInfoIsMutable(); + suppressionInfo_.remove(index); + onChanged(); + } else { + suppressionInfoBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * If entries that otherwise would have been included in the session were not
+     * sent back to the client, counts of relevant entries omitted from the
+     * session with the reason that they were not included. There will be at most
+     * one of each reason per response. The counts represent the number of
+     * suppressed entries since the last streamed response.
+     * 
+ * + * + * repeated .google.logging.v2.TailLogEntriesResponse.SuppressionInfo suppression_info = 2; + * + */ + public com.google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Builder + getSuppressionInfoBuilder(int index) { + return getSuppressionInfoFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * If entries that otherwise would have been included in the session were not
+     * sent back to the client, counts of relevant entries omitted from the
+     * session with the reason that they were not included. There will be at most
+     * one of each reason per response. The counts represent the number of
+     * suppressed entries since the last streamed response.
+     * 
+ * + * + * repeated .google.logging.v2.TailLogEntriesResponse.SuppressionInfo suppression_info = 2; + * + */ + public com.google.logging.v2.TailLogEntriesResponse.SuppressionInfoOrBuilder + getSuppressionInfoOrBuilder(int index) { + if (suppressionInfoBuilder_ == null) { + return suppressionInfo_.get(index); + } else { + return suppressionInfoBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * If entries that otherwise would have been included in the session were not
+     * sent back to the client, counts of relevant entries omitted from the
+     * session with the reason that they were not included. There will be at most
+     * one of each reason per response. The counts represent the number of
+     * suppressed entries since the last streamed response.
+     * 
+ * + * + * repeated .google.logging.v2.TailLogEntriesResponse.SuppressionInfo suppression_info = 2; + * + */ + public java.util.List< + ? extends com.google.logging.v2.TailLogEntriesResponse.SuppressionInfoOrBuilder> + getSuppressionInfoOrBuilderList() { + if (suppressionInfoBuilder_ != null) { + return suppressionInfoBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(suppressionInfo_); + } + } + + /** + * + * + *
+     * If entries that otherwise would have been included in the session were not
+     * sent back to the client, counts of relevant entries omitted from the
+     * session with the reason that they were not included. There will be at most
+     * one of each reason per response. The counts represent the number of
+     * suppressed entries since the last streamed response.
+     * 
+ * + * + * repeated .google.logging.v2.TailLogEntriesResponse.SuppressionInfo suppression_info = 2; + * + */ + public com.google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Builder + addSuppressionInfoBuilder() { + return getSuppressionInfoFieldBuilder() + .addBuilder( + com.google.logging.v2.TailLogEntriesResponse.SuppressionInfo.getDefaultInstance()); + } + + /** + * + * + *
+     * If entries that otherwise would have been included in the session were not
+     * sent back to the client, counts of relevant entries omitted from the
+     * session with the reason that they were not included. There will be at most
+     * one of each reason per response. The counts represent the number of
+     * suppressed entries since the last streamed response.
+     * 
+ * + * + * repeated .google.logging.v2.TailLogEntriesResponse.SuppressionInfo suppression_info = 2; + * + */ + public com.google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Builder + addSuppressionInfoBuilder(int index) { + return getSuppressionInfoFieldBuilder() + .addBuilder( + index, + com.google.logging.v2.TailLogEntriesResponse.SuppressionInfo.getDefaultInstance()); + } + + /** + * + * + *
+     * If entries that otherwise would have been included in the session were not
+     * sent back to the client, counts of relevant entries omitted from the
+     * session with the reason that they were not included. There will be at most
+     * one of each reason per response. The counts represent the number of
+     * suppressed entries since the last streamed response.
+     * 
+ * + * + * repeated .google.logging.v2.TailLogEntriesResponse.SuppressionInfo suppression_info = 2; + * + */ + public java.util.List + getSuppressionInfoBuilderList() { + return getSuppressionInfoFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.logging.v2.TailLogEntriesResponse.SuppressionInfo, + com.google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Builder, + com.google.logging.v2.TailLogEntriesResponse.SuppressionInfoOrBuilder> + getSuppressionInfoFieldBuilder() { + if (suppressionInfoBuilder_ == null) { + suppressionInfoBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.logging.v2.TailLogEntriesResponse.SuppressionInfo, + com.google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Builder, + com.google.logging.v2.TailLogEntriesResponse.SuppressionInfoOrBuilder>( + suppressionInfo_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + suppressionInfo_ = null; + } + return suppressionInfoBuilder_; + } + + @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.logging.v2.TailLogEntriesResponse) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.TailLogEntriesResponse) + private static final com.google.logging.v2.TailLogEntriesResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.TailLogEntriesResponse(); + } + + public static com.google.logging.v2.TailLogEntriesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TailLogEntriesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.TailLogEntriesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/TailLogEntriesResponseOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/TailLogEntriesResponseOrBuilder.java new file mode 100644 index 000000000000..a411989b4b54 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/TailLogEntriesResponseOrBuilder.java @@ -0,0 +1,174 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface TailLogEntriesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.TailLogEntriesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A list of log entries. Each response in the stream will order entries with
+   * increasing values of `LogEntry.timestamp`. Ordering is not guaranteed
+   * between separate responses.
+   * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + java.util.List getEntriesList(); + + /** + * + * + *
+   * A list of log entries. Each response in the stream will order entries with
+   * increasing values of `LogEntry.timestamp`. Ordering is not guaranteed
+   * between separate responses.
+   * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + com.google.logging.v2.LogEntry getEntries(int index); + + /** + * + * + *
+   * A list of log entries. Each response in the stream will order entries with
+   * increasing values of `LogEntry.timestamp`. Ordering is not guaranteed
+   * between separate responses.
+   * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + int getEntriesCount(); + + /** + * + * + *
+   * A list of log entries. Each response in the stream will order entries with
+   * increasing values of `LogEntry.timestamp`. Ordering is not guaranteed
+   * between separate responses.
+   * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + java.util.List getEntriesOrBuilderList(); + + /** + * + * + *
+   * A list of log entries. Each response in the stream will order entries with
+   * increasing values of `LogEntry.timestamp`. Ordering is not guaranteed
+   * between separate responses.
+   * 
+ * + * repeated .google.logging.v2.LogEntry entries = 1; + */ + com.google.logging.v2.LogEntryOrBuilder getEntriesOrBuilder(int index); + + /** + * + * + *
+   * If entries that otherwise would have been included in the session were not
+   * sent back to the client, counts of relevant entries omitted from the
+   * session with the reason that they were not included. There will be at most
+   * one of each reason per response. The counts represent the number of
+   * suppressed entries since the last streamed response.
+   * 
+ * + * repeated .google.logging.v2.TailLogEntriesResponse.SuppressionInfo suppression_info = 2; + * + */ + java.util.List + getSuppressionInfoList(); + + /** + * + * + *
+   * If entries that otherwise would have been included in the session were not
+   * sent back to the client, counts of relevant entries omitted from the
+   * session with the reason that they were not included. There will be at most
+   * one of each reason per response. The counts represent the number of
+   * suppressed entries since the last streamed response.
+   * 
+ * + * repeated .google.logging.v2.TailLogEntriesResponse.SuppressionInfo suppression_info = 2; + * + */ + com.google.logging.v2.TailLogEntriesResponse.SuppressionInfo getSuppressionInfo(int index); + + /** + * + * + *
+   * If entries that otherwise would have been included in the session were not
+   * sent back to the client, counts of relevant entries omitted from the
+   * session with the reason that they were not included. There will be at most
+   * one of each reason per response. The counts represent the number of
+   * suppressed entries since the last streamed response.
+   * 
+ * + * repeated .google.logging.v2.TailLogEntriesResponse.SuppressionInfo suppression_info = 2; + * + */ + int getSuppressionInfoCount(); + + /** + * + * + *
+   * If entries that otherwise would have been included in the session were not
+   * sent back to the client, counts of relevant entries omitted from the
+   * session with the reason that they were not included. There will be at most
+   * one of each reason per response. The counts represent the number of
+   * suppressed entries since the last streamed response.
+   * 
+ * + * repeated .google.logging.v2.TailLogEntriesResponse.SuppressionInfo suppression_info = 2; + * + */ + java.util.List + getSuppressionInfoOrBuilderList(); + + /** + * + * + *
+   * If entries that otherwise would have been included in the session were not
+   * sent back to the client, counts of relevant entries omitted from the
+   * session with the reason that they were not included. There will be at most
+   * one of each reason per response. The counts represent the number of
+   * suppressed entries since the last streamed response.
+   * 
+ * + * repeated .google.logging.v2.TailLogEntriesResponse.SuppressionInfo suppression_info = 2; + * + */ + com.google.logging.v2.TailLogEntriesResponse.SuppressionInfoOrBuilder getSuppressionInfoOrBuilder( + int index); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UndeleteBucketRequest.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UndeleteBucketRequest.java new file mode 100644 index 000000000000..dc8f45881fa1 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UndeleteBucketRequest.java @@ -0,0 +1,710 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * The parameters to `UndeleteBucket`.
+ * 
+ * + * Protobuf type {@code google.logging.v2.UndeleteBucketRequest} + */ +public final class UndeleteBucketRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.UndeleteBucketRequest) + UndeleteBucketRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use UndeleteBucketRequest.newBuilder() to construct. + private UndeleteBucketRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UndeleteBucketRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UndeleteBucketRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_UndeleteBucketRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_UndeleteBucketRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.UndeleteBucketRequest.class, + com.google.logging.v2.UndeleteBucketRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. The full resource name of the bucket to undelete.
+   *
+   *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *
+   * For example:
+   *
+   *   `"projects/my-project/locations/global/buckets/my-bucket"`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The full resource name of the bucket to undelete.
+   *
+   *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *
+   * For example:
+   *
+   *   `"projects/my-project/locations/global/buckets/my-bucket"`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += getUnknownFields().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.logging.v2.UndeleteBucketRequest)) { + return super.equals(obj); + } + com.google.logging.v2.UndeleteBucketRequest other = + (com.google.logging.v2.UndeleteBucketRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.UndeleteBucketRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.UndeleteBucketRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.UndeleteBucketRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.UndeleteBucketRequest 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.logging.v2.UndeleteBucketRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.UndeleteBucketRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.UndeleteBucketRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.UndeleteBucketRequest 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.logging.v2.UndeleteBucketRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.UndeleteBucketRequest 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.logging.v2.UndeleteBucketRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.UndeleteBucketRequest 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.logging.v2.UndeleteBucketRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The parameters to `UndeleteBucket`.
+   * 
+ * + * Protobuf type {@code google.logging.v2.UndeleteBucketRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.UndeleteBucketRequest) + com.google.logging.v2.UndeleteBucketRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_UndeleteBucketRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_UndeleteBucketRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.UndeleteBucketRequest.class, + com.google.logging.v2.UndeleteBucketRequest.Builder.class); + } + + // Construct using com.google.logging.v2.UndeleteBucketRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_UndeleteBucketRequest_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.UndeleteBucketRequest getDefaultInstanceForType() { + return com.google.logging.v2.UndeleteBucketRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.UndeleteBucketRequest build() { + com.google.logging.v2.UndeleteBucketRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.UndeleteBucketRequest buildPartial() { + com.google.logging.v2.UndeleteBucketRequest result = + new com.google.logging.v2.UndeleteBucketRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.logging.v2.UndeleteBucketRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + } + + @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.logging.v2.UndeleteBucketRequest) { + return mergeFrom((com.google.logging.v2.UndeleteBucketRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.UndeleteBucketRequest other) { + if (other == com.google.logging.v2.UndeleteBucketRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. The full resource name of the bucket to undelete.
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/locations/global/buckets/my-bucket"`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The full resource name of the bucket to undelete.
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/locations/global/buckets/my-bucket"`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The full resource name of the bucket to undelete.
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/locations/global/buckets/my-bucket"`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The full resource name of the bucket to undelete.
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/locations/global/buckets/my-bucket"`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The full resource name of the bucket to undelete.
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/locations/global/buckets/my-bucket"`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + 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.logging.v2.UndeleteBucketRequest) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.UndeleteBucketRequest) + private static final com.google.logging.v2.UndeleteBucketRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.UndeleteBucketRequest(); + } + + public static com.google.logging.v2.UndeleteBucketRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UndeleteBucketRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.UndeleteBucketRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UndeleteBucketRequestOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UndeleteBucketRequestOrBuilder.java new file mode 100644 index 000000000000..e7177d7772ba --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UndeleteBucketRequestOrBuilder.java @@ -0,0 +1,74 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface UndeleteBucketRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.UndeleteBucketRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The full resource name of the bucket to undelete.
+   *
+   *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *
+   * For example:
+   *
+   *   `"projects/my-project/locations/global/buckets/my-bucket"`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Required. The full resource name of the bucket to undelete.
+   *
+   *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *
+   * For example:
+   *
+   *   `"projects/my-project/locations/global/buckets/my-bucket"`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateBucketRequest.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateBucketRequest.java new file mode 100644 index 000000000000..d9614314bf99 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateBucketRequest.java @@ -0,0 +1,1374 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * The parameters to `UpdateBucket`.
+ * 
+ * + * Protobuf type {@code google.logging.v2.UpdateBucketRequest} + */ +public final class UpdateBucketRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.UpdateBucketRequest) + UpdateBucketRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use UpdateBucketRequest.newBuilder() to construct. + private UpdateBucketRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateBucketRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateBucketRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_UpdateBucketRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_UpdateBucketRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.UpdateBucketRequest.class, + com.google.logging.v2.UpdateBucketRequest.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. The full resource name of the bucket to update.
+   *
+   *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *
+   * For example:
+   *
+   *   `"projects/my-project/locations/global/buckets/my-bucket"`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The full resource name of the bucket to update.
+   *
+   *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *
+   * For example:
+   *
+   *   `"projects/my-project/locations/global/buckets/my-bucket"`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BUCKET_FIELD_NUMBER = 2; + private com.google.logging.v2.LogBucket bucket_; + + /** + * + * + *
+   * Required. The updated bucket.
+   * 
+ * + * .google.logging.v2.LogBucket bucket = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the bucket field is set. + */ + @java.lang.Override + public boolean hasBucket() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Required. The updated bucket.
+   * 
+ * + * .google.logging.v2.LogBucket bucket = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bucket. + */ + @java.lang.Override + public com.google.logging.v2.LogBucket getBucket() { + return bucket_ == null ? com.google.logging.v2.LogBucket.getDefaultInstance() : bucket_; + } + + /** + * + * + *
+   * Required. The updated bucket.
+   * 
+ * + * .google.logging.v2.LogBucket bucket = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + @java.lang.Override + public com.google.logging.v2.LogBucketOrBuilder getBucketOrBuilder() { + return bucket_ == null ? com.google.logging.v2.LogBucket.getDefaultInstance() : bucket_; + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 4; + private com.google.protobuf.FieldMask updateMask_; + + /** + * + * + *
+   * Required. Field mask that specifies the fields in `bucket` that need an
+   * update. A bucket field will be overwritten if, and only if, it is in the
+   * update mask. `name` and output only fields cannot be updated.
+   *
+   * For a detailed `FieldMask` definition, see:
+   * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
+   *
+   * For example: `updateMask=retention_days`
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Required. Field mask that specifies the fields in `bucket` that need an
+   * update. A bucket field will be overwritten if, and only if, it is in the
+   * update mask. `name` and output only fields cannot be updated.
+   *
+   * For a detailed `FieldMask` definition, see:
+   * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
+   *
+   * For example: `updateMask=retention_days`
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + /** + * + * + *
+   * Required. Field mask that specifies the fields in `bucket` that need an
+   * update. A bucket field will be overwritten if, and only if, it is in the
+   * update mask. `name` and output only fields cannot be updated.
+   *
+   * For a detailed `FieldMask` definition, see:
+   * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
+   *
+   * For example: `updateMask=retention_days`
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getBucket()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(4, getUpdateMask()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getBucket()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getUpdateMask()); + } + size += getUnknownFields().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.logging.v2.UpdateBucketRequest)) { + return super.equals(obj); + } + com.google.logging.v2.UpdateBucketRequest other = + (com.google.logging.v2.UpdateBucketRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (hasBucket() != other.hasBucket()) return false; + if (hasBucket()) { + if (!getBucket().equals(other.getBucket())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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 (hasBucket()) { + hash = (37 * hash) + BUCKET_FIELD_NUMBER; + hash = (53 * hash) + getBucket().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.UpdateBucketRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.UpdateBucketRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.UpdateBucketRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.UpdateBucketRequest 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.logging.v2.UpdateBucketRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.UpdateBucketRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.UpdateBucketRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.UpdateBucketRequest 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.logging.v2.UpdateBucketRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.UpdateBucketRequest 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.logging.v2.UpdateBucketRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.UpdateBucketRequest 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.logging.v2.UpdateBucketRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The parameters to `UpdateBucket`.
+   * 
+ * + * Protobuf type {@code google.logging.v2.UpdateBucketRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.UpdateBucketRequest) + com.google.logging.v2.UpdateBucketRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_UpdateBucketRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_UpdateBucketRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.UpdateBucketRequest.class, + com.google.logging.v2.UpdateBucketRequest.Builder.class); + } + + // Construct using com.google.logging.v2.UpdateBucketRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getBucketFieldBuilder(); + getUpdateMaskFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + bucket_ = null; + if (bucketBuilder_ != null) { + bucketBuilder_.dispose(); + bucketBuilder_ = null; + } + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_UpdateBucketRequest_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.UpdateBucketRequest getDefaultInstanceForType() { + return com.google.logging.v2.UpdateBucketRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.UpdateBucketRequest build() { + com.google.logging.v2.UpdateBucketRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.UpdateBucketRequest buildPartial() { + com.google.logging.v2.UpdateBucketRequest result = + new com.google.logging.v2.UpdateBucketRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.logging.v2.UpdateBucketRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.bucket_ = bucketBuilder_ == null ? bucket_ : bucketBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @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.logging.v2.UpdateBucketRequest) { + return mergeFrom((com.google.logging.v2.UpdateBucketRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.UpdateBucketRequest other) { + if (other == com.google.logging.v2.UpdateBucketRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasBucket()) { + mergeBucket(other.getBucket()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getBucketFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 34: + { + input.readMessage(getUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. The full resource name of the bucket to update.
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/locations/global/buckets/my-bucket"`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The full resource name of the bucket to update.
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/locations/global/buckets/my-bucket"`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The full resource name of the bucket to update.
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/locations/global/buckets/my-bucket"`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The full resource name of the bucket to update.
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/locations/global/buckets/my-bucket"`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The full resource name of the bucket to update.
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/locations/global/buckets/my-bucket"`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.logging.v2.LogBucket bucket_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogBucket, + com.google.logging.v2.LogBucket.Builder, + com.google.logging.v2.LogBucketOrBuilder> + bucketBuilder_; + + /** + * + * + *
+     * Required. The updated bucket.
+     * 
+ * + * .google.logging.v2.LogBucket bucket = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the bucket field is set. + */ + public boolean hasBucket() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Required. The updated bucket.
+     * 
+ * + * .google.logging.v2.LogBucket bucket = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The bucket. + */ + public com.google.logging.v2.LogBucket getBucket() { + if (bucketBuilder_ == null) { + return bucket_ == null ? com.google.logging.v2.LogBucket.getDefaultInstance() : bucket_; + } else { + return bucketBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. The updated bucket.
+     * 
+ * + * .google.logging.v2.LogBucket bucket = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBucket(com.google.logging.v2.LogBucket value) { + if (bucketBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + bucket_ = value; + } else { + bucketBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The updated bucket.
+     * 
+ * + * .google.logging.v2.LogBucket bucket = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setBucket(com.google.logging.v2.LogBucket.Builder builderForValue) { + if (bucketBuilder_ == null) { + bucket_ = builderForValue.build(); + } else { + bucketBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The updated bucket.
+     * 
+ * + * .google.logging.v2.LogBucket bucket = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeBucket(com.google.logging.v2.LogBucket value) { + if (bucketBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && bucket_ != null + && bucket_ != com.google.logging.v2.LogBucket.getDefaultInstance()) { + getBucketBuilder().mergeFrom(value); + } else { + bucket_ = value; + } + } else { + bucketBuilder_.mergeFrom(value); + } + if (bucket_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. The updated bucket.
+     * 
+ * + * .google.logging.v2.LogBucket bucket = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearBucket() { + bitField0_ = (bitField0_ & ~0x00000002); + bucket_ = null; + if (bucketBuilder_ != null) { + bucketBuilder_.dispose(); + bucketBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The updated bucket.
+     * 
+ * + * .google.logging.v2.LogBucket bucket = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.logging.v2.LogBucket.Builder getBucketBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getBucketFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. The updated bucket.
+     * 
+ * + * .google.logging.v2.LogBucket bucket = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.logging.v2.LogBucketOrBuilder getBucketOrBuilder() { + if (bucketBuilder_ != null) { + return bucketBuilder_.getMessageOrBuilder(); + } else { + return bucket_ == null ? com.google.logging.v2.LogBucket.getDefaultInstance() : bucket_; + } + } + + /** + * + * + *
+     * Required. The updated bucket.
+     * 
+ * + * .google.logging.v2.LogBucket bucket = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogBucket, + com.google.logging.v2.LogBucket.Builder, + com.google.logging.v2.LogBucketOrBuilder> + getBucketFieldBuilder() { + if (bucketBuilder_ == null) { + bucketBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogBucket, + com.google.logging.v2.LogBucket.Builder, + com.google.logging.v2.LogBucketOrBuilder>( + getBucket(), getParentForChildren(), isClean()); + bucket_ = null; + } + return bucketBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + + /** + * + * + *
+     * Required. Field mask that specifies the fields in `bucket` that need an
+     * update. A bucket field will be overwritten if, and only if, it is in the
+     * update mask. `name` and output only fields cannot be updated.
+     *
+     * For a detailed `FieldMask` definition, see:
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
+     *
+     * For example: `updateMask=retention_days`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Required. Field mask that specifies the fields in `bucket` that need an
+     * update. A bucket field will be overwritten if, and only if, it is in the
+     * update mask. `name` and output only fields cannot be updated.
+     *
+     * For a detailed `FieldMask` definition, see:
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
+     *
+     * For example: `updateMask=retention_days`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. Field mask that specifies the fields in `bucket` that need an
+     * update. A bucket field will be overwritten if, and only if, it is in the
+     * update mask. `name` and output only fields cannot be updated.
+     *
+     * For a detailed `FieldMask` definition, see:
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
+     *
+     * For example: `updateMask=retention_days`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Field mask that specifies the fields in `bucket` that need an
+     * update. A bucket field will be overwritten if, and only if, it is in the
+     * update mask. `name` and output only fields cannot be updated.
+     *
+     * For a detailed `FieldMask` definition, see:
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
+     *
+     * For example: `updateMask=retention_days`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Field mask that specifies the fields in `bucket` that need an
+     * update. A bucket field will be overwritten if, and only if, it is in the
+     * update mask. `name` and output only fields cannot be updated.
+     *
+     * For a detailed `FieldMask` definition, see:
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
+     *
+     * For example: `updateMask=retention_days`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + if (updateMask_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. Field mask that specifies the fields in `bucket` that need an
+     * update. A bucket field will be overwritten if, and only if, it is in the
+     * update mask. `name` and output only fields cannot be updated.
+     *
+     * For a detailed `FieldMask` definition, see:
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
+     *
+     * For example: `updateMask=retention_days`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000004); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. Field mask that specifies the fields in `bucket` that need an
+     * update. A bucket field will be overwritten if, and only if, it is in the
+     * update mask. `name` and output only fields cannot be updated.
+     *
+     * For a detailed `FieldMask` definition, see:
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
+     *
+     * For example: `updateMask=retention_days`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. Field mask that specifies the fields in `bucket` that need an
+     * update. A bucket field will be overwritten if, and only if, it is in the
+     * update mask. `name` and output only fields cannot be updated.
+     *
+     * For a detailed `FieldMask` definition, see:
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
+     *
+     * For example: `updateMask=retention_days`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + + /** + * + * + *
+     * Required. Field mask that specifies the fields in `bucket` that need an
+     * update. A bucket field will be overwritten if, and only if, it is in the
+     * update mask. `name` and output only fields cannot be updated.
+     *
+     * For a detailed `FieldMask` definition, see:
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
+     *
+     * For example: `updateMask=retention_days`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.logging.v2.UpdateBucketRequest) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.UpdateBucketRequest) + private static final com.google.logging.v2.UpdateBucketRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.UpdateBucketRequest(); + } + + public static com.google.logging.v2.UpdateBucketRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateBucketRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.UpdateBucketRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateBucketRequestOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateBucketRequestOrBuilder.java new file mode 100644 index 000000000000..b05202d9dcd8 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateBucketRequestOrBuilder.java @@ -0,0 +1,172 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface UpdateBucketRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.UpdateBucketRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The full resource name of the bucket to update.
+   *
+   *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *
+   * For example:
+   *
+   *   `"projects/my-project/locations/global/buckets/my-bucket"`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Required. The full resource name of the bucket to update.
+   *
+   *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *     "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
+   *
+   * For example:
+   *
+   *   `"projects/my-project/locations/global/buckets/my-bucket"`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. The updated bucket.
+   * 
+ * + * .google.logging.v2.LogBucket bucket = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the bucket field is set. + */ + boolean hasBucket(); + + /** + * + * + *
+   * Required. The updated bucket.
+   * 
+ * + * .google.logging.v2.LogBucket bucket = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bucket. + */ + com.google.logging.v2.LogBucket getBucket(); + + /** + * + * + *
+   * Required. The updated bucket.
+   * 
+ * + * .google.logging.v2.LogBucket bucket = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + com.google.logging.v2.LogBucketOrBuilder getBucketOrBuilder(); + + /** + * + * + *
+   * Required. Field mask that specifies the fields in `bucket` that need an
+   * update. A bucket field will be overwritten if, and only if, it is in the
+   * update mask. `name` and output only fields cannot be updated.
+   *
+   * For a detailed `FieldMask` definition, see:
+   * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
+   *
+   * For example: `updateMask=retention_days`
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + + /** + * + * + *
+   * Required. Field mask that specifies the fields in `bucket` that need an
+   * update. A bucket field will be overwritten if, and only if, it is in the
+   * update mask. `name` and output only fields cannot be updated.
+   *
+   * For a detailed `FieldMask` definition, see:
+   * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
+   *
+   * For example: `updateMask=retention_days`
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + + /** + * + * + *
+   * Required. Field mask that specifies the fields in `bucket` that need an
+   * update. A bucket field will be overwritten if, and only if, it is in the
+   * update mask. `name` and output only fields cannot be updated.
+   *
+   * For a detailed `FieldMask` definition, see:
+   * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
+   *
+   * For example: `updateMask=retention_days`
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateCmekSettingsRequest.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateCmekSettingsRequest.java new file mode 100644 index 000000000000..dc4d73991ed9 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateCmekSettingsRequest.java @@ -0,0 +1,1459 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * The parameters to
+ * [UpdateCmekSettings][google.logging.v2.ConfigServiceV2.UpdateCmekSettings].
+ *
+ * See [Enabling CMEK for Log
+ * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for
+ * more information.
+ * 
+ * + * Protobuf type {@code google.logging.v2.UpdateCmekSettingsRequest} + */ +public final class UpdateCmekSettingsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.UpdateCmekSettingsRequest) + UpdateCmekSettingsRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use UpdateCmekSettingsRequest.newBuilder() to construct. + private UpdateCmekSettingsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateCmekSettingsRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateCmekSettingsRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_UpdateCmekSettingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_UpdateCmekSettingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.UpdateCmekSettingsRequest.class, + com.google.logging.v2.UpdateCmekSettingsRequest.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. The resource name for the CMEK settings to update.
+   *
+   *     "projects/[PROJECT_ID]/cmekSettings"
+   *     "organizations/[ORGANIZATION_ID]/cmekSettings"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings"
+   *     "folders/[FOLDER_ID]/cmekSettings"
+   *
+   * For example:
+   *
+   *   `"organizations/12345/cmekSettings"`
+   *
+   * Note: CMEK for the Log Router can currently only be configured for Google
+   * Cloud organizations. Once configured, it applies to all projects and
+   * folders in the Google Cloud organization.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The resource name for the CMEK settings to update.
+   *
+   *     "projects/[PROJECT_ID]/cmekSettings"
+   *     "organizations/[ORGANIZATION_ID]/cmekSettings"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings"
+   *     "folders/[FOLDER_ID]/cmekSettings"
+   *
+   * For example:
+   *
+   *   `"organizations/12345/cmekSettings"`
+   *
+   * Note: CMEK for the Log Router can currently only be configured for Google
+   * Cloud organizations. Once configured, it applies to all projects and
+   * folders in the Google Cloud organization.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CMEK_SETTINGS_FIELD_NUMBER = 2; + private com.google.logging.v2.CmekSettings cmekSettings_; + + /** + * + * + *
+   * Required. The CMEK settings to update.
+   *
+   * See [Enabling CMEK for Log
+   * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+   * for more information.
+   * 
+ * + * + * .google.logging.v2.CmekSettings cmek_settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the cmekSettings field is set. + */ + @java.lang.Override + public boolean hasCmekSettings() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Required. The CMEK settings to update.
+   *
+   * See [Enabling CMEK for Log
+   * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+   * for more information.
+   * 
+ * + * + * .google.logging.v2.CmekSettings cmek_settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The cmekSettings. + */ + @java.lang.Override + public com.google.logging.v2.CmekSettings getCmekSettings() { + return cmekSettings_ == null + ? com.google.logging.v2.CmekSettings.getDefaultInstance() + : cmekSettings_; + } + + /** + * + * + *
+   * Required. The CMEK settings to update.
+   *
+   * See [Enabling CMEK for Log
+   * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+   * for more information.
+   * 
+ * + * + * .google.logging.v2.CmekSettings cmek_settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.logging.v2.CmekSettingsOrBuilder getCmekSettingsOrBuilder() { + return cmekSettings_ == null + ? com.google.logging.v2.CmekSettings.getDefaultInstance() + : cmekSettings_; + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 3; + private com.google.protobuf.FieldMask updateMask_; + + /** + * + * + *
+   * Optional. Field mask identifying which fields from `cmek_settings` should
+   * be updated. A field will be overwritten if and only if it is in the update
+   * mask. Output only fields cannot be updated.
+   *
+   * See [FieldMask][google.protobuf.FieldMask] for more information.
+   *
+   * For example: `"updateMask=kmsKeyName"`
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Optional. Field mask identifying which fields from `cmek_settings` should
+   * be updated. A field will be overwritten if and only if it is in the update
+   * mask. Output only fields cannot be updated.
+   *
+   * See [FieldMask][google.protobuf.FieldMask] for more information.
+   *
+   * For example: `"updateMask=kmsKeyName"`
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + /** + * + * + *
+   * Optional. Field mask identifying which fields from `cmek_settings` should
+   * be updated. A field will be overwritten if and only if it is in the update
+   * mask. Output only fields cannot be updated.
+   *
+   * See [FieldMask][google.protobuf.FieldMask] for more information.
+   *
+   * For example: `"updateMask=kmsKeyName"`
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getCmekSettings()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getUpdateMask()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getCmekSettings()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getUpdateMask()); + } + size += getUnknownFields().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.logging.v2.UpdateCmekSettingsRequest)) { + return super.equals(obj); + } + com.google.logging.v2.UpdateCmekSettingsRequest other = + (com.google.logging.v2.UpdateCmekSettingsRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (hasCmekSettings() != other.hasCmekSettings()) return false; + if (hasCmekSettings()) { + if (!getCmekSettings().equals(other.getCmekSettings())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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 (hasCmekSettings()) { + hash = (37 * hash) + CMEK_SETTINGS_FIELD_NUMBER; + hash = (53 * hash) + getCmekSettings().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.UpdateCmekSettingsRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.UpdateCmekSettingsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.UpdateCmekSettingsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.UpdateCmekSettingsRequest 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.logging.v2.UpdateCmekSettingsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.UpdateCmekSettingsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.UpdateCmekSettingsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.UpdateCmekSettingsRequest 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.logging.v2.UpdateCmekSettingsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.UpdateCmekSettingsRequest 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.logging.v2.UpdateCmekSettingsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.UpdateCmekSettingsRequest 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.logging.v2.UpdateCmekSettingsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The parameters to
+   * [UpdateCmekSettings][google.logging.v2.ConfigServiceV2.UpdateCmekSettings].
+   *
+   * See [Enabling CMEK for Log
+   * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for
+   * more information.
+   * 
+ * + * Protobuf type {@code google.logging.v2.UpdateCmekSettingsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.UpdateCmekSettingsRequest) + com.google.logging.v2.UpdateCmekSettingsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_UpdateCmekSettingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_UpdateCmekSettingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.UpdateCmekSettingsRequest.class, + com.google.logging.v2.UpdateCmekSettingsRequest.Builder.class); + } + + // Construct using com.google.logging.v2.UpdateCmekSettingsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getCmekSettingsFieldBuilder(); + getUpdateMaskFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + cmekSettings_ = null; + if (cmekSettingsBuilder_ != null) { + cmekSettingsBuilder_.dispose(); + cmekSettingsBuilder_ = null; + } + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_UpdateCmekSettingsRequest_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.UpdateCmekSettingsRequest getDefaultInstanceForType() { + return com.google.logging.v2.UpdateCmekSettingsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.UpdateCmekSettingsRequest build() { + com.google.logging.v2.UpdateCmekSettingsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.UpdateCmekSettingsRequest buildPartial() { + com.google.logging.v2.UpdateCmekSettingsRequest result = + new com.google.logging.v2.UpdateCmekSettingsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.logging.v2.UpdateCmekSettingsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.cmekSettings_ = + cmekSettingsBuilder_ == null ? cmekSettings_ : cmekSettingsBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @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.logging.v2.UpdateCmekSettingsRequest) { + return mergeFrom((com.google.logging.v2.UpdateCmekSettingsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.UpdateCmekSettingsRequest other) { + if (other == com.google.logging.v2.UpdateCmekSettingsRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasCmekSettings()) { + mergeCmekSettings(other.getCmekSettings()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getCmekSettingsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. The resource name for the CMEK settings to update.
+     *
+     *     "projects/[PROJECT_ID]/cmekSettings"
+     *     "organizations/[ORGANIZATION_ID]/cmekSettings"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings"
+     *     "folders/[FOLDER_ID]/cmekSettings"
+     *
+     * For example:
+     *
+     *   `"organizations/12345/cmekSettings"`
+     *
+     * Note: CMEK for the Log Router can currently only be configured for Google
+     * Cloud organizations. Once configured, it applies to all projects and
+     * folders in the Google Cloud organization.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The resource name for the CMEK settings to update.
+     *
+     *     "projects/[PROJECT_ID]/cmekSettings"
+     *     "organizations/[ORGANIZATION_ID]/cmekSettings"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings"
+     *     "folders/[FOLDER_ID]/cmekSettings"
+     *
+     * For example:
+     *
+     *   `"organizations/12345/cmekSettings"`
+     *
+     * Note: CMEK for the Log Router can currently only be configured for Google
+     * Cloud organizations. Once configured, it applies to all projects and
+     * folders in the Google Cloud organization.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The resource name for the CMEK settings to update.
+     *
+     *     "projects/[PROJECT_ID]/cmekSettings"
+     *     "organizations/[ORGANIZATION_ID]/cmekSettings"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings"
+     *     "folders/[FOLDER_ID]/cmekSettings"
+     *
+     * For example:
+     *
+     *   `"organizations/12345/cmekSettings"`
+     *
+     * Note: CMEK for the Log Router can currently only be configured for Google
+     * Cloud organizations. Once configured, it applies to all projects and
+     * folders in the Google Cloud organization.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The resource name for the CMEK settings to update.
+     *
+     *     "projects/[PROJECT_ID]/cmekSettings"
+     *     "organizations/[ORGANIZATION_ID]/cmekSettings"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings"
+     *     "folders/[FOLDER_ID]/cmekSettings"
+     *
+     * For example:
+     *
+     *   `"organizations/12345/cmekSettings"`
+     *
+     * Note: CMEK for the Log Router can currently only be configured for Google
+     * Cloud organizations. Once configured, it applies to all projects and
+     * folders in the Google Cloud organization.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The resource name for the CMEK settings to update.
+     *
+     *     "projects/[PROJECT_ID]/cmekSettings"
+     *     "organizations/[ORGANIZATION_ID]/cmekSettings"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings"
+     *     "folders/[FOLDER_ID]/cmekSettings"
+     *
+     * For example:
+     *
+     *   `"organizations/12345/cmekSettings"`
+     *
+     * Note: CMEK for the Log Router can currently only be configured for Google
+     * Cloud organizations. Once configured, it applies to all projects and
+     * folders in the Google Cloud organization.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.logging.v2.CmekSettings cmekSettings_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.CmekSettings, + com.google.logging.v2.CmekSettings.Builder, + com.google.logging.v2.CmekSettingsOrBuilder> + cmekSettingsBuilder_; + + /** + * + * + *
+     * Required. The CMEK settings to update.
+     *
+     * See [Enabling CMEK for Log
+     * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+     * for more information.
+     * 
+ * + * + * .google.logging.v2.CmekSettings cmek_settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the cmekSettings field is set. + */ + public boolean hasCmekSettings() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Required. The CMEK settings to update.
+     *
+     * See [Enabling CMEK for Log
+     * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+     * for more information.
+     * 
+ * + * + * .google.logging.v2.CmekSettings cmek_settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The cmekSettings. + */ + public com.google.logging.v2.CmekSettings getCmekSettings() { + if (cmekSettingsBuilder_ == null) { + return cmekSettings_ == null + ? com.google.logging.v2.CmekSettings.getDefaultInstance() + : cmekSettings_; + } else { + return cmekSettingsBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. The CMEK settings to update.
+     *
+     * See [Enabling CMEK for Log
+     * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+     * for more information.
+     * 
+ * + * + * .google.logging.v2.CmekSettings cmek_settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCmekSettings(com.google.logging.v2.CmekSettings value) { + if (cmekSettingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + cmekSettings_ = value; + } else { + cmekSettingsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The CMEK settings to update.
+     *
+     * See [Enabling CMEK for Log
+     * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+     * for more information.
+     * 
+ * + * + * .google.logging.v2.CmekSettings cmek_settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCmekSettings(com.google.logging.v2.CmekSettings.Builder builderForValue) { + if (cmekSettingsBuilder_ == null) { + cmekSettings_ = builderForValue.build(); + } else { + cmekSettingsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The CMEK settings to update.
+     *
+     * See [Enabling CMEK for Log
+     * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+     * for more information.
+     * 
+ * + * + * .google.logging.v2.CmekSettings cmek_settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeCmekSettings(com.google.logging.v2.CmekSettings value) { + if (cmekSettingsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && cmekSettings_ != null + && cmekSettings_ != com.google.logging.v2.CmekSettings.getDefaultInstance()) { + getCmekSettingsBuilder().mergeFrom(value); + } else { + cmekSettings_ = value; + } + } else { + cmekSettingsBuilder_.mergeFrom(value); + } + if (cmekSettings_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. The CMEK settings to update.
+     *
+     * See [Enabling CMEK for Log
+     * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+     * for more information.
+     * 
+ * + * + * .google.logging.v2.CmekSettings cmek_settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearCmekSettings() { + bitField0_ = (bitField0_ & ~0x00000002); + cmekSettings_ = null; + if (cmekSettingsBuilder_ != null) { + cmekSettingsBuilder_.dispose(); + cmekSettingsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The CMEK settings to update.
+     *
+     * See [Enabling CMEK for Log
+     * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+     * for more information.
+     * 
+ * + * + * .google.logging.v2.CmekSettings cmek_settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.logging.v2.CmekSettings.Builder getCmekSettingsBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getCmekSettingsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. The CMEK settings to update.
+     *
+     * See [Enabling CMEK for Log
+     * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+     * for more information.
+     * 
+ * + * + * .google.logging.v2.CmekSettings cmek_settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.logging.v2.CmekSettingsOrBuilder getCmekSettingsOrBuilder() { + if (cmekSettingsBuilder_ != null) { + return cmekSettingsBuilder_.getMessageOrBuilder(); + } else { + return cmekSettings_ == null + ? com.google.logging.v2.CmekSettings.getDefaultInstance() + : cmekSettings_; + } + } + + /** + * + * + *
+     * Required. The CMEK settings to update.
+     *
+     * See [Enabling CMEK for Log
+     * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+     * for more information.
+     * 
+ * + * + * .google.logging.v2.CmekSettings cmek_settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.CmekSettings, + com.google.logging.v2.CmekSettings.Builder, + com.google.logging.v2.CmekSettingsOrBuilder> + getCmekSettingsFieldBuilder() { + if (cmekSettingsBuilder_ == null) { + cmekSettingsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.CmekSettings, + com.google.logging.v2.CmekSettings.Builder, + com.google.logging.v2.CmekSettingsOrBuilder>( + getCmekSettings(), getParentForChildren(), isClean()); + cmekSettings_ = null; + } + return cmekSettingsBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + + /** + * + * + *
+     * Optional. Field mask identifying which fields from `cmek_settings` should
+     * be updated. A field will be overwritten if and only if it is in the update
+     * mask. Output only fields cannot be updated.
+     *
+     * See [FieldMask][google.protobuf.FieldMask] for more information.
+     *
+     * For example: `"updateMask=kmsKeyName"`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Optional. Field mask identifying which fields from `cmek_settings` should
+     * be updated. A field will be overwritten if and only if it is in the update
+     * mask. Output only fields cannot be updated.
+     *
+     * See [FieldMask][google.protobuf.FieldMask] for more information.
+     *
+     * For example: `"updateMask=kmsKeyName"`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. Field mask identifying which fields from `cmek_settings` should
+     * be updated. A field will be overwritten if and only if it is in the update
+     * mask. Output only fields cannot be updated.
+     *
+     * See [FieldMask][google.protobuf.FieldMask] for more information.
+     *
+     * For example: `"updateMask=kmsKeyName"`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Field mask identifying which fields from `cmek_settings` should
+     * be updated. A field will be overwritten if and only if it is in the update
+     * mask. Output only fields cannot be updated.
+     *
+     * See [FieldMask][google.protobuf.FieldMask] for more information.
+     *
+     * For example: `"updateMask=kmsKeyName"`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Field mask identifying which fields from `cmek_settings` should
+     * be updated. A field will be overwritten if and only if it is in the update
+     * mask. Output only fields cannot be updated.
+     *
+     * See [FieldMask][google.protobuf.FieldMask] for more information.
+     *
+     * For example: `"updateMask=kmsKeyName"`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + if (updateMask_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. Field mask identifying which fields from `cmek_settings` should
+     * be updated. A field will be overwritten if and only if it is in the update
+     * mask. Output only fields cannot be updated.
+     *
+     * See [FieldMask][google.protobuf.FieldMask] for more information.
+     *
+     * For example: `"updateMask=kmsKeyName"`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000004); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Field mask identifying which fields from `cmek_settings` should
+     * be updated. A field will be overwritten if and only if it is in the update
+     * mask. Output only fields cannot be updated.
+     *
+     * See [FieldMask][google.protobuf.FieldMask] for more information.
+     *
+     * For example: `"updateMask=kmsKeyName"`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. Field mask identifying which fields from `cmek_settings` should
+     * be updated. A field will be overwritten if and only if it is in the update
+     * mask. Output only fields cannot be updated.
+     *
+     * See [FieldMask][google.protobuf.FieldMask] for more information.
+     *
+     * For example: `"updateMask=kmsKeyName"`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + + /** + * + * + *
+     * Optional. Field mask identifying which fields from `cmek_settings` should
+     * be updated. A field will be overwritten if and only if it is in the update
+     * mask. Output only fields cannot be updated.
+     *
+     * See [FieldMask][google.protobuf.FieldMask] for more information.
+     *
+     * For example: `"updateMask=kmsKeyName"`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.logging.v2.UpdateCmekSettingsRequest) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.UpdateCmekSettingsRequest) + private static final com.google.logging.v2.UpdateCmekSettingsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.UpdateCmekSettingsRequest(); + } + + public static com.google.logging.v2.UpdateCmekSettingsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateCmekSettingsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.UpdateCmekSettingsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateCmekSettingsRequestOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateCmekSettingsRequestOrBuilder.java new file mode 100644 index 000000000000..9ad851e2bd43 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateCmekSettingsRequestOrBuilder.java @@ -0,0 +1,191 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface UpdateCmekSettingsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.UpdateCmekSettingsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name for the CMEK settings to update.
+   *
+   *     "projects/[PROJECT_ID]/cmekSettings"
+   *     "organizations/[ORGANIZATION_ID]/cmekSettings"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings"
+   *     "folders/[FOLDER_ID]/cmekSettings"
+   *
+   * For example:
+   *
+   *   `"organizations/12345/cmekSettings"`
+   *
+   * Note: CMEK for the Log Router can currently only be configured for Google
+   * Cloud organizations. Once configured, it applies to all projects and
+   * folders in the Google Cloud organization.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Required. The resource name for the CMEK settings to update.
+   *
+   *     "projects/[PROJECT_ID]/cmekSettings"
+   *     "organizations/[ORGANIZATION_ID]/cmekSettings"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings"
+   *     "folders/[FOLDER_ID]/cmekSettings"
+   *
+   * For example:
+   *
+   *   `"organizations/12345/cmekSettings"`
+   *
+   * Note: CMEK for the Log Router can currently only be configured for Google
+   * Cloud organizations. Once configured, it applies to all projects and
+   * folders in the Google Cloud organization.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. The CMEK settings to update.
+   *
+   * See [Enabling CMEK for Log
+   * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+   * for more information.
+   * 
+ * + * + * .google.logging.v2.CmekSettings cmek_settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the cmekSettings field is set. + */ + boolean hasCmekSettings(); + + /** + * + * + *
+   * Required. The CMEK settings to update.
+   *
+   * See [Enabling CMEK for Log
+   * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+   * for more information.
+   * 
+ * + * + * .google.logging.v2.CmekSettings cmek_settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The cmekSettings. + */ + com.google.logging.v2.CmekSettings getCmekSettings(); + + /** + * + * + *
+   * Required. The CMEK settings to update.
+   *
+   * See [Enabling CMEK for Log
+   * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+   * for more information.
+   * 
+ * + * + * .google.logging.v2.CmekSettings cmek_settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.logging.v2.CmekSettingsOrBuilder getCmekSettingsOrBuilder(); + + /** + * + * + *
+   * Optional. Field mask identifying which fields from `cmek_settings` should
+   * be updated. A field will be overwritten if and only if it is in the update
+   * mask. Output only fields cannot be updated.
+   *
+   * See [FieldMask][google.protobuf.FieldMask] for more information.
+   *
+   * For example: `"updateMask=kmsKeyName"`
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + + /** + * + * + *
+   * Optional. Field mask identifying which fields from `cmek_settings` should
+   * be updated. A field will be overwritten if and only if it is in the update
+   * mask. Output only fields cannot be updated.
+   *
+   * See [FieldMask][google.protobuf.FieldMask] for more information.
+   *
+   * For example: `"updateMask=kmsKeyName"`
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + + /** + * + * + *
+   * Optional. Field mask identifying which fields from `cmek_settings` should
+   * be updated. A field will be overwritten if and only if it is in the update
+   * mask. Output only fields cannot be updated.
+   *
+   * See [FieldMask][google.protobuf.FieldMask] for more information.
+   *
+   * For example: `"updateMask=kmsKeyName"`
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateExclusionRequest.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateExclusionRequest.java new file mode 100644 index 000000000000..70787bae213b --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateExclusionRequest.java @@ -0,0 +1,1406 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * The parameters to `UpdateExclusion`.
+ * 
+ * + * Protobuf type {@code google.logging.v2.UpdateExclusionRequest} + */ +public final class UpdateExclusionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.UpdateExclusionRequest) + UpdateExclusionRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use UpdateExclusionRequest.newBuilder() to construct. + private UpdateExclusionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateExclusionRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateExclusionRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_UpdateExclusionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_UpdateExclusionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.UpdateExclusionRequest.class, + com.google.logging.v2.UpdateExclusionRequest.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. The resource name of the exclusion to update:
+   *
+   *     "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
+   *     "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
+   *     "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
+   *
+   * For example:
+   *
+   *   `"projects/my-project/exclusions/my-exclusion"`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The resource name of the exclusion to update:
+   *
+   *     "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
+   *     "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
+   *     "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
+   *
+   * For example:
+   *
+   *   `"projects/my-project/exclusions/my-exclusion"`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EXCLUSION_FIELD_NUMBER = 2; + private com.google.logging.v2.LogExclusion exclusion_; + + /** + * + * + *
+   * Required. New values for the existing exclusion. Only the fields specified
+   * in `update_mask` are relevant.
+   * 
+ * + * .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the exclusion field is set. + */ + @java.lang.Override + public boolean hasExclusion() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Required. New values for the existing exclusion. Only the fields specified
+   * in `update_mask` are relevant.
+   * 
+ * + * .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The exclusion. + */ + @java.lang.Override + public com.google.logging.v2.LogExclusion getExclusion() { + return exclusion_ == null + ? com.google.logging.v2.LogExclusion.getDefaultInstance() + : exclusion_; + } + + /** + * + * + *
+   * Required. New values for the existing exclusion. Only the fields specified
+   * in `update_mask` are relevant.
+   * 
+ * + * .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.logging.v2.LogExclusionOrBuilder getExclusionOrBuilder() { + return exclusion_ == null + ? com.google.logging.v2.LogExclusion.getDefaultInstance() + : exclusion_; + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 3; + private com.google.protobuf.FieldMask updateMask_; + + /** + * + * + *
+   * Required. A non-empty list of fields to change in the existing exclusion.
+   * New values for the fields are taken from the corresponding fields in the
+   * [LogExclusion][google.logging.v2.LogExclusion] included in this request.
+   * Fields not mentioned in `update_mask` are not changed and are ignored in
+   * the request.
+   *
+   * For example, to change the filter and description of an exclusion,
+   * specify an `update_mask` of `"filter,description"`.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Required. A non-empty list of fields to change in the existing exclusion.
+   * New values for the fields are taken from the corresponding fields in the
+   * [LogExclusion][google.logging.v2.LogExclusion] included in this request.
+   * Fields not mentioned in `update_mask` are not changed and are ignored in
+   * the request.
+   *
+   * For example, to change the filter and description of an exclusion,
+   * specify an `update_mask` of `"filter,description"`.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + /** + * + * + *
+   * Required. A non-empty list of fields to change in the existing exclusion.
+   * New values for the fields are taken from the corresponding fields in the
+   * [LogExclusion][google.logging.v2.LogExclusion] included in this request.
+   * Fields not mentioned in `update_mask` are not changed and are ignored in
+   * the request.
+   *
+   * For example, to change the filter and description of an exclusion,
+   * specify an `update_mask` of `"filter,description"`.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getExclusion()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getUpdateMask()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getExclusion()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getUpdateMask()); + } + size += getUnknownFields().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.logging.v2.UpdateExclusionRequest)) { + return super.equals(obj); + } + com.google.logging.v2.UpdateExclusionRequest other = + (com.google.logging.v2.UpdateExclusionRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (hasExclusion() != other.hasExclusion()) return false; + if (hasExclusion()) { + if (!getExclusion().equals(other.getExclusion())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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 (hasExclusion()) { + hash = (37 * hash) + EXCLUSION_FIELD_NUMBER; + hash = (53 * hash) + getExclusion().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.UpdateExclusionRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.UpdateExclusionRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.UpdateExclusionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.UpdateExclusionRequest 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.logging.v2.UpdateExclusionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.UpdateExclusionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.UpdateExclusionRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.UpdateExclusionRequest 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.logging.v2.UpdateExclusionRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.UpdateExclusionRequest 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.logging.v2.UpdateExclusionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.UpdateExclusionRequest 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.logging.v2.UpdateExclusionRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The parameters to `UpdateExclusion`.
+   * 
+ * + * Protobuf type {@code google.logging.v2.UpdateExclusionRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.UpdateExclusionRequest) + com.google.logging.v2.UpdateExclusionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_UpdateExclusionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_UpdateExclusionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.UpdateExclusionRequest.class, + com.google.logging.v2.UpdateExclusionRequest.Builder.class); + } + + // Construct using com.google.logging.v2.UpdateExclusionRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getExclusionFieldBuilder(); + getUpdateMaskFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + exclusion_ = null; + if (exclusionBuilder_ != null) { + exclusionBuilder_.dispose(); + exclusionBuilder_ = null; + } + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_UpdateExclusionRequest_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.UpdateExclusionRequest getDefaultInstanceForType() { + return com.google.logging.v2.UpdateExclusionRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.UpdateExclusionRequest build() { + com.google.logging.v2.UpdateExclusionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.UpdateExclusionRequest buildPartial() { + com.google.logging.v2.UpdateExclusionRequest result = + new com.google.logging.v2.UpdateExclusionRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.logging.v2.UpdateExclusionRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.exclusion_ = exclusionBuilder_ == null ? exclusion_ : exclusionBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @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.logging.v2.UpdateExclusionRequest) { + return mergeFrom((com.google.logging.v2.UpdateExclusionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.UpdateExclusionRequest other) { + if (other == com.google.logging.v2.UpdateExclusionRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasExclusion()) { + mergeExclusion(other.getExclusion()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getExclusionFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. The resource name of the exclusion to update:
+     *
+     *     "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
+     *     "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
+     *     "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/exclusions/my-exclusion"`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The resource name of the exclusion to update:
+     *
+     *     "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
+     *     "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
+     *     "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/exclusions/my-exclusion"`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The resource name of the exclusion to update:
+     *
+     *     "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
+     *     "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
+     *     "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/exclusions/my-exclusion"`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The resource name of the exclusion to update:
+     *
+     *     "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
+     *     "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
+     *     "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/exclusions/my-exclusion"`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The resource name of the exclusion to update:
+     *
+     *     "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
+     *     "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
+     *     "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/exclusions/my-exclusion"`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.logging.v2.LogExclusion exclusion_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogExclusion, + com.google.logging.v2.LogExclusion.Builder, + com.google.logging.v2.LogExclusionOrBuilder> + exclusionBuilder_; + + /** + * + * + *
+     * Required. New values for the existing exclusion. Only the fields specified
+     * in `update_mask` are relevant.
+     * 
+ * + * + * .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the exclusion field is set. + */ + public boolean hasExclusion() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Required. New values for the existing exclusion. Only the fields specified
+     * in `update_mask` are relevant.
+     * 
+ * + * + * .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The exclusion. + */ + public com.google.logging.v2.LogExclusion getExclusion() { + if (exclusionBuilder_ == null) { + return exclusion_ == null + ? com.google.logging.v2.LogExclusion.getDefaultInstance() + : exclusion_; + } else { + return exclusionBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. New values for the existing exclusion. Only the fields specified
+     * in `update_mask` are relevant.
+     * 
+ * + * + * .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setExclusion(com.google.logging.v2.LogExclusion value) { + if (exclusionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + exclusion_ = value; + } else { + exclusionBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. New values for the existing exclusion. Only the fields specified
+     * in `update_mask` are relevant.
+     * 
+ * + * + * .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setExclusion(com.google.logging.v2.LogExclusion.Builder builderForValue) { + if (exclusionBuilder_ == null) { + exclusion_ = builderForValue.build(); + } else { + exclusionBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. New values for the existing exclusion. Only the fields specified
+     * in `update_mask` are relevant.
+     * 
+ * + * + * .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeExclusion(com.google.logging.v2.LogExclusion value) { + if (exclusionBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && exclusion_ != null + && exclusion_ != com.google.logging.v2.LogExclusion.getDefaultInstance()) { + getExclusionBuilder().mergeFrom(value); + } else { + exclusion_ = value; + } + } else { + exclusionBuilder_.mergeFrom(value); + } + if (exclusion_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. New values for the existing exclusion. Only the fields specified
+     * in `update_mask` are relevant.
+     * 
+ * + * + * .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearExclusion() { + bitField0_ = (bitField0_ & ~0x00000002); + exclusion_ = null; + if (exclusionBuilder_ != null) { + exclusionBuilder_.dispose(); + exclusionBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. New values for the existing exclusion. Only the fields specified
+     * in `update_mask` are relevant.
+     * 
+ * + * + * .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.logging.v2.LogExclusion.Builder getExclusionBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getExclusionFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. New values for the existing exclusion. Only the fields specified
+     * in `update_mask` are relevant.
+     * 
+ * + * + * .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.logging.v2.LogExclusionOrBuilder getExclusionOrBuilder() { + if (exclusionBuilder_ != null) { + return exclusionBuilder_.getMessageOrBuilder(); + } else { + return exclusion_ == null + ? com.google.logging.v2.LogExclusion.getDefaultInstance() + : exclusion_; + } + } + + /** + * + * + *
+     * Required. New values for the existing exclusion. Only the fields specified
+     * in `update_mask` are relevant.
+     * 
+ * + * + * .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogExclusion, + com.google.logging.v2.LogExclusion.Builder, + com.google.logging.v2.LogExclusionOrBuilder> + getExclusionFieldBuilder() { + if (exclusionBuilder_ == null) { + exclusionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogExclusion, + com.google.logging.v2.LogExclusion.Builder, + com.google.logging.v2.LogExclusionOrBuilder>( + getExclusion(), getParentForChildren(), isClean()); + exclusion_ = null; + } + return exclusionBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + + /** + * + * + *
+     * Required. A non-empty list of fields to change in the existing exclusion.
+     * New values for the fields are taken from the corresponding fields in the
+     * [LogExclusion][google.logging.v2.LogExclusion] included in this request.
+     * Fields not mentioned in `update_mask` are not changed and are ignored in
+     * the request.
+     *
+     * For example, to change the filter and description of an exclusion,
+     * specify an `update_mask` of `"filter,description"`.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Required. A non-empty list of fields to change in the existing exclusion.
+     * New values for the fields are taken from the corresponding fields in the
+     * [LogExclusion][google.logging.v2.LogExclusion] included in this request.
+     * Fields not mentioned in `update_mask` are not changed and are ignored in
+     * the request.
+     *
+     * For example, to change the filter and description of an exclusion,
+     * specify an `update_mask` of `"filter,description"`.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. A non-empty list of fields to change in the existing exclusion.
+     * New values for the fields are taken from the corresponding fields in the
+     * [LogExclusion][google.logging.v2.LogExclusion] included in this request.
+     * Fields not mentioned in `update_mask` are not changed and are ignored in
+     * the request.
+     *
+     * For example, to change the filter and description of an exclusion,
+     * specify an `update_mask` of `"filter,description"`.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. A non-empty list of fields to change in the existing exclusion.
+     * New values for the fields are taken from the corresponding fields in the
+     * [LogExclusion][google.logging.v2.LogExclusion] included in this request.
+     * Fields not mentioned in `update_mask` are not changed and are ignored in
+     * the request.
+     *
+     * For example, to change the filter and description of an exclusion,
+     * specify an `update_mask` of `"filter,description"`.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. A non-empty list of fields to change in the existing exclusion.
+     * New values for the fields are taken from the corresponding fields in the
+     * [LogExclusion][google.logging.v2.LogExclusion] included in this request.
+     * Fields not mentioned in `update_mask` are not changed and are ignored in
+     * the request.
+     *
+     * For example, to change the filter and description of an exclusion,
+     * specify an `update_mask` of `"filter,description"`.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + if (updateMask_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. A non-empty list of fields to change in the existing exclusion.
+     * New values for the fields are taken from the corresponding fields in the
+     * [LogExclusion][google.logging.v2.LogExclusion] included in this request.
+     * Fields not mentioned in `update_mask` are not changed and are ignored in
+     * the request.
+     *
+     * For example, to change the filter and description of an exclusion,
+     * specify an `update_mask` of `"filter,description"`.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000004); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. A non-empty list of fields to change in the existing exclusion.
+     * New values for the fields are taken from the corresponding fields in the
+     * [LogExclusion][google.logging.v2.LogExclusion] included in this request.
+     * Fields not mentioned in `update_mask` are not changed and are ignored in
+     * the request.
+     *
+     * For example, to change the filter and description of an exclusion,
+     * specify an `update_mask` of `"filter,description"`.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. A non-empty list of fields to change in the existing exclusion.
+     * New values for the fields are taken from the corresponding fields in the
+     * [LogExclusion][google.logging.v2.LogExclusion] included in this request.
+     * Fields not mentioned in `update_mask` are not changed and are ignored in
+     * the request.
+     *
+     * For example, to change the filter and description of an exclusion,
+     * specify an `update_mask` of `"filter,description"`.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + + /** + * + * + *
+     * Required. A non-empty list of fields to change in the existing exclusion.
+     * New values for the fields are taken from the corresponding fields in the
+     * [LogExclusion][google.logging.v2.LogExclusion] included in this request.
+     * Fields not mentioned in `update_mask` are not changed and are ignored in
+     * the request.
+     *
+     * For example, to change the filter and description of an exclusion,
+     * specify an `update_mask` of `"filter,description"`.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.logging.v2.UpdateExclusionRequest) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.UpdateExclusionRequest) + private static final com.google.logging.v2.UpdateExclusionRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.UpdateExclusionRequest(); + } + + public static com.google.logging.v2.UpdateExclusionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateExclusionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.UpdateExclusionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateExclusionRequestOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateExclusionRequestOrBuilder.java new file mode 100644 index 000000000000..bd6df6337883 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateExclusionRequestOrBuilder.java @@ -0,0 +1,178 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface UpdateExclusionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.UpdateExclusionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the exclusion to update:
+   *
+   *     "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
+   *     "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
+   *     "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
+   *
+   * For example:
+   *
+   *   `"projects/my-project/exclusions/my-exclusion"`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Required. The resource name of the exclusion to update:
+   *
+   *     "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
+   *     "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
+   *     "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
+   *
+   * For example:
+   *
+   *   `"projects/my-project/exclusions/my-exclusion"`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. New values for the existing exclusion. Only the fields specified
+   * in `update_mask` are relevant.
+   * 
+ * + * .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the exclusion field is set. + */ + boolean hasExclusion(); + + /** + * + * + *
+   * Required. New values for the existing exclusion. Only the fields specified
+   * in `update_mask` are relevant.
+   * 
+ * + * .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The exclusion. + */ + com.google.logging.v2.LogExclusion getExclusion(); + + /** + * + * + *
+   * Required. New values for the existing exclusion. Only the fields specified
+   * in `update_mask` are relevant.
+   * 
+ * + * .google.logging.v2.LogExclusion exclusion = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.logging.v2.LogExclusionOrBuilder getExclusionOrBuilder(); + + /** + * + * + *
+   * Required. A non-empty list of fields to change in the existing exclusion.
+   * New values for the fields are taken from the corresponding fields in the
+   * [LogExclusion][google.logging.v2.LogExclusion] included in this request.
+   * Fields not mentioned in `update_mask` are not changed and are ignored in
+   * the request.
+   *
+   * For example, to change the filter and description of an exclusion,
+   * specify an `update_mask` of `"filter,description"`.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + + /** + * + * + *
+   * Required. A non-empty list of fields to change in the existing exclusion.
+   * New values for the fields are taken from the corresponding fields in the
+   * [LogExclusion][google.logging.v2.LogExclusion] included in this request.
+   * Fields not mentioned in `update_mask` are not changed and are ignored in
+   * the request.
+   *
+   * For example, to change the filter and description of an exclusion,
+   * specify an `update_mask` of `"filter,description"`.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + + /** + * + * + *
+   * Required. A non-empty list of fields to change in the existing exclusion.
+   * New values for the fields are taken from the corresponding fields in the
+   * [LogExclusion][google.logging.v2.LogExclusion] included in this request.
+   * Fields not mentioned in `update_mask` are not changed and are ignored in
+   * the request.
+   *
+   * For example, to change the filter and description of an exclusion,
+   * specify an `update_mask` of `"filter,description"`.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateLogMetricRequest.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateLogMetricRequest.java new file mode 100644 index 000000000000..6c57aeca5c95 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateLogMetricRequest.java @@ -0,0 +1,981 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_metrics.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * The parameters to UpdateLogMetric.
+ * 
+ * + * Protobuf type {@code google.logging.v2.UpdateLogMetricRequest} + */ +public final class UpdateLogMetricRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.UpdateLogMetricRequest) + UpdateLogMetricRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use UpdateLogMetricRequest.newBuilder() to construct. + private UpdateLogMetricRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateLogMetricRequest() { + metricName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateLogMetricRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingMetricsProto + .internal_static_google_logging_v2_UpdateLogMetricRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingMetricsProto + .internal_static_google_logging_v2_UpdateLogMetricRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.UpdateLogMetricRequest.class, + com.google.logging.v2.UpdateLogMetricRequest.Builder.class); + } + + private int bitField0_; + public static final int METRIC_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object metricName_ = ""; + + /** + * + * + *
+   * Required. The resource name of the metric to update:
+   *
+   *     "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
+   *
+   * The updated metric must be provided in the request and it's
+   * `name` field must be the same as `[METRIC_ID]` If the metric
+   * does not exist in `[PROJECT_ID]`, then a new metric is created.
+   * 
+ * + * + * string metric_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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; + } + } + + /** + * + * + *
+   * Required. The resource name of the metric to update:
+   *
+   *     "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
+   *
+   * The updated metric must be provided in the request and it's
+   * `name` field must be the same as `[METRIC_ID]` If the metric
+   * does not exist in `[PROJECT_ID]`, then a new metric is created.
+   * 
+ * + * + * string metric_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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_FIELD_NUMBER = 2; + private com.google.logging.v2.LogMetric metric_; + + /** + * + * + *
+   * Required. The updated metric.
+   * 
+ * + * .google.logging.v2.LogMetric metric = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the metric field is set. + */ + @java.lang.Override + public boolean hasMetric() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Required. The updated metric.
+   * 
+ * + * .google.logging.v2.LogMetric metric = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The metric. + */ + @java.lang.Override + public com.google.logging.v2.LogMetric getMetric() { + return metric_ == null ? com.google.logging.v2.LogMetric.getDefaultInstance() : metric_; + } + + /** + * + * + *
+   * Required. The updated metric.
+   * 
+ * + * .google.logging.v2.LogMetric metric = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + @java.lang.Override + public com.google.logging.v2.LogMetricOrBuilder getMetricOrBuilder() { + return metric_ == null ? com.google.logging.v2.LogMetric.getDefaultInstance() : metric_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(metricName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, metricName_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getMetric()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(metricName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, metricName_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getMetric()); + } + size += getUnknownFields().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.logging.v2.UpdateLogMetricRequest)) { + return super.equals(obj); + } + com.google.logging.v2.UpdateLogMetricRequest other = + (com.google.logging.v2.UpdateLogMetricRequest) obj; + + if (!getMetricName().equals(other.getMetricName())) return false; + if (hasMetric() != other.hasMetric()) return false; + if (hasMetric()) { + if (!getMetric().equals(other.getMetric())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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 (hasMetric()) { + hash = (37 * hash) + METRIC_FIELD_NUMBER; + hash = (53 * hash) + getMetric().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.UpdateLogMetricRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.UpdateLogMetricRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.UpdateLogMetricRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.UpdateLogMetricRequest 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.logging.v2.UpdateLogMetricRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.UpdateLogMetricRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.UpdateLogMetricRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.UpdateLogMetricRequest 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.logging.v2.UpdateLogMetricRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.UpdateLogMetricRequest 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.logging.v2.UpdateLogMetricRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.UpdateLogMetricRequest 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.logging.v2.UpdateLogMetricRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The parameters to UpdateLogMetric.
+   * 
+ * + * Protobuf type {@code google.logging.v2.UpdateLogMetricRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.UpdateLogMetricRequest) + com.google.logging.v2.UpdateLogMetricRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingMetricsProto + .internal_static_google_logging_v2_UpdateLogMetricRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingMetricsProto + .internal_static_google_logging_v2_UpdateLogMetricRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.UpdateLogMetricRequest.class, + com.google.logging.v2.UpdateLogMetricRequest.Builder.class); + } + + // Construct using com.google.logging.v2.UpdateLogMetricRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getMetricFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + metricName_ = ""; + metric_ = null; + if (metricBuilder_ != null) { + metricBuilder_.dispose(); + metricBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingMetricsProto + .internal_static_google_logging_v2_UpdateLogMetricRequest_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.UpdateLogMetricRequest getDefaultInstanceForType() { + return com.google.logging.v2.UpdateLogMetricRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.UpdateLogMetricRequest build() { + com.google.logging.v2.UpdateLogMetricRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.UpdateLogMetricRequest buildPartial() { + com.google.logging.v2.UpdateLogMetricRequest result = + new com.google.logging.v2.UpdateLogMetricRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.logging.v2.UpdateLogMetricRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.metricName_ = metricName_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.metric_ = metricBuilder_ == null ? metric_ : metricBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @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.logging.v2.UpdateLogMetricRequest) { + return mergeFrom((com.google.logging.v2.UpdateLogMetricRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.UpdateLogMetricRequest other) { + if (other == com.google.logging.v2.UpdateLogMetricRequest.getDefaultInstance()) return this; + if (!other.getMetricName().isEmpty()) { + metricName_ = other.metricName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasMetric()) { + mergeMetric(other.getMetric()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + metricName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getMetricFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object metricName_ = ""; + + /** + * + * + *
+     * Required. The resource name of the metric to update:
+     *
+     *     "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
+     *
+     * The updated metric must be provided in the request and it's
+     * `name` field must be the same as `[METRIC_ID]` If the metric
+     * does not exist in `[PROJECT_ID]`, then a new metric is created.
+     * 
+ * + * + * string metric_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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; + } + } + + /** + * + * + *
+     * Required. The resource name of the metric to update:
+     *
+     *     "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
+     *
+     * The updated metric must be provided in the request and it's
+     * `name` field must be the same as `[METRIC_ID]` If the metric
+     * does not exist in `[PROJECT_ID]`, then a new metric is created.
+     * 
+ * + * + * string metric_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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; + } + } + + /** + * + * + *
+     * Required. The resource name of the metric to update:
+     *
+     *     "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
+     *
+     * The updated metric must be provided in the request and it's
+     * `name` field must be the same as `[METRIC_ID]` If the metric
+     * does not exist in `[PROJECT_ID]`, then a new metric is created.
+     * 
+ * + * + * string metric_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The resource name of the metric to update:
+     *
+     *     "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
+     *
+     * The updated metric must be provided in the request and it's
+     * `name` field must be the same as `[METRIC_ID]` If the metric
+     * does not exist in `[PROJECT_ID]`, then a new metric is created.
+     * 
+ * + * + * string metric_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearMetricName() { + metricName_ = getDefaultInstance().getMetricName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The resource name of the metric to update:
+     *
+     *     "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
+     *
+     * The updated metric must be provided in the request and it's
+     * `name` field must be the same as `[METRIC_ID]` If the metric
+     * does not exist in `[PROJECT_ID]`, then a new metric is created.
+     * 
+ * + * + * string metric_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.logging.v2.LogMetric metric_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogMetric, + com.google.logging.v2.LogMetric.Builder, + com.google.logging.v2.LogMetricOrBuilder> + metricBuilder_; + + /** + * + * + *
+     * Required. The updated metric.
+     * 
+ * + * .google.logging.v2.LogMetric metric = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the metric field is set. + */ + public boolean hasMetric() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Required. The updated metric.
+     * 
+ * + * .google.logging.v2.LogMetric metric = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The metric. + */ + public com.google.logging.v2.LogMetric getMetric() { + if (metricBuilder_ == null) { + return metric_ == null ? com.google.logging.v2.LogMetric.getDefaultInstance() : metric_; + } else { + return metricBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. The updated metric.
+     * 
+ * + * .google.logging.v2.LogMetric metric = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setMetric(com.google.logging.v2.LogMetric value) { + if (metricBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + metric_ = value; + } else { + metricBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The updated metric.
+     * 
+ * + * .google.logging.v2.LogMetric metric = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setMetric(com.google.logging.v2.LogMetric.Builder builderForValue) { + if (metricBuilder_ == null) { + metric_ = builderForValue.build(); + } else { + metricBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The updated metric.
+     * 
+ * + * .google.logging.v2.LogMetric metric = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeMetric(com.google.logging.v2.LogMetric value) { + if (metricBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && metric_ != null + && metric_ != com.google.logging.v2.LogMetric.getDefaultInstance()) { + getMetricBuilder().mergeFrom(value); + } else { + metric_ = value; + } + } else { + metricBuilder_.mergeFrom(value); + } + if (metric_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. The updated metric.
+     * 
+ * + * .google.logging.v2.LogMetric metric = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearMetric() { + bitField0_ = (bitField0_ & ~0x00000002); + metric_ = null; + if (metricBuilder_ != null) { + metricBuilder_.dispose(); + metricBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The updated metric.
+     * 
+ * + * .google.logging.v2.LogMetric metric = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.logging.v2.LogMetric.Builder getMetricBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getMetricFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. The updated metric.
+     * 
+ * + * .google.logging.v2.LogMetric metric = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.logging.v2.LogMetricOrBuilder getMetricOrBuilder() { + if (metricBuilder_ != null) { + return metricBuilder_.getMessageOrBuilder(); + } else { + return metric_ == null ? com.google.logging.v2.LogMetric.getDefaultInstance() : metric_; + } + } + + /** + * + * + *
+     * Required. The updated metric.
+     * 
+ * + * .google.logging.v2.LogMetric metric = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogMetric, + com.google.logging.v2.LogMetric.Builder, + com.google.logging.v2.LogMetricOrBuilder> + getMetricFieldBuilder() { + if (metricBuilder_ == null) { + metricBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogMetric, + com.google.logging.v2.LogMetric.Builder, + com.google.logging.v2.LogMetricOrBuilder>( + getMetric(), getParentForChildren(), isClean()); + metric_ = null; + } + return metricBuilder_; + } + + @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.logging.v2.UpdateLogMetricRequest) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.UpdateLogMetricRequest) + private static final com.google.logging.v2.UpdateLogMetricRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.UpdateLogMetricRequest(); + } + + public static com.google.logging.v2.UpdateLogMetricRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateLogMetricRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.UpdateLogMetricRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateLogMetricRequestOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateLogMetricRequestOrBuilder.java new file mode 100644 index 000000000000..7c931dc7e5b2 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateLogMetricRequestOrBuilder.java @@ -0,0 +1,105 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_metrics.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface UpdateLogMetricRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.UpdateLogMetricRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the metric to update:
+   *
+   *     "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
+   *
+   * The updated metric must be provided in the request and it's
+   * `name` field must be the same as `[METRIC_ID]` If the metric
+   * does not exist in `[PROJECT_ID]`, then a new metric is created.
+   * 
+ * + * + * string metric_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The metricName. + */ + java.lang.String getMetricName(); + + /** + * + * + *
+   * Required. The resource name of the metric to update:
+   *
+   *     "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
+   *
+   * The updated metric must be provided in the request and it's
+   * `name` field must be the same as `[METRIC_ID]` If the metric
+   * does not exist in `[PROJECT_ID]`, then a new metric is created.
+   * 
+ * + * + * string metric_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for metricName. + */ + com.google.protobuf.ByteString getMetricNameBytes(); + + /** + * + * + *
+   * Required. The updated metric.
+   * 
+ * + * .google.logging.v2.LogMetric metric = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the metric field is set. + */ + boolean hasMetric(); + + /** + * + * + *
+   * Required. The updated metric.
+   * 
+ * + * .google.logging.v2.LogMetric metric = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The metric. + */ + com.google.logging.v2.LogMetric getMetric(); + + /** + * + * + *
+   * Required. The updated metric.
+   * 
+ * + * .google.logging.v2.LogMetric metric = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + com.google.logging.v2.LogMetricOrBuilder getMetricOrBuilder(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateSettingsRequest.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateSettingsRequest.java new file mode 100644 index 000000000000..0cb0d4df2431 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateSettingsRequest.java @@ -0,0 +1,1416 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * The parameters to
+ * [UpdateSettings][google.logging.v2.ConfigServiceV2.UpdateSettings].
+ *
+ * See [Enabling CMEK for Log
+ * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for
+ * more information.
+ * 
+ * + * Protobuf type {@code google.logging.v2.UpdateSettingsRequest} + */ +public final class UpdateSettingsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.UpdateSettingsRequest) + UpdateSettingsRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use UpdateSettingsRequest.newBuilder() to construct. + private UpdateSettingsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateSettingsRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateSettingsRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_UpdateSettingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_UpdateSettingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.UpdateSettingsRequest.class, + com.google.logging.v2.UpdateSettingsRequest.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. The resource name for the settings to update.
+   *
+   *     "organizations/[ORGANIZATION_ID]/settings"
+   *
+   * For example:
+   *
+   *   `"organizations/12345/settings"`
+   *
+   * Note: Settings for the Log Router can currently only be configured for
+   * Google Cloud organizations. Once configured, it applies to all projects and
+   * folders in the Google Cloud organization.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The resource name for the settings to update.
+   *
+   *     "organizations/[ORGANIZATION_ID]/settings"
+   *
+   * For example:
+   *
+   *   `"organizations/12345/settings"`
+   *
+   * Note: Settings for the Log Router can currently only be configured for
+   * Google Cloud organizations. Once configured, it applies to all projects and
+   * folders in the Google Cloud organization.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SETTINGS_FIELD_NUMBER = 2; + private com.google.logging.v2.Settings settings_; + + /** + * + * + *
+   * Required. The settings to update.
+   *
+   * See [Enabling CMEK for Log
+   * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+   * for more information.
+   * 
+ * + * .google.logging.v2.Settings settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the settings field is set. + */ + @java.lang.Override + public boolean hasSettings() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Required. The settings to update.
+   *
+   * See [Enabling CMEK for Log
+   * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+   * for more information.
+   * 
+ * + * .google.logging.v2.Settings settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The settings. + */ + @java.lang.Override + public com.google.logging.v2.Settings getSettings() { + return settings_ == null ? com.google.logging.v2.Settings.getDefaultInstance() : settings_; + } + + /** + * + * + *
+   * Required. The settings to update.
+   *
+   * See [Enabling CMEK for Log
+   * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+   * for more information.
+   * 
+ * + * .google.logging.v2.Settings settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.logging.v2.SettingsOrBuilder getSettingsOrBuilder() { + return settings_ == null ? com.google.logging.v2.Settings.getDefaultInstance() : settings_; + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 3; + private com.google.protobuf.FieldMask updateMask_; + + /** + * + * + *
+   * Optional. Field mask identifying which fields from `settings` should
+   * be updated. A field will be overwritten if and only if it is in the update
+   * mask. Output only fields cannot be updated.
+   *
+   * See [FieldMask][google.protobuf.FieldMask] for more information.
+   *
+   * For example: `"updateMask=kmsKeyName"`
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Optional. Field mask identifying which fields from `settings` should
+   * be updated. A field will be overwritten if and only if it is in the update
+   * mask. Output only fields cannot be updated.
+   *
+   * See [FieldMask][google.protobuf.FieldMask] for more information.
+   *
+   * For example: `"updateMask=kmsKeyName"`
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + /** + * + * + *
+   * Optional. Field mask identifying which fields from `settings` should
+   * be updated. A field will be overwritten if and only if it is in the update
+   * mask. Output only fields cannot be updated.
+   *
+   * See [FieldMask][google.protobuf.FieldMask] for more information.
+   *
+   * For example: `"updateMask=kmsKeyName"`
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getSettings()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getUpdateMask()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getSettings()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getUpdateMask()); + } + size += getUnknownFields().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.logging.v2.UpdateSettingsRequest)) { + return super.equals(obj); + } + com.google.logging.v2.UpdateSettingsRequest other = + (com.google.logging.v2.UpdateSettingsRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (hasSettings() != other.hasSettings()) return false; + if (hasSettings()) { + if (!getSettings().equals(other.getSettings())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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 (hasSettings()) { + hash = (37 * hash) + SETTINGS_FIELD_NUMBER; + hash = (53 * hash) + getSettings().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.UpdateSettingsRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.UpdateSettingsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.UpdateSettingsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.UpdateSettingsRequest 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.logging.v2.UpdateSettingsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.UpdateSettingsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.UpdateSettingsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.UpdateSettingsRequest 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.logging.v2.UpdateSettingsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.UpdateSettingsRequest 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.logging.v2.UpdateSettingsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.UpdateSettingsRequest 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.logging.v2.UpdateSettingsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The parameters to
+   * [UpdateSettings][google.logging.v2.ConfigServiceV2.UpdateSettings].
+   *
+   * See [Enabling CMEK for Log
+   * Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for
+   * more information.
+   * 
+ * + * Protobuf type {@code google.logging.v2.UpdateSettingsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.UpdateSettingsRequest) + com.google.logging.v2.UpdateSettingsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_UpdateSettingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_UpdateSettingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.UpdateSettingsRequest.class, + com.google.logging.v2.UpdateSettingsRequest.Builder.class); + } + + // Construct using com.google.logging.v2.UpdateSettingsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getSettingsFieldBuilder(); + getUpdateMaskFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + settings_ = null; + if (settingsBuilder_ != null) { + settingsBuilder_.dispose(); + settingsBuilder_ = null; + } + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_UpdateSettingsRequest_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.UpdateSettingsRequest getDefaultInstanceForType() { + return com.google.logging.v2.UpdateSettingsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.UpdateSettingsRequest build() { + com.google.logging.v2.UpdateSettingsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.UpdateSettingsRequest buildPartial() { + com.google.logging.v2.UpdateSettingsRequest result = + new com.google.logging.v2.UpdateSettingsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.logging.v2.UpdateSettingsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.settings_ = settingsBuilder_ == null ? settings_ : settingsBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @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.logging.v2.UpdateSettingsRequest) { + return mergeFrom((com.google.logging.v2.UpdateSettingsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.UpdateSettingsRequest other) { + if (other == com.google.logging.v2.UpdateSettingsRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasSettings()) { + mergeSettings(other.getSettings()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getSettingsFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. The resource name for the settings to update.
+     *
+     *     "organizations/[ORGANIZATION_ID]/settings"
+     *
+     * For example:
+     *
+     *   `"organizations/12345/settings"`
+     *
+     * Note: Settings for the Log Router can currently only be configured for
+     * Google Cloud organizations. Once configured, it applies to all projects and
+     * folders in the Google Cloud organization.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The resource name for the settings to update.
+     *
+     *     "organizations/[ORGANIZATION_ID]/settings"
+     *
+     * For example:
+     *
+     *   `"organizations/12345/settings"`
+     *
+     * Note: Settings for the Log Router can currently only be configured for
+     * Google Cloud organizations. Once configured, it applies to all projects and
+     * folders in the Google Cloud organization.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The resource name for the settings to update.
+     *
+     *     "organizations/[ORGANIZATION_ID]/settings"
+     *
+     * For example:
+     *
+     *   `"organizations/12345/settings"`
+     *
+     * Note: Settings for the Log Router can currently only be configured for
+     * Google Cloud organizations. Once configured, it applies to all projects and
+     * folders in the Google Cloud organization.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The resource name for the settings to update.
+     *
+     *     "organizations/[ORGANIZATION_ID]/settings"
+     *
+     * For example:
+     *
+     *   `"organizations/12345/settings"`
+     *
+     * Note: Settings for the Log Router can currently only be configured for
+     * Google Cloud organizations. Once configured, it applies to all projects and
+     * folders in the Google Cloud organization.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The resource name for the settings to update.
+     *
+     *     "organizations/[ORGANIZATION_ID]/settings"
+     *
+     * For example:
+     *
+     *   `"organizations/12345/settings"`
+     *
+     * Note: Settings for the Log Router can currently only be configured for
+     * Google Cloud organizations. Once configured, it applies to all projects and
+     * folders in the Google Cloud organization.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.logging.v2.Settings settings_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.Settings, + com.google.logging.v2.Settings.Builder, + com.google.logging.v2.SettingsOrBuilder> + settingsBuilder_; + + /** + * + * + *
+     * Required. The settings to update.
+     *
+     * See [Enabling CMEK for Log
+     * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+     * for more information.
+     * 
+ * + * .google.logging.v2.Settings settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the settings field is set. + */ + public boolean hasSettings() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Required. The settings to update.
+     *
+     * See [Enabling CMEK for Log
+     * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+     * for more information.
+     * 
+ * + * .google.logging.v2.Settings settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The settings. + */ + public com.google.logging.v2.Settings getSettings() { + if (settingsBuilder_ == null) { + return settings_ == null ? com.google.logging.v2.Settings.getDefaultInstance() : settings_; + } else { + return settingsBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. The settings to update.
+     *
+     * See [Enabling CMEK for Log
+     * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+     * for more information.
+     * 
+ * + * .google.logging.v2.Settings settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setSettings(com.google.logging.v2.Settings value) { + if (settingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + settings_ = value; + } else { + settingsBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The settings to update.
+     *
+     * See [Enabling CMEK for Log
+     * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+     * for more information.
+     * 
+ * + * .google.logging.v2.Settings settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setSettings(com.google.logging.v2.Settings.Builder builderForValue) { + if (settingsBuilder_ == null) { + settings_ = builderForValue.build(); + } else { + settingsBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The settings to update.
+     *
+     * See [Enabling CMEK for Log
+     * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+     * for more information.
+     * 
+ * + * .google.logging.v2.Settings settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeSettings(com.google.logging.v2.Settings value) { + if (settingsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && settings_ != null + && settings_ != com.google.logging.v2.Settings.getDefaultInstance()) { + getSettingsBuilder().mergeFrom(value); + } else { + settings_ = value; + } + } else { + settingsBuilder_.mergeFrom(value); + } + if (settings_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. The settings to update.
+     *
+     * See [Enabling CMEK for Log
+     * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+     * for more information.
+     * 
+ * + * .google.logging.v2.Settings settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearSettings() { + bitField0_ = (bitField0_ & ~0x00000002); + settings_ = null; + if (settingsBuilder_ != null) { + settingsBuilder_.dispose(); + settingsBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The settings to update.
+     *
+     * See [Enabling CMEK for Log
+     * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+     * for more information.
+     * 
+ * + * .google.logging.v2.Settings settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.logging.v2.Settings.Builder getSettingsBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getSettingsFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. The settings to update.
+     *
+     * See [Enabling CMEK for Log
+     * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+     * for more information.
+     * 
+ * + * .google.logging.v2.Settings settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.logging.v2.SettingsOrBuilder getSettingsOrBuilder() { + if (settingsBuilder_ != null) { + return settingsBuilder_.getMessageOrBuilder(); + } else { + return settings_ == null ? com.google.logging.v2.Settings.getDefaultInstance() : settings_; + } + } + + /** + * + * + *
+     * Required. The settings to update.
+     *
+     * See [Enabling CMEK for Log
+     * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+     * for more information.
+     * 
+ * + * .google.logging.v2.Settings settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.Settings, + com.google.logging.v2.Settings.Builder, + com.google.logging.v2.SettingsOrBuilder> + getSettingsFieldBuilder() { + if (settingsBuilder_ == null) { + settingsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.Settings, + com.google.logging.v2.Settings.Builder, + com.google.logging.v2.SettingsOrBuilder>( + getSettings(), getParentForChildren(), isClean()); + settings_ = null; + } + return settingsBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + + /** + * + * + *
+     * Optional. Field mask identifying which fields from `settings` should
+     * be updated. A field will be overwritten if and only if it is in the update
+     * mask. Output only fields cannot be updated.
+     *
+     * See [FieldMask][google.protobuf.FieldMask] for more information.
+     *
+     * For example: `"updateMask=kmsKeyName"`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Optional. Field mask identifying which fields from `settings` should
+     * be updated. A field will be overwritten if and only if it is in the update
+     * mask. Output only fields cannot be updated.
+     *
+     * See [FieldMask][google.protobuf.FieldMask] for more information.
+     *
+     * For example: `"updateMask=kmsKeyName"`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. Field mask identifying which fields from `settings` should
+     * be updated. A field will be overwritten if and only if it is in the update
+     * mask. Output only fields cannot be updated.
+     *
+     * See [FieldMask][google.protobuf.FieldMask] for more information.
+     *
+     * For example: `"updateMask=kmsKeyName"`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Field mask identifying which fields from `settings` should
+     * be updated. A field will be overwritten if and only if it is in the update
+     * mask. Output only fields cannot be updated.
+     *
+     * See [FieldMask][google.protobuf.FieldMask] for more information.
+     *
+     * For example: `"updateMask=kmsKeyName"`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Field mask identifying which fields from `settings` should
+     * be updated. A field will be overwritten if and only if it is in the update
+     * mask. Output only fields cannot be updated.
+     *
+     * See [FieldMask][google.protobuf.FieldMask] for more information.
+     *
+     * For example: `"updateMask=kmsKeyName"`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + if (updateMask_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. Field mask identifying which fields from `settings` should
+     * be updated. A field will be overwritten if and only if it is in the update
+     * mask. Output only fields cannot be updated.
+     *
+     * See [FieldMask][google.protobuf.FieldMask] for more information.
+     *
+     * For example: `"updateMask=kmsKeyName"`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000004); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Field mask identifying which fields from `settings` should
+     * be updated. A field will be overwritten if and only if it is in the update
+     * mask. Output only fields cannot be updated.
+     *
+     * See [FieldMask][google.protobuf.FieldMask] for more information.
+     *
+     * For example: `"updateMask=kmsKeyName"`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. Field mask identifying which fields from `settings` should
+     * be updated. A field will be overwritten if and only if it is in the update
+     * mask. Output only fields cannot be updated.
+     *
+     * See [FieldMask][google.protobuf.FieldMask] for more information.
+     *
+     * For example: `"updateMask=kmsKeyName"`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + + /** + * + * + *
+     * Optional. Field mask identifying which fields from `settings` should
+     * be updated. A field will be overwritten if and only if it is in the update
+     * mask. Output only fields cannot be updated.
+     *
+     * See [FieldMask][google.protobuf.FieldMask] for more information.
+     *
+     * For example: `"updateMask=kmsKeyName"`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.logging.v2.UpdateSettingsRequest) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.UpdateSettingsRequest) + private static final com.google.logging.v2.UpdateSettingsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.UpdateSettingsRequest(); + } + + public static com.google.logging.v2.UpdateSettingsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateSettingsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.UpdateSettingsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateSettingsRequestOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateSettingsRequestOrBuilder.java new file mode 100644 index 000000000000..449a11d8c509 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateSettingsRequestOrBuilder.java @@ -0,0 +1,182 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface UpdateSettingsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.UpdateSettingsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name for the settings to update.
+   *
+   *     "organizations/[ORGANIZATION_ID]/settings"
+   *
+   * For example:
+   *
+   *   `"organizations/12345/settings"`
+   *
+   * Note: Settings for the Log Router can currently only be configured for
+   * Google Cloud organizations. Once configured, it applies to all projects and
+   * folders in the Google Cloud organization.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Required. The resource name for the settings to update.
+   *
+   *     "organizations/[ORGANIZATION_ID]/settings"
+   *
+   * For example:
+   *
+   *   `"organizations/12345/settings"`
+   *
+   * Note: Settings for the Log Router can currently only be configured for
+   * Google Cloud organizations. Once configured, it applies to all projects and
+   * folders in the Google Cloud organization.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. The settings to update.
+   *
+   * See [Enabling CMEK for Log
+   * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+   * for more information.
+   * 
+ * + * .google.logging.v2.Settings settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the settings field is set. + */ + boolean hasSettings(); + + /** + * + * + *
+   * Required. The settings to update.
+   *
+   * See [Enabling CMEK for Log
+   * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+   * for more information.
+   * 
+ * + * .google.logging.v2.Settings settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The settings. + */ + com.google.logging.v2.Settings getSettings(); + + /** + * + * + *
+   * Required. The settings to update.
+   *
+   * See [Enabling CMEK for Log
+   * Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
+   * for more information.
+   * 
+ * + * .google.logging.v2.Settings settings = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.logging.v2.SettingsOrBuilder getSettingsOrBuilder(); + + /** + * + * + *
+   * Optional. Field mask identifying which fields from `settings` should
+   * be updated. A field will be overwritten if and only if it is in the update
+   * mask. Output only fields cannot be updated.
+   *
+   * See [FieldMask][google.protobuf.FieldMask] for more information.
+   *
+   * For example: `"updateMask=kmsKeyName"`
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + + /** + * + * + *
+   * Optional. Field mask identifying which fields from `settings` should
+   * be updated. A field will be overwritten if and only if it is in the update
+   * mask. Output only fields cannot be updated.
+   *
+   * See [FieldMask][google.protobuf.FieldMask] for more information.
+   *
+   * For example: `"updateMask=kmsKeyName"`
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + + /** + * + * + *
+   * Optional. Field mask identifying which fields from `settings` should
+   * be updated. A field will be overwritten if and only if it is in the update
+   * mask. Output only fields cannot be updated.
+   *
+   * See [FieldMask][google.protobuf.FieldMask] for more information.
+   *
+   * For example: `"updateMask=kmsKeyName"`
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateSinkRequest.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateSinkRequest.java new file mode 100644 index 000000000000..65d5a15a4353 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateSinkRequest.java @@ -0,0 +1,1616 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * The parameters to `UpdateSink`.
+ * 
+ * + * Protobuf type {@code google.logging.v2.UpdateSinkRequest} + */ +public final class UpdateSinkRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.UpdateSinkRequest) + UpdateSinkRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use UpdateSinkRequest.newBuilder() to construct. + private UpdateSinkRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateSinkRequest() { + sinkName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateSinkRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_UpdateSinkRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_UpdateSinkRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.UpdateSinkRequest.class, + com.google.logging.v2.UpdateSinkRequest.Builder.class); + } + + private int bitField0_; + public static final int SINK_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object sinkName_ = ""; + + /** + * + * + *
+   * Required. The full resource name of the sink to update, including the
+   * parent resource and the sink identifier:
+   *
+   *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
+   *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
+   *     "folders/[FOLDER_ID]/sinks/[SINK_ID]"
+   *
+   * For example:
+   *
+   *   `"projects/my-project/sinks/my-sink"`
+   * 
+ * + * + * string sink_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The sinkName. + */ + @java.lang.Override + public java.lang.String getSinkName() { + java.lang.Object ref = sinkName_; + 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(); + sinkName_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The full resource name of the sink to update, including the
+   * parent resource and the sink identifier:
+   *
+   *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
+   *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
+   *     "folders/[FOLDER_ID]/sinks/[SINK_ID]"
+   *
+   * For example:
+   *
+   *   `"projects/my-project/sinks/my-sink"`
+   * 
+ * + * + * string sink_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for sinkName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSinkNameBytes() { + java.lang.Object ref = sinkName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sinkName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SINK_FIELD_NUMBER = 2; + private com.google.logging.v2.LogSink sink_; + + /** + * + * + *
+   * Required. The updated sink, whose name is the same identifier that appears
+   * as part of `sink_name`.
+   * 
+ * + * .google.logging.v2.LogSink sink = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the sink field is set. + */ + @java.lang.Override + public boolean hasSink() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Required. The updated sink, whose name is the same identifier that appears
+   * as part of `sink_name`.
+   * 
+ * + * .google.logging.v2.LogSink sink = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The sink. + */ + @java.lang.Override + public com.google.logging.v2.LogSink getSink() { + return sink_ == null ? com.google.logging.v2.LogSink.getDefaultInstance() : sink_; + } + + /** + * + * + *
+   * Required. The updated sink, whose name is the same identifier that appears
+   * as part of `sink_name`.
+   * 
+ * + * .google.logging.v2.LogSink sink = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + @java.lang.Override + public com.google.logging.v2.LogSinkOrBuilder getSinkOrBuilder() { + return sink_ == null ? com.google.logging.v2.LogSink.getDefaultInstance() : sink_; + } + + public static final int UNIQUE_WRITER_IDENTITY_FIELD_NUMBER = 3; + private boolean uniqueWriterIdentity_ = false; + + /** + * + * + *
+   * Optional. See [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink]
+   * for a description of this field. When updating a sink, the effect of this
+   * field on the value of `writer_identity` in the updated sink depends on both
+   * the old and new values of this field:
+   *
+   * +   If the old and new values of this field are both false or both true,
+   *     then there is no change to the sink's `writer_identity`.
+   * +   If the old value is false and the new value is true, then
+   *     `writer_identity` is changed to a unique service account.
+   * +   It is an error if the old value is true and the new value is
+   *     set to false or defaulted to false.
+   * 
+ * + * bool unique_writer_identity = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The uniqueWriterIdentity. + */ + @java.lang.Override + public boolean getUniqueWriterIdentity() { + return uniqueWriterIdentity_; + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 4; + private com.google.protobuf.FieldMask updateMask_; + + /** + * + * + *
+   * Optional. Field mask that specifies the fields in `sink` that need
+   * an update. A sink field will be overwritten if, and only if, it is
+   * in the update mask. `name` and output only fields cannot be updated.
+   *
+   * An empty `updateMask` is temporarily treated as using the following mask
+   * for backwards compatibility purposes:
+   *
+   *   `destination,filter,includeChildren`
+   *
+   * At some point in the future, behavior will be removed and specifying an
+   * empty `updateMask` will be an error.
+   *
+   * For a detailed `FieldMask` definition, see
+   * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
+   *
+   * For example: `updateMask=filter`
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Optional. Field mask that specifies the fields in `sink` that need
+   * an update. A sink field will be overwritten if, and only if, it is
+   * in the update mask. `name` and output only fields cannot be updated.
+   *
+   * An empty `updateMask` is temporarily treated as using the following mask
+   * for backwards compatibility purposes:
+   *
+   *   `destination,filter,includeChildren`
+   *
+   * At some point in the future, behavior will be removed and specifying an
+   * empty `updateMask` will be an error.
+   *
+   * For a detailed `FieldMask` definition, see
+   * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
+   *
+   * For example: `updateMask=filter`
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + /** + * + * + *
+   * Optional. Field mask that specifies the fields in `sink` that need
+   * an update. A sink field will be overwritten if, and only if, it is
+   * in the update mask. `name` and output only fields cannot be updated.
+   *
+   * An empty `updateMask` is temporarily treated as using the following mask
+   * for backwards compatibility purposes:
+   *
+   *   `destination,filter,includeChildren`
+   *
+   * At some point in the future, behavior will be removed and specifying an
+   * empty `updateMask` will be an error.
+   *
+   * For a detailed `FieldMask` definition, see
+   * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
+   *
+   * For example: `updateMask=filter`
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sinkName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, sinkName_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getSink()); + } + if (uniqueWriterIdentity_ != false) { + output.writeBool(3, uniqueWriterIdentity_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(4, getUpdateMask()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sinkName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, sinkName_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getSink()); + } + if (uniqueWriterIdentity_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, uniqueWriterIdentity_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getUpdateMask()); + } + size += getUnknownFields().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.logging.v2.UpdateSinkRequest)) { + return super.equals(obj); + } + com.google.logging.v2.UpdateSinkRequest other = (com.google.logging.v2.UpdateSinkRequest) obj; + + if (!getSinkName().equals(other.getSinkName())) return false; + if (hasSink() != other.hasSink()) return false; + if (hasSink()) { + if (!getSink().equals(other.getSink())) return false; + } + if (getUniqueWriterIdentity() != other.getUniqueWriterIdentity()) return false; + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + SINK_NAME_FIELD_NUMBER; + hash = (53 * hash) + getSinkName().hashCode(); + if (hasSink()) { + hash = (37 * hash) + SINK_FIELD_NUMBER; + hash = (53 * hash) + getSink().hashCode(); + } + hash = (37 * hash) + UNIQUE_WRITER_IDENTITY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getUniqueWriterIdentity()); + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.UpdateSinkRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.UpdateSinkRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.UpdateSinkRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.UpdateSinkRequest 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.logging.v2.UpdateSinkRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.UpdateSinkRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.UpdateSinkRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.UpdateSinkRequest 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.logging.v2.UpdateSinkRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.UpdateSinkRequest 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.logging.v2.UpdateSinkRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.UpdateSinkRequest 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.logging.v2.UpdateSinkRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The parameters to `UpdateSink`.
+   * 
+ * + * Protobuf type {@code google.logging.v2.UpdateSinkRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.UpdateSinkRequest) + com.google.logging.v2.UpdateSinkRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_UpdateSinkRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_UpdateSinkRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.UpdateSinkRequest.class, + com.google.logging.v2.UpdateSinkRequest.Builder.class); + } + + // Construct using com.google.logging.v2.UpdateSinkRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getSinkFieldBuilder(); + getUpdateMaskFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + sinkName_ = ""; + sink_ = null; + if (sinkBuilder_ != null) { + sinkBuilder_.dispose(); + sinkBuilder_ = null; + } + uniqueWriterIdentity_ = false; + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_UpdateSinkRequest_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.UpdateSinkRequest getDefaultInstanceForType() { + return com.google.logging.v2.UpdateSinkRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.UpdateSinkRequest build() { + com.google.logging.v2.UpdateSinkRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.UpdateSinkRequest buildPartial() { + com.google.logging.v2.UpdateSinkRequest result = + new com.google.logging.v2.UpdateSinkRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.logging.v2.UpdateSinkRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.sinkName_ = sinkName_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.sink_ = sinkBuilder_ == null ? sink_ : sinkBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.uniqueWriterIdentity_ = uniqueWriterIdentity_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @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.logging.v2.UpdateSinkRequest) { + return mergeFrom((com.google.logging.v2.UpdateSinkRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.UpdateSinkRequest other) { + if (other == com.google.logging.v2.UpdateSinkRequest.getDefaultInstance()) return this; + if (!other.getSinkName().isEmpty()) { + sinkName_ = other.sinkName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasSink()) { + mergeSink(other.getSink()); + } + if (other.getUniqueWriterIdentity() != false) { + setUniqueWriterIdentity(other.getUniqueWriterIdentity()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + sinkName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getSinkFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + uniqueWriterIdentity_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: + { + input.readMessage(getUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object sinkName_ = ""; + + /** + * + * + *
+     * Required. The full resource name of the sink to update, including the
+     * parent resource and the sink identifier:
+     *
+     *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
+     *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
+     *     "folders/[FOLDER_ID]/sinks/[SINK_ID]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/sinks/my-sink"`
+     * 
+ * + * + * string sink_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The sinkName. + */ + public java.lang.String getSinkName() { + java.lang.Object ref = sinkName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sinkName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The full resource name of the sink to update, including the
+     * parent resource and the sink identifier:
+     *
+     *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
+     *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
+     *     "folders/[FOLDER_ID]/sinks/[SINK_ID]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/sinks/my-sink"`
+     * 
+ * + * + * string sink_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for sinkName. + */ + public com.google.protobuf.ByteString getSinkNameBytes() { + java.lang.Object ref = sinkName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sinkName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The full resource name of the sink to update, including the
+     * parent resource and the sink identifier:
+     *
+     *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
+     *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
+     *     "folders/[FOLDER_ID]/sinks/[SINK_ID]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/sinks/my-sink"`
+     * 
+ * + * + * string sink_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The sinkName to set. + * @return This builder for chaining. + */ + public Builder setSinkName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + sinkName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The full resource name of the sink to update, including the
+     * parent resource and the sink identifier:
+     *
+     *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
+     *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
+     *     "folders/[FOLDER_ID]/sinks/[SINK_ID]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/sinks/my-sink"`
+     * 
+ * + * + * string sink_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearSinkName() { + sinkName_ = getDefaultInstance().getSinkName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The full resource name of the sink to update, including the
+     * parent resource and the sink identifier:
+     *
+     *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
+     *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
+     *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
+     *     "folders/[FOLDER_ID]/sinks/[SINK_ID]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/sinks/my-sink"`
+     * 
+ * + * + * string sink_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for sinkName to set. + * @return This builder for chaining. + */ + public Builder setSinkNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + sinkName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.logging.v2.LogSink sink_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogSink, + com.google.logging.v2.LogSink.Builder, + com.google.logging.v2.LogSinkOrBuilder> + sinkBuilder_; + + /** + * + * + *
+     * Required. The updated sink, whose name is the same identifier that appears
+     * as part of `sink_name`.
+     * 
+ * + * .google.logging.v2.LogSink sink = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the sink field is set. + */ + public boolean hasSink() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Required. The updated sink, whose name is the same identifier that appears
+     * as part of `sink_name`.
+     * 
+ * + * .google.logging.v2.LogSink sink = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The sink. + */ + public com.google.logging.v2.LogSink getSink() { + if (sinkBuilder_ == null) { + return sink_ == null ? com.google.logging.v2.LogSink.getDefaultInstance() : sink_; + } else { + return sinkBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. The updated sink, whose name is the same identifier that appears
+     * as part of `sink_name`.
+     * 
+ * + * .google.logging.v2.LogSink sink = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setSink(com.google.logging.v2.LogSink value) { + if (sinkBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sink_ = value; + } else { + sinkBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The updated sink, whose name is the same identifier that appears
+     * as part of `sink_name`.
+     * 
+ * + * .google.logging.v2.LogSink sink = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setSink(com.google.logging.v2.LogSink.Builder builderForValue) { + if (sinkBuilder_ == null) { + sink_ = builderForValue.build(); + } else { + sinkBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The updated sink, whose name is the same identifier that appears
+     * as part of `sink_name`.
+     * 
+ * + * .google.logging.v2.LogSink sink = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder mergeSink(com.google.logging.v2.LogSink value) { + if (sinkBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && sink_ != null + && sink_ != com.google.logging.v2.LogSink.getDefaultInstance()) { + getSinkBuilder().mergeFrom(value); + } else { + sink_ = value; + } + } else { + sinkBuilder_.mergeFrom(value); + } + if (sink_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. The updated sink, whose name is the same identifier that appears
+     * as part of `sink_name`.
+     * 
+ * + * .google.logging.v2.LogSink sink = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder clearSink() { + bitField0_ = (bitField0_ & ~0x00000002); + sink_ = null; + if (sinkBuilder_ != null) { + sinkBuilder_.dispose(); + sinkBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The updated sink, whose name is the same identifier that appears
+     * as part of `sink_name`.
+     * 
+ * + * .google.logging.v2.LogSink sink = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.logging.v2.LogSink.Builder getSinkBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getSinkFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. The updated sink, whose name is the same identifier that appears
+     * as part of `sink_name`.
+     * 
+ * + * .google.logging.v2.LogSink sink = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.logging.v2.LogSinkOrBuilder getSinkOrBuilder() { + if (sinkBuilder_ != null) { + return sinkBuilder_.getMessageOrBuilder(); + } else { + return sink_ == null ? com.google.logging.v2.LogSink.getDefaultInstance() : sink_; + } + } + + /** + * + * + *
+     * Required. The updated sink, whose name is the same identifier that appears
+     * as part of `sink_name`.
+     * 
+ * + * .google.logging.v2.LogSink sink = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogSink, + com.google.logging.v2.LogSink.Builder, + com.google.logging.v2.LogSinkOrBuilder> + getSinkFieldBuilder() { + if (sinkBuilder_ == null) { + sinkBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogSink, + com.google.logging.v2.LogSink.Builder, + com.google.logging.v2.LogSinkOrBuilder>( + getSink(), getParentForChildren(), isClean()); + sink_ = null; + } + return sinkBuilder_; + } + + private boolean uniqueWriterIdentity_; + + /** + * + * + *
+     * Optional. See [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink]
+     * for a description of this field. When updating a sink, the effect of this
+     * field on the value of `writer_identity` in the updated sink depends on both
+     * the old and new values of this field:
+     *
+     * +   If the old and new values of this field are both false or both true,
+     *     then there is no change to the sink's `writer_identity`.
+     * +   If the old value is false and the new value is true, then
+     *     `writer_identity` is changed to a unique service account.
+     * +   It is an error if the old value is true and the new value is
+     *     set to false or defaulted to false.
+     * 
+ * + * bool unique_writer_identity = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The uniqueWriterIdentity. + */ + @java.lang.Override + public boolean getUniqueWriterIdentity() { + return uniqueWriterIdentity_; + } + + /** + * + * + *
+     * Optional. See [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink]
+     * for a description of this field. When updating a sink, the effect of this
+     * field on the value of `writer_identity` in the updated sink depends on both
+     * the old and new values of this field:
+     *
+     * +   If the old and new values of this field are both false or both true,
+     *     then there is no change to the sink's `writer_identity`.
+     * +   If the old value is false and the new value is true, then
+     *     `writer_identity` is changed to a unique service account.
+     * +   It is an error if the old value is true and the new value is
+     *     set to false or defaulted to false.
+     * 
+ * + * bool unique_writer_identity = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The uniqueWriterIdentity to set. + * @return This builder for chaining. + */ + public Builder setUniqueWriterIdentity(boolean value) { + + uniqueWriterIdentity_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. See [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink]
+     * for a description of this field. When updating a sink, the effect of this
+     * field on the value of `writer_identity` in the updated sink depends on both
+     * the old and new values of this field:
+     *
+     * +   If the old and new values of this field are both false or both true,
+     *     then there is no change to the sink's `writer_identity`.
+     * +   If the old value is false and the new value is true, then
+     *     `writer_identity` is changed to a unique service account.
+     * +   It is an error if the old value is true and the new value is
+     *     set to false or defaulted to false.
+     * 
+ * + * bool unique_writer_identity = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearUniqueWriterIdentity() { + bitField0_ = (bitField0_ & ~0x00000004); + uniqueWriterIdentity_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + + /** + * + * + *
+     * Optional. Field mask that specifies the fields in `sink` that need
+     * an update. A sink field will be overwritten if, and only if, it is
+     * in the update mask. `name` and output only fields cannot be updated.
+     *
+     * An empty `updateMask` is temporarily treated as using the following mask
+     * for backwards compatibility purposes:
+     *
+     *   `destination,filter,includeChildren`
+     *
+     * At some point in the future, behavior will be removed and specifying an
+     * empty `updateMask` will be an error.
+     *
+     * For a detailed `FieldMask` definition, see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
+     *
+     * For example: `updateMask=filter`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000008) != 0); + } + + /** + * + * + *
+     * Optional. Field mask that specifies the fields in `sink` that need
+     * an update. A sink field will be overwritten if, and only if, it is
+     * in the update mask. `name` and output only fields cannot be updated.
+     *
+     * An empty `updateMask` is temporarily treated as using the following mask
+     * for backwards compatibility purposes:
+     *
+     *   `destination,filter,includeChildren`
+     *
+     * At some point in the future, behavior will be removed and specifying an
+     * empty `updateMask` will be an error.
+     *
+     * For a detailed `FieldMask` definition, see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
+     *
+     * For example: `updateMask=filter`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. Field mask that specifies the fields in `sink` that need
+     * an update. A sink field will be overwritten if, and only if, it is
+     * in the update mask. `name` and output only fields cannot be updated.
+     *
+     * An empty `updateMask` is temporarily treated as using the following mask
+     * for backwards compatibility purposes:
+     *
+     *   `destination,filter,includeChildren`
+     *
+     * At some point in the future, behavior will be removed and specifying an
+     * empty `updateMask` will be an error.
+     *
+     * For a detailed `FieldMask` definition, see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
+     *
+     * For example: `updateMask=filter`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Field mask that specifies the fields in `sink` that need
+     * an update. A sink field will be overwritten if, and only if, it is
+     * in the update mask. `name` and output only fields cannot be updated.
+     *
+     * An empty `updateMask` is temporarily treated as using the following mask
+     * for backwards compatibility purposes:
+     *
+     *   `destination,filter,includeChildren`
+     *
+     * At some point in the future, behavior will be removed and specifying an
+     * empty `updateMask` will be an error.
+     *
+     * For a detailed `FieldMask` definition, see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
+     *
+     * For example: `updateMask=filter`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Field mask that specifies the fields in `sink` that need
+     * an update. A sink field will be overwritten if, and only if, it is
+     * in the update mask. `name` and output only fields cannot be updated.
+     *
+     * An empty `updateMask` is temporarily treated as using the following mask
+     * for backwards compatibility purposes:
+     *
+     *   `destination,filter,includeChildren`
+     *
+     * At some point in the future, behavior will be removed and specifying an
+     * empty `updateMask` will be an error.
+     *
+     * For a detailed `FieldMask` definition, see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
+     *
+     * For example: `updateMask=filter`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + if (updateMask_ != null) { + bitField0_ |= 0x00000008; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. Field mask that specifies the fields in `sink` that need
+     * an update. A sink field will be overwritten if, and only if, it is
+     * in the update mask. `name` and output only fields cannot be updated.
+     *
+     * An empty `updateMask` is temporarily treated as using the following mask
+     * for backwards compatibility purposes:
+     *
+     *   `destination,filter,includeChildren`
+     *
+     * At some point in the future, behavior will be removed and specifying an
+     * empty `updateMask` will be an error.
+     *
+     * For a detailed `FieldMask` definition, see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
+     *
+     * For example: `updateMask=filter`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000008); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Field mask that specifies the fields in `sink` that need
+     * an update. A sink field will be overwritten if, and only if, it is
+     * in the update mask. `name` and output only fields cannot be updated.
+     *
+     * An empty `updateMask` is temporarily treated as using the following mask
+     * for backwards compatibility purposes:
+     *
+     *   `destination,filter,includeChildren`
+     *
+     * At some point in the future, behavior will be removed and specifying an
+     * empty `updateMask` will be an error.
+     *
+     * For a detailed `FieldMask` definition, see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
+     *
+     * For example: `updateMask=filter`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000008; + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. Field mask that specifies the fields in `sink` that need
+     * an update. A sink field will be overwritten if, and only if, it is
+     * in the update mask. `name` and output only fields cannot be updated.
+     *
+     * An empty `updateMask` is temporarily treated as using the following mask
+     * for backwards compatibility purposes:
+     *
+     *   `destination,filter,includeChildren`
+     *
+     * At some point in the future, behavior will be removed and specifying an
+     * empty `updateMask` will be an error.
+     *
+     * For a detailed `FieldMask` definition, see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
+     *
+     * For example: `updateMask=filter`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + + /** + * + * + *
+     * Optional. Field mask that specifies the fields in `sink` that need
+     * an update. A sink field will be overwritten if, and only if, it is
+     * in the update mask. `name` and output only fields cannot be updated.
+     *
+     * An empty `updateMask` is temporarily treated as using the following mask
+     * for backwards compatibility purposes:
+     *
+     *   `destination,filter,includeChildren`
+     *
+     * At some point in the future, behavior will be removed and specifying an
+     * empty `updateMask` will be an error.
+     *
+     * For a detailed `FieldMask` definition, see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
+     *
+     * For example: `updateMask=filter`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.logging.v2.UpdateSinkRequest) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.UpdateSinkRequest) + private static final com.google.logging.v2.UpdateSinkRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.UpdateSinkRequest(); + } + + public static com.google.logging.v2.UpdateSinkRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateSinkRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.UpdateSinkRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateSinkRequestOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateSinkRequestOrBuilder.java new file mode 100644 index 000000000000..ce4d62abdf83 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateSinkRequestOrBuilder.java @@ -0,0 +1,224 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface UpdateSinkRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.UpdateSinkRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The full resource name of the sink to update, including the
+   * parent resource and the sink identifier:
+   *
+   *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
+   *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
+   *     "folders/[FOLDER_ID]/sinks/[SINK_ID]"
+   *
+   * For example:
+   *
+   *   `"projects/my-project/sinks/my-sink"`
+   * 
+ * + * + * string sink_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The sinkName. + */ + java.lang.String getSinkName(); + + /** + * + * + *
+   * Required. The full resource name of the sink to update, including the
+   * parent resource and the sink identifier:
+   *
+   *     "projects/[PROJECT_ID]/sinks/[SINK_ID]"
+   *     "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
+   *     "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
+   *     "folders/[FOLDER_ID]/sinks/[SINK_ID]"
+   *
+   * For example:
+   *
+   *   `"projects/my-project/sinks/my-sink"`
+   * 
+ * + * + * string sink_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for sinkName. + */ + com.google.protobuf.ByteString getSinkNameBytes(); + + /** + * + * + *
+   * Required. The updated sink, whose name is the same identifier that appears
+   * as part of `sink_name`.
+   * 
+ * + * .google.logging.v2.LogSink sink = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the sink field is set. + */ + boolean hasSink(); + + /** + * + * + *
+   * Required. The updated sink, whose name is the same identifier that appears
+   * as part of `sink_name`.
+   * 
+ * + * .google.logging.v2.LogSink sink = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The sink. + */ + com.google.logging.v2.LogSink getSink(); + + /** + * + * + *
+   * Required. The updated sink, whose name is the same identifier that appears
+   * as part of `sink_name`.
+   * 
+ * + * .google.logging.v2.LogSink sink = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + com.google.logging.v2.LogSinkOrBuilder getSinkOrBuilder(); + + /** + * + * + *
+   * Optional. See [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink]
+   * for a description of this field. When updating a sink, the effect of this
+   * field on the value of `writer_identity` in the updated sink depends on both
+   * the old and new values of this field:
+   *
+   * +   If the old and new values of this field are both false or both true,
+   *     then there is no change to the sink's `writer_identity`.
+   * +   If the old value is false and the new value is true, then
+   *     `writer_identity` is changed to a unique service account.
+   * +   It is an error if the old value is true and the new value is
+   *     set to false or defaulted to false.
+   * 
+ * + * bool unique_writer_identity = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The uniqueWriterIdentity. + */ + boolean getUniqueWriterIdentity(); + + /** + * + * + *
+   * Optional. Field mask that specifies the fields in `sink` that need
+   * an update. A sink field will be overwritten if, and only if, it is
+   * in the update mask. `name` and output only fields cannot be updated.
+   *
+   * An empty `updateMask` is temporarily treated as using the following mask
+   * for backwards compatibility purposes:
+   *
+   *   `destination,filter,includeChildren`
+   *
+   * At some point in the future, behavior will be removed and specifying an
+   * empty `updateMask` will be an error.
+   *
+   * For a detailed `FieldMask` definition, see
+   * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
+   *
+   * For example: `updateMask=filter`
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + + /** + * + * + *
+   * Optional. Field mask that specifies the fields in `sink` that need
+   * an update. A sink field will be overwritten if, and only if, it is
+   * in the update mask. `name` and output only fields cannot be updated.
+   *
+   * An empty `updateMask` is temporarily treated as using the following mask
+   * for backwards compatibility purposes:
+   *
+   *   `destination,filter,includeChildren`
+   *
+   * At some point in the future, behavior will be removed and specifying an
+   * empty `updateMask` will be an error.
+   *
+   * For a detailed `FieldMask` definition, see
+   * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
+   *
+   * For example: `updateMask=filter`
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + + /** + * + * + *
+   * Optional. Field mask that specifies the fields in `sink` that need
+   * an update. A sink field will be overwritten if, and only if, it is
+   * in the update mask. `name` and output only fields cannot be updated.
+   *
+   * An empty `updateMask` is temporarily treated as using the following mask
+   * for backwards compatibility purposes:
+   *
+   *   `destination,filter,includeChildren`
+   *
+   * At some point in the future, behavior will be removed and specifying an
+   * empty `updateMask` will be an error.
+   *
+   * For a detailed `FieldMask` definition, see
+   * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
+   *
+   * For example: `updateMask=filter`
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateViewRequest.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateViewRequest.java new file mode 100644 index 000000000000..4a9e62461a9a --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateViewRequest.java @@ -0,0 +1,1329 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * The parameters to `UpdateView`.
+ * 
+ * + * Protobuf type {@code google.logging.v2.UpdateViewRequest} + */ +public final class UpdateViewRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.UpdateViewRequest) + UpdateViewRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use UpdateViewRequest.newBuilder() to construct. + private UpdateViewRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateViewRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateViewRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_UpdateViewRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_UpdateViewRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.UpdateViewRequest.class, + com.google.logging.v2.UpdateViewRequest.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * + * + *
+   * Required. The full resource name of the view to update
+   *
+   *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]"
+   *
+   * For example:
+   *
+   *   `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * + * + *
+   * Required. The full resource name of the view to update
+   *
+   *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]"
+   *
+   * For example:
+   *
+   *   `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VIEW_FIELD_NUMBER = 2; + private com.google.logging.v2.LogView view_; + + /** + * + * + *
+   * Required. The updated view.
+   * 
+ * + * .google.logging.v2.LogView view = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the view field is set. + */ + @java.lang.Override + public boolean hasView() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Required. The updated view.
+   * 
+ * + * .google.logging.v2.LogView view = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The view. + */ + @java.lang.Override + public com.google.logging.v2.LogView getView() { + return view_ == null ? com.google.logging.v2.LogView.getDefaultInstance() : view_; + } + + /** + * + * + *
+   * Required. The updated view.
+   * 
+ * + * .google.logging.v2.LogView view = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + @java.lang.Override + public com.google.logging.v2.LogViewOrBuilder getViewOrBuilder() { + return view_ == null ? com.google.logging.v2.LogView.getDefaultInstance() : view_; + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 4; + private com.google.protobuf.FieldMask updateMask_; + + /** + * + * + *
+   * Optional. Field mask that specifies the fields in `view` that need
+   * an update. A field will be overwritten if, and only if, it is
+   * in the update mask. `name` and output only fields cannot be updated.
+   *
+   * For a detailed `FieldMask` definition, see
+   * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
+   *
+   * For example: `updateMask=filter`
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+   * Optional. Field mask that specifies the fields in `view` that need
+   * an update. A field will be overwritten if, and only if, it is
+   * in the update mask. `name` and output only fields cannot be updated.
+   *
+   * For a detailed `FieldMask` definition, see
+   * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
+   *
+   * For example: `updateMask=filter`
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + /** + * + * + *
+   * Optional. Field mask that specifies the fields in `view` that need
+   * an update. A field will be overwritten if, and only if, it is
+   * in the update mask. `name` and output only fields cannot be updated.
+   *
+   * For a detailed `FieldMask` definition, see
+   * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
+   *
+   * For example: `updateMask=filter`
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getView()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(4, getUpdateMask()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getView()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getUpdateMask()); + } + size += getUnknownFields().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.logging.v2.UpdateViewRequest)) { + return super.equals(obj); + } + com.google.logging.v2.UpdateViewRequest other = (com.google.logging.v2.UpdateViewRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (hasView() != other.hasView()) return false; + if (hasView()) { + if (!getView().equals(other.getView())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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 (hasView()) { + hash = (37 * hash) + VIEW_FIELD_NUMBER; + hash = (53 * hash) + getView().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.UpdateViewRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.UpdateViewRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.UpdateViewRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.UpdateViewRequest 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.logging.v2.UpdateViewRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.UpdateViewRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.UpdateViewRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.UpdateViewRequest 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.logging.v2.UpdateViewRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.UpdateViewRequest 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.logging.v2.UpdateViewRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.UpdateViewRequest 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.logging.v2.UpdateViewRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The parameters to `UpdateView`.
+   * 
+ * + * Protobuf type {@code google.logging.v2.UpdateViewRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.UpdateViewRequest) + com.google.logging.v2.UpdateViewRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_UpdateViewRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_UpdateViewRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.UpdateViewRequest.class, + com.google.logging.v2.UpdateViewRequest.Builder.class); + } + + // Construct using com.google.logging.v2.UpdateViewRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getViewFieldBuilder(); + getUpdateMaskFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + view_ = null; + if (viewBuilder_ != null) { + viewBuilder_.dispose(); + viewBuilder_ = null; + } + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingConfigProto + .internal_static_google_logging_v2_UpdateViewRequest_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.UpdateViewRequest getDefaultInstanceForType() { + return com.google.logging.v2.UpdateViewRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.UpdateViewRequest build() { + com.google.logging.v2.UpdateViewRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.UpdateViewRequest buildPartial() { + com.google.logging.v2.UpdateViewRequest result = + new com.google.logging.v2.UpdateViewRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.logging.v2.UpdateViewRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.view_ = viewBuilder_ == null ? view_ : viewBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @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.logging.v2.UpdateViewRequest) { + return mergeFrom((com.google.logging.v2.UpdateViewRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.UpdateViewRequest other) { + if (other == com.google.logging.v2.UpdateViewRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasView()) { + mergeView(other.getView()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getViewFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 34: + { + input.readMessage(getUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + + /** + * + * + *
+     * Required. The full resource name of the view to update
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Required. The full resource name of the view to update
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Required. The full resource name of the view to update
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The full resource name of the view to update
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The full resource name of the view to update
+     *
+     *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]"
+     *
+     * For example:
+     *
+     *   `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.logging.v2.LogView view_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogView, + com.google.logging.v2.LogView.Builder, + com.google.logging.v2.LogViewOrBuilder> + viewBuilder_; + + /** + * + * + *
+     * Required. The updated view.
+     * 
+ * + * .google.logging.v2.LogView view = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the view field is set. + */ + public boolean hasView() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Required. The updated view.
+     * 
+ * + * .google.logging.v2.LogView view = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The view. + */ + public com.google.logging.v2.LogView getView() { + if (viewBuilder_ == null) { + return view_ == null ? com.google.logging.v2.LogView.getDefaultInstance() : view_; + } else { + return viewBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Required. The updated view.
+     * 
+ * + * .google.logging.v2.LogView view = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setView(com.google.logging.v2.LogView value) { + if (viewBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + view_ = value; + } else { + viewBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The updated view.
+     * 
+ * + * .google.logging.v2.LogView view = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder setView(com.google.logging.v2.LogView.Builder builderForValue) { + if (viewBuilder_ == null) { + view_ = builderForValue.build(); + } else { + viewBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The updated view.
+     * 
+ * + * .google.logging.v2.LogView view = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder mergeView(com.google.logging.v2.LogView value) { + if (viewBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && view_ != null + && view_ != com.google.logging.v2.LogView.getDefaultInstance()) { + getViewBuilder().mergeFrom(value); + } else { + view_ = value; + } + } else { + viewBuilder_.mergeFrom(value); + } + if (view_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Required. The updated view.
+     * 
+ * + * .google.logging.v2.LogView view = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public Builder clearView() { + bitField0_ = (bitField0_ & ~0x00000002); + view_ = null; + if (viewBuilder_ != null) { + viewBuilder_.dispose(); + viewBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Required. The updated view.
+     * 
+ * + * .google.logging.v2.LogView view = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.logging.v2.LogView.Builder getViewBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getViewFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Required. The updated view.
+     * 
+ * + * .google.logging.v2.LogView view = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + public com.google.logging.v2.LogViewOrBuilder getViewOrBuilder() { + if (viewBuilder_ != null) { + return viewBuilder_.getMessageOrBuilder(); + } else { + return view_ == null ? com.google.logging.v2.LogView.getDefaultInstance() : view_; + } + } + + /** + * + * + *
+     * Required. The updated view.
+     * 
+ * + * .google.logging.v2.LogView view = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogView, + com.google.logging.v2.LogView.Builder, + com.google.logging.v2.LogViewOrBuilder> + getViewFieldBuilder() { + if (viewBuilder_ == null) { + viewBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.logging.v2.LogView, + com.google.logging.v2.LogView.Builder, + com.google.logging.v2.LogViewOrBuilder>( + getView(), getParentForChildren(), isClean()); + view_ = null; + } + return viewBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + + /** + * + * + *
+     * Optional. Field mask that specifies the fields in `view` that need
+     * an update. A field will be overwritten if, and only if, it is
+     * in the update mask. `name` and output only fields cannot be updated.
+     *
+     * For a detailed `FieldMask` definition, see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
+     *
+     * For example: `updateMask=filter`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000004) != 0); + } + + /** + * + * + *
+     * Optional. Field mask that specifies the fields in `view` that need
+     * an update. A field will be overwritten if, and only if, it is
+     * in the update mask. `name` and output only fields cannot be updated.
+     *
+     * For a detailed `FieldMask` definition, see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
+     *
+     * For example: `updateMask=filter`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. Field mask that specifies the fields in `view` that need
+     * an update. A field will be overwritten if, and only if, it is
+     * in the update mask. `name` and output only fields cannot be updated.
+     *
+     * For a detailed `FieldMask` definition, see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
+     *
+     * For example: `updateMask=filter`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Field mask that specifies the fields in `view` that need
+     * an update. A field will be overwritten if, and only if, it is
+     * in the update mask. `name` and output only fields cannot be updated.
+     *
+     * For a detailed `FieldMask` definition, see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
+     *
+     * For example: `updateMask=filter`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Field mask that specifies the fields in `view` that need
+     * an update. A field will be overwritten if, and only if, it is
+     * in the update mask. `name` and output only fields cannot be updated.
+     *
+     * For a detailed `FieldMask` definition, see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
+     *
+     * For example: `updateMask=filter`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + if (updateMask_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. Field mask that specifies the fields in `view` that need
+     * an update. A field will be overwritten if, and only if, it is
+     * in the update mask. `name` and output only fields cannot be updated.
+     *
+     * For a detailed `FieldMask` definition, see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
+     *
+     * For example: `updateMask=filter`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000004); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Field mask that specifies the fields in `view` that need
+     * an update. A field will be overwritten if, and only if, it is
+     * in the update mask. `name` and output only fields cannot be updated.
+     *
+     * For a detailed `FieldMask` definition, see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
+     *
+     * For example: `updateMask=filter`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. Field mask that specifies the fields in `view` that need
+     * an update. A field will be overwritten if, and only if, it is
+     * in the update mask. `name` and output only fields cannot be updated.
+     *
+     * For a detailed `FieldMask` definition, see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
+     *
+     * For example: `updateMask=filter`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + + /** + * + * + *
+     * Optional. Field mask that specifies the fields in `view` that need
+     * an update. A field will be overwritten if, and only if, it is
+     * in the update mask. `name` and output only fields cannot be updated.
+     *
+     * For a detailed `FieldMask` definition, see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
+     *
+     * For example: `updateMask=filter`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.logging.v2.UpdateViewRequest) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.UpdateViewRequest) + private static final com.google.logging.v2.UpdateViewRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.UpdateViewRequest(); + } + + public static com.google.logging.v2.UpdateViewRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateViewRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.UpdateViewRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateViewRequestOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateViewRequestOrBuilder.java new file mode 100644 index 000000000000..ea1a3a0ee71f --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateViewRequestOrBuilder.java @@ -0,0 +1,162 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging_config.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface UpdateViewRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.UpdateViewRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The full resource name of the view to update
+   *
+   *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]"
+   *
+   * For example:
+   *
+   *   `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * + * + *
+   * Required. The full resource name of the view to update
+   *
+   *     "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]"
+   *
+   * For example:
+   *
+   *   `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. The updated view.
+   * 
+ * + * .google.logging.v2.LogView view = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the view field is set. + */ + boolean hasView(); + + /** + * + * + *
+   * Required. The updated view.
+   * 
+ * + * .google.logging.v2.LogView view = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The view. + */ + com.google.logging.v2.LogView getView(); + + /** + * + * + *
+   * Required. The updated view.
+   * 
+ * + * .google.logging.v2.LogView view = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + com.google.logging.v2.LogViewOrBuilder getViewOrBuilder(); + + /** + * + * + *
+   * Optional. Field mask that specifies the fields in `view` that need
+   * an update. A field will be overwritten if, and only if, it is
+   * in the update mask. `name` and output only fields cannot be updated.
+   *
+   * For a detailed `FieldMask` definition, see
+   * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
+   *
+   * For example: `updateMask=filter`
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + + /** + * + * + *
+   * Optional. Field mask that specifies the fields in `view` that need
+   * an update. A field will be overwritten if, and only if, it is
+   * in the update mask. `name` and output only fields cannot be updated.
+   *
+   * For a detailed `FieldMask` definition, see
+   * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
+   *
+   * For example: `updateMask=filter`
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + + /** + * + * + *
+   * Optional. Field mask that specifies the fields in `view` that need
+   * an update. A field will be overwritten if, and only if, it is
+   * in the update mask. `name` and output only fields cannot be updated.
+   *
+   * For a detailed `FieldMask` definition, see
+   * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
+   *
+   * For example: `updateMask=filter`
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/WriteLogEntriesPartialErrors.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/WriteLogEntriesPartialErrors.java new file mode 100644 index 000000000000..f12a54770617 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/WriteLogEntriesPartialErrors.java @@ -0,0 +1,908 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * Error details for WriteLogEntries with partial success.
+ * 
+ * + * Protobuf type {@code google.logging.v2.WriteLogEntriesPartialErrors} + */ +public final class WriteLogEntriesPartialErrors extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.WriteLogEntriesPartialErrors) + WriteLogEntriesPartialErrorsOrBuilder { + private static final long serialVersionUID = 0L; + + // Use WriteLogEntriesPartialErrors.newBuilder() to construct. + private WriteLogEntriesPartialErrors(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private WriteLogEntriesPartialErrors() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new WriteLogEntriesPartialErrors(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_WriteLogEntriesPartialErrors_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 1: + return internalGetLogEntryErrors(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_WriteLogEntriesPartialErrors_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.WriteLogEntriesPartialErrors.class, + com.google.logging.v2.WriteLogEntriesPartialErrors.Builder.class); + } + + public static final int LOG_ENTRY_ERRORS_FIELD_NUMBER = 1; + + private static final class LogEntryErrorsDefaultEntryHolder { + static final com.google.protobuf.MapEntry + defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_WriteLogEntriesPartialErrors_LogEntryErrorsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.INT32, + 0, + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.rpc.Status.getDefaultInstance()); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField logEntryErrors_; + + private com.google.protobuf.MapField + internalGetLogEntryErrors() { + if (logEntryErrors_ == null) { + return com.google.protobuf.MapField.emptyMapField( + LogEntryErrorsDefaultEntryHolder.defaultEntry); + } + return logEntryErrors_; + } + + public int getLogEntryErrorsCount() { + return internalGetLogEntryErrors().getMap().size(); + } + + /** + * + * + *
+   * When `WriteLogEntriesRequest.partial_success` is true, records the error
+   * status for entries that were not written due to a permanent error, keyed
+   * by the entry's zero-based index in `WriteLogEntriesRequest.entries`.
+   *
+   * Failed requests for which no entries are written will not include
+   * per-entry errors.
+   * 
+ * + * map<int32, .google.rpc.Status> log_entry_errors = 1; + */ + @java.lang.Override + public boolean containsLogEntryErrors(int key) { + + return internalGetLogEntryErrors().getMap().containsKey(key); + } + + /** Use {@link #getLogEntryErrorsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLogEntryErrors() { + return getLogEntryErrorsMap(); + } + + /** + * + * + *
+   * When `WriteLogEntriesRequest.partial_success` is true, records the error
+   * status for entries that were not written due to a permanent error, keyed
+   * by the entry's zero-based index in `WriteLogEntriesRequest.entries`.
+   *
+   * Failed requests for which no entries are written will not include
+   * per-entry errors.
+   * 
+ * + * map<int32, .google.rpc.Status> log_entry_errors = 1; + */ + @java.lang.Override + public java.util.Map getLogEntryErrorsMap() { + return internalGetLogEntryErrors().getMap(); + } + + /** + * + * + *
+   * When `WriteLogEntriesRequest.partial_success` is true, records the error
+   * status for entries that were not written due to a permanent error, keyed
+   * by the entry's zero-based index in `WriteLogEntriesRequest.entries`.
+   *
+   * Failed requests for which no entries are written will not include
+   * per-entry errors.
+   * 
+ * + * map<int32, .google.rpc.Status> log_entry_errors = 1; + */ + @java.lang.Override + public /* nullable */ com.google.rpc.Status getLogEntryErrorsOrDefault( + int key, + /* nullable */ + com.google.rpc.Status defaultValue) { + + java.util.Map map = + internalGetLogEntryErrors().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * + * + *
+   * When `WriteLogEntriesRequest.partial_success` is true, records the error
+   * status for entries that were not written due to a permanent error, keyed
+   * by the entry's zero-based index in `WriteLogEntriesRequest.entries`.
+   *
+   * Failed requests for which no entries are written will not include
+   * per-entry errors.
+   * 
+ * + * map<int32, .google.rpc.Status> log_entry_errors = 1; + */ + @java.lang.Override + public com.google.rpc.Status getLogEntryErrorsOrThrow(int key) { + + java.util.Map map = + internalGetLogEntryErrors().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + com.google.protobuf.GeneratedMessageV3.serializeIntegerMapTo( + output, internalGetLogEntryErrors(), LogEntryErrorsDefaultEntryHolder.defaultEntry, 1); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (java.util.Map.Entry entry : + internalGetLogEntryErrors().getMap().entrySet()) { + com.google.protobuf.MapEntry logEntryErrors__ = + LogEntryErrorsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, logEntryErrors__); + } + size += getUnknownFields().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.logging.v2.WriteLogEntriesPartialErrors)) { + return super.equals(obj); + } + com.google.logging.v2.WriteLogEntriesPartialErrors other = + (com.google.logging.v2.WriteLogEntriesPartialErrors) obj; + + if (!internalGetLogEntryErrors().equals(other.internalGetLogEntryErrors())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (!internalGetLogEntryErrors().getMap().isEmpty()) { + hash = (37 * hash) + LOG_ENTRY_ERRORS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLogEntryErrors().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.WriteLogEntriesPartialErrors parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.WriteLogEntriesPartialErrors parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.WriteLogEntriesPartialErrors parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.WriteLogEntriesPartialErrors 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.logging.v2.WriteLogEntriesPartialErrors parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.WriteLogEntriesPartialErrors parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.WriteLogEntriesPartialErrors parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.WriteLogEntriesPartialErrors 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.logging.v2.WriteLogEntriesPartialErrors parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.WriteLogEntriesPartialErrors 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.logging.v2.WriteLogEntriesPartialErrors parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.WriteLogEntriesPartialErrors 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.logging.v2.WriteLogEntriesPartialErrors 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; + } + + /** + * + * + *
+   * Error details for WriteLogEntries with partial success.
+   * 
+ * + * Protobuf type {@code google.logging.v2.WriteLogEntriesPartialErrors} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.WriteLogEntriesPartialErrors) + com.google.logging.v2.WriteLogEntriesPartialErrorsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_WriteLogEntriesPartialErrors_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 1: + return internalGetLogEntryErrors(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 1: + return internalGetMutableLogEntryErrors(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_WriteLogEntriesPartialErrors_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.WriteLogEntriesPartialErrors.class, + com.google.logging.v2.WriteLogEntriesPartialErrors.Builder.class); + } + + // Construct using com.google.logging.v2.WriteLogEntriesPartialErrors.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + internalGetMutableLogEntryErrors().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_WriteLogEntriesPartialErrors_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.WriteLogEntriesPartialErrors getDefaultInstanceForType() { + return com.google.logging.v2.WriteLogEntriesPartialErrors.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.WriteLogEntriesPartialErrors build() { + com.google.logging.v2.WriteLogEntriesPartialErrors result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.WriteLogEntriesPartialErrors buildPartial() { + com.google.logging.v2.WriteLogEntriesPartialErrors result = + new com.google.logging.v2.WriteLogEntriesPartialErrors(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.logging.v2.WriteLogEntriesPartialErrors result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.logEntryErrors_ = + internalGetLogEntryErrors().build(LogEntryErrorsDefaultEntryHolder.defaultEntry); + } + } + + @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.logging.v2.WriteLogEntriesPartialErrors) { + return mergeFrom((com.google.logging.v2.WriteLogEntriesPartialErrors) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.WriteLogEntriesPartialErrors other) { + if (other == com.google.logging.v2.WriteLogEntriesPartialErrors.getDefaultInstance()) + return this; + internalGetMutableLogEntryErrors().mergeFrom(other.internalGetLogEntryErrors()); + bitField0_ |= 0x00000001; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.protobuf.MapEntry + logEntryErrors__ = + input.readMessage( + LogEntryErrorsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableLogEntryErrors() + .ensureBuilderMap() + .put(logEntryErrors__.getKey(), logEntryErrors__.getValue()); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private static final class LogEntryErrorsConverter + implements com.google.protobuf.MapFieldBuilder.Converter< + java.lang.Integer, com.google.rpc.StatusOrBuilder, com.google.rpc.Status> { + @java.lang.Override + public com.google.rpc.Status build(com.google.rpc.StatusOrBuilder val) { + if (val instanceof com.google.rpc.Status) { + return (com.google.rpc.Status) val; + } + return ((com.google.rpc.Status.Builder) val).build(); + } + + @java.lang.Override + public com.google.protobuf.MapEntry defaultEntry() { + return LogEntryErrorsDefaultEntryHolder.defaultEntry; + } + } + ; + + private static final LogEntryErrorsConverter logEntryErrorsConverter = + new LogEntryErrorsConverter(); + + private com.google.protobuf.MapFieldBuilder< + java.lang.Integer, + com.google.rpc.StatusOrBuilder, + com.google.rpc.Status, + com.google.rpc.Status.Builder> + logEntryErrors_; + + private com.google.protobuf.MapFieldBuilder< + java.lang.Integer, + com.google.rpc.StatusOrBuilder, + com.google.rpc.Status, + com.google.rpc.Status.Builder> + internalGetLogEntryErrors() { + if (logEntryErrors_ == null) { + return new com.google.protobuf.MapFieldBuilder<>(logEntryErrorsConverter); + } + return logEntryErrors_; + } + + private com.google.protobuf.MapFieldBuilder< + java.lang.Integer, + com.google.rpc.StatusOrBuilder, + com.google.rpc.Status, + com.google.rpc.Status.Builder> + internalGetMutableLogEntryErrors() { + if (logEntryErrors_ == null) { + logEntryErrors_ = new com.google.protobuf.MapFieldBuilder<>(logEntryErrorsConverter); + } + bitField0_ |= 0x00000001; + onChanged(); + return logEntryErrors_; + } + + public int getLogEntryErrorsCount() { + return internalGetLogEntryErrors().ensureBuilderMap().size(); + } + + /** + * + * + *
+     * When `WriteLogEntriesRequest.partial_success` is true, records the error
+     * status for entries that were not written due to a permanent error, keyed
+     * by the entry's zero-based index in `WriteLogEntriesRequest.entries`.
+     *
+     * Failed requests for which no entries are written will not include
+     * per-entry errors.
+     * 
+ * + * map<int32, .google.rpc.Status> log_entry_errors = 1; + */ + @java.lang.Override + public boolean containsLogEntryErrors(int key) { + + return internalGetLogEntryErrors().ensureBuilderMap().containsKey(key); + } + + /** Use {@link #getLogEntryErrorsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLogEntryErrors() { + return getLogEntryErrorsMap(); + } + + /** + * + * + *
+     * When `WriteLogEntriesRequest.partial_success` is true, records the error
+     * status for entries that were not written due to a permanent error, keyed
+     * by the entry's zero-based index in `WriteLogEntriesRequest.entries`.
+     *
+     * Failed requests for which no entries are written will not include
+     * per-entry errors.
+     * 
+ * + * map<int32, .google.rpc.Status> log_entry_errors = 1; + */ + @java.lang.Override + public java.util.Map getLogEntryErrorsMap() { + return internalGetLogEntryErrors().getImmutableMap(); + } + + /** + * + * + *
+     * When `WriteLogEntriesRequest.partial_success` is true, records the error
+     * status for entries that were not written due to a permanent error, keyed
+     * by the entry's zero-based index in `WriteLogEntriesRequest.entries`.
+     *
+     * Failed requests for which no entries are written will not include
+     * per-entry errors.
+     * 
+ * + * map<int32, .google.rpc.Status> log_entry_errors = 1; + */ + @java.lang.Override + public /* nullable */ com.google.rpc.Status getLogEntryErrorsOrDefault( + int key, + /* nullable */ + com.google.rpc.Status defaultValue) { + + java.util.Map map = + internalGetMutableLogEntryErrors().ensureBuilderMap(); + return map.containsKey(key) ? logEntryErrorsConverter.build(map.get(key)) : defaultValue; + } + + /** + * + * + *
+     * When `WriteLogEntriesRequest.partial_success` is true, records the error
+     * status for entries that were not written due to a permanent error, keyed
+     * by the entry's zero-based index in `WriteLogEntriesRequest.entries`.
+     *
+     * Failed requests for which no entries are written will not include
+     * per-entry errors.
+     * 
+ * + * map<int32, .google.rpc.Status> log_entry_errors = 1; + */ + @java.lang.Override + public com.google.rpc.Status getLogEntryErrorsOrThrow(int key) { + + java.util.Map map = + internalGetMutableLogEntryErrors().ensureBuilderMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return logEntryErrorsConverter.build(map.get(key)); + } + + public Builder clearLogEntryErrors() { + bitField0_ = (bitField0_ & ~0x00000001); + internalGetMutableLogEntryErrors().clear(); + return this; + } + + /** + * + * + *
+     * When `WriteLogEntriesRequest.partial_success` is true, records the error
+     * status for entries that were not written due to a permanent error, keyed
+     * by the entry's zero-based index in `WriteLogEntriesRequest.entries`.
+     *
+     * Failed requests for which no entries are written will not include
+     * per-entry errors.
+     * 
+ * + * map<int32, .google.rpc.Status> log_entry_errors = 1; + */ + public Builder removeLogEntryErrors(int key) { + + internalGetMutableLogEntryErrors().ensureBuilderMap().remove(key); + return this; + } + + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLogEntryErrors() { + bitField0_ |= 0x00000001; + return internalGetMutableLogEntryErrors().ensureMessageMap(); + } + + /** + * + * + *
+     * When `WriteLogEntriesRequest.partial_success` is true, records the error
+     * status for entries that were not written due to a permanent error, keyed
+     * by the entry's zero-based index in `WriteLogEntriesRequest.entries`.
+     *
+     * Failed requests for which no entries are written will not include
+     * per-entry errors.
+     * 
+ * + * map<int32, .google.rpc.Status> log_entry_errors = 1; + */ + public Builder putLogEntryErrors(int key, com.google.rpc.Status value) { + + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableLogEntryErrors().ensureBuilderMap().put(key, value); + bitField0_ |= 0x00000001; + return this; + } + + /** + * + * + *
+     * When `WriteLogEntriesRequest.partial_success` is true, records the error
+     * status for entries that were not written due to a permanent error, keyed
+     * by the entry's zero-based index in `WriteLogEntriesRequest.entries`.
+     *
+     * Failed requests for which no entries are written will not include
+     * per-entry errors.
+     * 
+ * + * map<int32, .google.rpc.Status> log_entry_errors = 1; + */ + public Builder putAllLogEntryErrors( + java.util.Map values) { + for (java.util.Map.Entry e : values.entrySet()) { + if (e.getKey() == null || e.getValue() == null) { + throw new NullPointerException(); + } + } + internalGetMutableLogEntryErrors().ensureBuilderMap().putAll(values); + bitField0_ |= 0x00000001; + return this; + } + + /** + * + * + *
+     * When `WriteLogEntriesRequest.partial_success` is true, records the error
+     * status for entries that were not written due to a permanent error, keyed
+     * by the entry's zero-based index in `WriteLogEntriesRequest.entries`.
+     *
+     * Failed requests for which no entries are written will not include
+     * per-entry errors.
+     * 
+ * + * map<int32, .google.rpc.Status> log_entry_errors = 1; + */ + public com.google.rpc.Status.Builder putLogEntryErrorsBuilderIfAbsent(int key) { + java.util.Map builderMap = + internalGetMutableLogEntryErrors().ensureBuilderMap(); + com.google.rpc.StatusOrBuilder entry = builderMap.get(key); + if (entry == null) { + entry = com.google.rpc.Status.newBuilder(); + builderMap.put(key, entry); + } + if (entry instanceof com.google.rpc.Status) { + entry = ((com.google.rpc.Status) entry).toBuilder(); + builderMap.put(key, entry); + } + return (com.google.rpc.Status.Builder) entry; + } + + @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.logging.v2.WriteLogEntriesPartialErrors) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.WriteLogEntriesPartialErrors) + private static final com.google.logging.v2.WriteLogEntriesPartialErrors DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.WriteLogEntriesPartialErrors(); + } + + public static com.google.logging.v2.WriteLogEntriesPartialErrors getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public WriteLogEntriesPartialErrors parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.WriteLogEntriesPartialErrors getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/WriteLogEntriesPartialErrorsOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/WriteLogEntriesPartialErrorsOrBuilder.java new file mode 100644 index 000000000000..3dfe010a5bba --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/WriteLogEntriesPartialErrorsOrBuilder.java @@ -0,0 +1,114 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface WriteLogEntriesPartialErrorsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.WriteLogEntriesPartialErrors) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * When `WriteLogEntriesRequest.partial_success` is true, records the error
+   * status for entries that were not written due to a permanent error, keyed
+   * by the entry's zero-based index in `WriteLogEntriesRequest.entries`.
+   *
+   * Failed requests for which no entries are written will not include
+   * per-entry errors.
+   * 
+ * + * map<int32, .google.rpc.Status> log_entry_errors = 1; + */ + int getLogEntryErrorsCount(); + + /** + * + * + *
+   * When `WriteLogEntriesRequest.partial_success` is true, records the error
+   * status for entries that were not written due to a permanent error, keyed
+   * by the entry's zero-based index in `WriteLogEntriesRequest.entries`.
+   *
+   * Failed requests for which no entries are written will not include
+   * per-entry errors.
+   * 
+ * + * map<int32, .google.rpc.Status> log_entry_errors = 1; + */ + boolean containsLogEntryErrors(int key); + + /** Use {@link #getLogEntryErrorsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLogEntryErrors(); + + /** + * + * + *
+   * When `WriteLogEntriesRequest.partial_success` is true, records the error
+   * status for entries that were not written due to a permanent error, keyed
+   * by the entry's zero-based index in `WriteLogEntriesRequest.entries`.
+   *
+   * Failed requests for which no entries are written will not include
+   * per-entry errors.
+   * 
+ * + * map<int32, .google.rpc.Status> log_entry_errors = 1; + */ + java.util.Map getLogEntryErrorsMap(); + + /** + * + * + *
+   * When `WriteLogEntriesRequest.partial_success` is true, records the error
+   * status for entries that were not written due to a permanent error, keyed
+   * by the entry's zero-based index in `WriteLogEntriesRequest.entries`.
+   *
+   * Failed requests for which no entries are written will not include
+   * per-entry errors.
+   * 
+ * + * map<int32, .google.rpc.Status> log_entry_errors = 1; + */ + /* nullable */ + com.google.rpc.Status getLogEntryErrorsOrDefault( + int key, + /* nullable */ + com.google.rpc.Status defaultValue); + + /** + * + * + *
+   * When `WriteLogEntriesRequest.partial_success` is true, records the error
+   * status for entries that were not written due to a permanent error, keyed
+   * by the entry's zero-based index in `WriteLogEntriesRequest.entries`.
+   *
+   * Failed requests for which no entries are written will not include
+   * per-entry errors.
+   * 
+ * + * map<int32, .google.rpc.Status> log_entry_errors = 1; + */ + com.google.rpc.Status getLogEntryErrorsOrThrow(int key); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/WriteLogEntriesRequest.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/WriteLogEntriesRequest.java new file mode 100644 index 000000000000..2702ea068104 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/WriteLogEntriesRequest.java @@ -0,0 +1,2836 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * The parameters to WriteLogEntries.
+ * 
+ * + * Protobuf type {@code google.logging.v2.WriteLogEntriesRequest} + */ +public final class WriteLogEntriesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.WriteLogEntriesRequest) + WriteLogEntriesRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use WriteLogEntriesRequest.newBuilder() to construct. + private WriteLogEntriesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private WriteLogEntriesRequest() { + logName_ = ""; + entries_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new WriteLogEntriesRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_WriteLogEntriesRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 3: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_WriteLogEntriesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.WriteLogEntriesRequest.class, + com.google.logging.v2.WriteLogEntriesRequest.Builder.class); + } + + private int bitField0_; + public static final int LOG_NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object logName_ = ""; + + /** + * + * + *
+   * Optional. A default log resource name that is assigned to all log entries
+   * in `entries` that do not specify a value for `log_name`:
+   *
+   * * `projects/[PROJECT_ID]/logs/[LOG_ID]`
+   * * `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]`
+   * * `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]`
+   * * `folders/[FOLDER_ID]/logs/[LOG_ID]`
+   *
+   * `[LOG_ID]` must be URL-encoded. For example:
+   *
+   *     "projects/my-project-id/logs/syslog"
+   *     "organizations/123/logs/cloudaudit.googleapis.com%2Factivity"
+   *
+   * The permission `logging.logEntries.create` is needed on each project,
+   * organization, billing account, or folder that is receiving new log
+   * entries, whether the resource is specified in `logName` or in an
+   * individual log entry.
+   * 
+ * + * + * string log_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The logName. + */ + @java.lang.Override + public java.lang.String getLogName() { + java.lang.Object ref = logName_; + 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(); + logName_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional. A default log resource name that is assigned to all log entries
+   * in `entries` that do not specify a value for `log_name`:
+   *
+   * * `projects/[PROJECT_ID]/logs/[LOG_ID]`
+   * * `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]`
+   * * `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]`
+   * * `folders/[FOLDER_ID]/logs/[LOG_ID]`
+   *
+   * `[LOG_ID]` must be URL-encoded. For example:
+   *
+   *     "projects/my-project-id/logs/syslog"
+   *     "organizations/123/logs/cloudaudit.googleapis.com%2Factivity"
+   *
+   * The permission `logging.logEntries.create` is needed on each project,
+   * organization, billing account, or folder that is receiving new log
+   * entries, whether the resource is specified in `logName` or in an
+   * individual log entry.
+   * 
+ * + * + * string log_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for logName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLogNameBytes() { + java.lang.Object ref = logName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + logName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RESOURCE_FIELD_NUMBER = 2; + private com.google.api.MonitoredResource resource_; + + /** + * + * + *
+   * Optional. A default monitored resource object that is assigned to all log
+   * entries in `entries` that do not specify a value for `resource`. Example:
+   *
+   *     { "type": "gce_instance",
+   *       "labels": {
+   *         "zone": "us-central1-a", "instance_id": "00000000000000000000" }}
+   *
+   * See [LogEntry][google.logging.v2.LogEntry].
+   * 
+ * + * .google.api.MonitoredResource resource = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the resource field is set. + */ + @java.lang.Override + public boolean hasResource() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * Optional. A default monitored resource object that is assigned to all log
+   * entries in `entries` that do not specify a value for `resource`. Example:
+   *
+   *     { "type": "gce_instance",
+   *       "labels": {
+   *         "zone": "us-central1-a", "instance_id": "00000000000000000000" }}
+   *
+   * See [LogEntry][google.logging.v2.LogEntry].
+   * 
+ * + * .google.api.MonitoredResource resource = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The resource. + */ + @java.lang.Override + public com.google.api.MonitoredResource getResource() { + return resource_ == null ? com.google.api.MonitoredResource.getDefaultInstance() : resource_; + } + + /** + * + * + *
+   * Optional. A default monitored resource object that is assigned to all log
+   * entries in `entries` that do not specify a value for `resource`. Example:
+   *
+   *     { "type": "gce_instance",
+   *       "labels": {
+   *         "zone": "us-central1-a", "instance_id": "00000000000000000000" }}
+   *
+   * See [LogEntry][google.logging.v2.LogEntry].
+   * 
+ * + * .google.api.MonitoredResource resource = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.api.MonitoredResourceOrBuilder getResourceOrBuilder() { + return resource_ == null ? com.google.api.MonitoredResource.getDefaultInstance() : resource_; + } + + public static final int LABELS_FIELD_NUMBER = 3; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_WriteLogEntriesRequest_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + + /** + * + * + *
+   * Optional. Default labels that are added to the `labels` field of all log
+   * entries in `entries`. If a log entry already has a label with the same key
+   * as a label in this parameter, then the log entry's label is not changed.
+   * See [LogEntry][google.logging.v2.LogEntry].
+   * 
+ * + * map<string, string> labels = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + + /** + * + * + *
+   * Optional. Default labels that are added to the `labels` field of all log
+   * entries in `entries`. If a log entry already has a label with the same key
+   * as a label in this parameter, then the log entry's label is not changed.
+   * See [LogEntry][google.logging.v2.LogEntry].
+   * 
+ * + * map<string, string> labels = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + + /** + * + * + *
+   * Optional. Default labels that are added to the `labels` field of all log
+   * entries in `entries`. If a log entry already has a label with the same key
+   * as a label in this parameter, then the log entry's label is not changed.
+   * See [LogEntry][google.logging.v2.LogEntry].
+   * 
+ * + * map<string, string> labels = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * + * + *
+   * Optional. Default labels that are added to the `labels` field of all log
+   * entries in `entries`. If a log entry already has a label with the same key
+   * as a label in this parameter, then the log entry's label is not changed.
+   * See [LogEntry][google.logging.v2.LogEntry].
+   * 
+ * + * map<string, string> labels = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int ENTRIES_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private java.util.List entries_; + + /** + * + * + *
+   * Required. The log entries to send to Logging. The order of log
+   * entries in this list does not matter. Values supplied in this method's
+   * `log_name`, `resource`, and `labels` fields are copied into those log
+   * entries in this list that do not include values for their corresponding
+   * fields. For more information, see the
+   * [LogEntry][google.logging.v2.LogEntry] type.
+   *
+   * If the `timestamp` or `insert_id` fields are missing in log entries, then
+   * this method supplies the current time or a unique identifier, respectively.
+   * The supplied values are chosen so that, among the log entries that did not
+   * supply their own values, the entries earlier in the list will sort before
+   * the entries later in the list. See the `entries.list` method.
+   *
+   * Log entries with timestamps that are more than the
+   * [logs retention period](https://cloud.google.com/logging/quotas) in
+   * the past or more than 24 hours in the future will not be available when
+   * calling `entries.list`. However, those log entries can still be [exported
+   * with
+   * LogSinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs).
+   *
+   * To improve throughput and to avoid exceeding the
+   * [quota limit](https://cloud.google.com/logging/quotas) for calls to
+   * `entries.write`, you should try to include several log entries in this
+   * list, rather than calling this method for each individual log entry.
+   * 
+ * + * + * repeated .google.logging.v2.LogEntry entries = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List getEntriesList() { + return entries_; + } + + /** + * + * + *
+   * Required. The log entries to send to Logging. The order of log
+   * entries in this list does not matter. Values supplied in this method's
+   * `log_name`, `resource`, and `labels` fields are copied into those log
+   * entries in this list that do not include values for their corresponding
+   * fields. For more information, see the
+   * [LogEntry][google.logging.v2.LogEntry] type.
+   *
+   * If the `timestamp` or `insert_id` fields are missing in log entries, then
+   * this method supplies the current time or a unique identifier, respectively.
+   * The supplied values are chosen so that, among the log entries that did not
+   * supply their own values, the entries earlier in the list will sort before
+   * the entries later in the list. See the `entries.list` method.
+   *
+   * Log entries with timestamps that are more than the
+   * [logs retention period](https://cloud.google.com/logging/quotas) in
+   * the past or more than 24 hours in the future will not be available when
+   * calling `entries.list`. However, those log entries can still be [exported
+   * with
+   * LogSinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs).
+   *
+   * To improve throughput and to avoid exceeding the
+   * [quota limit](https://cloud.google.com/logging/quotas) for calls to
+   * `entries.write`, you should try to include several log entries in this
+   * list, rather than calling this method for each individual log entry.
+   * 
+ * + * + * repeated .google.logging.v2.LogEntry entries = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List + getEntriesOrBuilderList() { + return entries_; + } + + /** + * + * + *
+   * Required. The log entries to send to Logging. The order of log
+   * entries in this list does not matter. Values supplied in this method's
+   * `log_name`, `resource`, and `labels` fields are copied into those log
+   * entries in this list that do not include values for their corresponding
+   * fields. For more information, see the
+   * [LogEntry][google.logging.v2.LogEntry] type.
+   *
+   * If the `timestamp` or `insert_id` fields are missing in log entries, then
+   * this method supplies the current time or a unique identifier, respectively.
+   * The supplied values are chosen so that, among the log entries that did not
+   * supply their own values, the entries earlier in the list will sort before
+   * the entries later in the list. See the `entries.list` method.
+   *
+   * Log entries with timestamps that are more than the
+   * [logs retention period](https://cloud.google.com/logging/quotas) in
+   * the past or more than 24 hours in the future will not be available when
+   * calling `entries.list`. However, those log entries can still be [exported
+   * with
+   * LogSinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs).
+   *
+   * To improve throughput and to avoid exceeding the
+   * [quota limit](https://cloud.google.com/logging/quotas) for calls to
+   * `entries.write`, you should try to include several log entries in this
+   * list, rather than calling this method for each individual log entry.
+   * 
+ * + * + * repeated .google.logging.v2.LogEntry entries = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public int getEntriesCount() { + return entries_.size(); + } + + /** + * + * + *
+   * Required. The log entries to send to Logging. The order of log
+   * entries in this list does not matter. Values supplied in this method's
+   * `log_name`, `resource`, and `labels` fields are copied into those log
+   * entries in this list that do not include values for their corresponding
+   * fields. For more information, see the
+   * [LogEntry][google.logging.v2.LogEntry] type.
+   *
+   * If the `timestamp` or `insert_id` fields are missing in log entries, then
+   * this method supplies the current time or a unique identifier, respectively.
+   * The supplied values are chosen so that, among the log entries that did not
+   * supply their own values, the entries earlier in the list will sort before
+   * the entries later in the list. See the `entries.list` method.
+   *
+   * Log entries with timestamps that are more than the
+   * [logs retention period](https://cloud.google.com/logging/quotas) in
+   * the past or more than 24 hours in the future will not be available when
+   * calling `entries.list`. However, those log entries can still be [exported
+   * with
+   * LogSinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs).
+   *
+   * To improve throughput and to avoid exceeding the
+   * [quota limit](https://cloud.google.com/logging/quotas) for calls to
+   * `entries.write`, you should try to include several log entries in this
+   * list, rather than calling this method for each individual log entry.
+   * 
+ * + * + * repeated .google.logging.v2.LogEntry entries = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.logging.v2.LogEntry getEntries(int index) { + return entries_.get(index); + } + + /** + * + * + *
+   * Required. The log entries to send to Logging. The order of log
+   * entries in this list does not matter. Values supplied in this method's
+   * `log_name`, `resource`, and `labels` fields are copied into those log
+   * entries in this list that do not include values for their corresponding
+   * fields. For more information, see the
+   * [LogEntry][google.logging.v2.LogEntry] type.
+   *
+   * If the `timestamp` or `insert_id` fields are missing in log entries, then
+   * this method supplies the current time or a unique identifier, respectively.
+   * The supplied values are chosen so that, among the log entries that did not
+   * supply their own values, the entries earlier in the list will sort before
+   * the entries later in the list. See the `entries.list` method.
+   *
+   * Log entries with timestamps that are more than the
+   * [logs retention period](https://cloud.google.com/logging/quotas) in
+   * the past or more than 24 hours in the future will not be available when
+   * calling `entries.list`. However, those log entries can still be [exported
+   * with
+   * LogSinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs).
+   *
+   * To improve throughput and to avoid exceeding the
+   * [quota limit](https://cloud.google.com/logging/quotas) for calls to
+   * `entries.write`, you should try to include several log entries in this
+   * list, rather than calling this method for each individual log entry.
+   * 
+ * + * + * repeated .google.logging.v2.LogEntry entries = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.logging.v2.LogEntryOrBuilder getEntriesOrBuilder(int index) { + return entries_.get(index); + } + + public static final int PARTIAL_SUCCESS_FIELD_NUMBER = 5; + private boolean partialSuccess_ = false; + + /** + * + * + *
+   * Optional. Whether a batch's valid entries should be written even if some
+   * other entry failed due to a permanent error such as INVALID_ARGUMENT or
+   * PERMISSION_DENIED. If any entry failed, then the response status is the
+   * response status of one of the failed entries. The response will include
+   * error details in `WriteLogEntriesPartialErrors.log_entry_errors` keyed by
+   * the entries' zero-based index in the `entries`. Failed requests for which
+   * no entries are written will not include per-entry errors.
+   * 
+ * + * bool partial_success = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The partialSuccess. + */ + @java.lang.Override + public boolean getPartialSuccess() { + return partialSuccess_; + } + + public static final int DRY_RUN_FIELD_NUMBER = 6; + private boolean dryRun_ = false; + + /** + * + * + *
+   * Optional. If true, the request should expect normal response, but the
+   * entries won't be persisted nor exported. Useful for checking whether the
+   * logging API endpoints are working properly before sending valuable data.
+   * 
+ * + * bool dry_run = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The dryRun. + */ + @java.lang.Override + public boolean getDryRun() { + return dryRun_; + } + + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(logName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, logName_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getResource()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 3); + for (int i = 0; i < entries_.size(); i++) { + output.writeMessage(4, entries_.get(i)); + } + if (partialSuccess_ != false) { + output.writeBool(5, partialSuccess_); + } + if (dryRun_ != false) { + output.writeBool(6, dryRun_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(logName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, logName_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getResource()); + } + 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(3, labels__); + } + for (int i = 0; i < entries_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, entries_.get(i)); + } + if (partialSuccess_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, partialSuccess_); + } + if (dryRun_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, dryRun_); + } + size += getUnknownFields().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.logging.v2.WriteLogEntriesRequest)) { + return super.equals(obj); + } + com.google.logging.v2.WriteLogEntriesRequest other = + (com.google.logging.v2.WriteLogEntriesRequest) obj; + + if (!getLogName().equals(other.getLogName())) return false; + if (hasResource() != other.hasResource()) return false; + if (hasResource()) { + if (!getResource().equals(other.getResource())) return false; + } + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (!getEntriesList().equals(other.getEntriesList())) return false; + if (getPartialSuccess() != other.getPartialSuccess()) return false; + if (getDryRun() != other.getDryRun()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + LOG_NAME_FIELD_NUMBER; + hash = (53 * hash) + getLogName().hashCode(); + if (hasResource()) { + hash = (37 * hash) + RESOURCE_FIELD_NUMBER; + hash = (53 * hash) + getResource().hashCode(); + } + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + if (getEntriesCount() > 0) { + hash = (37 * hash) + ENTRIES_FIELD_NUMBER; + hash = (53 * hash) + getEntriesList().hashCode(); + } + hash = (37 * hash) + PARTIAL_SUCCESS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getPartialSuccess()); + hash = (37 * hash) + DRY_RUN_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDryRun()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.WriteLogEntriesRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.WriteLogEntriesRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.WriteLogEntriesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.WriteLogEntriesRequest 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.logging.v2.WriteLogEntriesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.WriteLogEntriesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.WriteLogEntriesRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.WriteLogEntriesRequest 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.logging.v2.WriteLogEntriesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.WriteLogEntriesRequest 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.logging.v2.WriteLogEntriesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.WriteLogEntriesRequest 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.logging.v2.WriteLogEntriesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** + * + * + *
+   * The parameters to WriteLogEntries.
+   * 
+ * + * Protobuf type {@code google.logging.v2.WriteLogEntriesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.WriteLogEntriesRequest) + com.google.logging.v2.WriteLogEntriesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_WriteLogEntriesRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 3: + return internalGetLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 3: + return internalGetMutableLabels(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_WriteLogEntriesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.WriteLogEntriesRequest.class, + com.google.logging.v2.WriteLogEntriesRequest.Builder.class); + } + + // Construct using com.google.logging.v2.WriteLogEntriesRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getResourceFieldBuilder(); + getEntriesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + logName_ = ""; + resource_ = null; + if (resourceBuilder_ != null) { + resourceBuilder_.dispose(); + resourceBuilder_ = null; + } + internalGetMutableLabels().clear(); + if (entriesBuilder_ == null) { + entries_ = java.util.Collections.emptyList(); + } else { + entries_ = null; + entriesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000008); + partialSuccess_ = false; + dryRun_ = false; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_WriteLogEntriesRequest_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.WriteLogEntriesRequest getDefaultInstanceForType() { + return com.google.logging.v2.WriteLogEntriesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.WriteLogEntriesRequest build() { + com.google.logging.v2.WriteLogEntriesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.WriteLogEntriesRequest buildPartial() { + com.google.logging.v2.WriteLogEntriesRequest result = + new com.google.logging.v2.WriteLogEntriesRequest(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.logging.v2.WriteLogEntriesRequest result) { + if (entriesBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0)) { + entries_ = java.util.Collections.unmodifiableList(entries_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.entries_ = entries_; + } else { + result.entries_ = entriesBuilder_.build(); + } + } + + private void buildPartial0(com.google.logging.v2.WriteLogEntriesRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.logName_ = logName_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.resource_ = resourceBuilder_ == null ? resource_ : resourceBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.partialSuccess_ = partialSuccess_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.dryRun_ = dryRun_; + } + result.bitField0_ |= to_bitField0_; + } + + @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.logging.v2.WriteLogEntriesRequest) { + return mergeFrom((com.google.logging.v2.WriteLogEntriesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.WriteLogEntriesRequest other) { + if (other == com.google.logging.v2.WriteLogEntriesRequest.getDefaultInstance()) return this; + if (!other.getLogName().isEmpty()) { + logName_ = other.logName_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasResource()) { + mergeResource(other.getResource()); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + bitField0_ |= 0x00000004; + if (entriesBuilder_ == null) { + if (!other.entries_.isEmpty()) { + if (entries_.isEmpty()) { + entries_ = other.entries_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureEntriesIsMutable(); + entries_.addAll(other.entries_); + } + onChanged(); + } + } else { + if (!other.entries_.isEmpty()) { + if (entriesBuilder_.isEmpty()) { + entriesBuilder_.dispose(); + entriesBuilder_ = null; + entries_ = other.entries_; + bitField0_ = (bitField0_ & ~0x00000008); + entriesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getEntriesFieldBuilder() + : null; + } else { + entriesBuilder_.addAllMessages(other.entries_); + } + } + } + if (other.getPartialSuccess() != false) { + setPartialSuccess(other.getPartialSuccess()); + } + if (other.getDryRun() != false) { + setDryRun(other.getDryRun()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + logName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getResourceFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableLabels() + .getMutableMap() + .put(labels__.getKey(), labels__.getValue()); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + com.google.logging.v2.LogEntry m = + input.readMessage(com.google.logging.v2.LogEntry.parser(), extensionRegistry); + if (entriesBuilder_ == null) { + ensureEntriesIsMutable(); + entries_.add(m); + } else { + entriesBuilder_.addMessage(m); + } + break; + } // case 34 + case 40: + { + partialSuccess_ = input.readBool(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 48: + { + dryRun_ = input.readBool(); + bitField0_ |= 0x00000020; + break; + } // case 48 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object logName_ = ""; + + /** + * + * + *
+     * Optional. A default log resource name that is assigned to all log entries
+     * in `entries` that do not specify a value for `log_name`:
+     *
+     * * `projects/[PROJECT_ID]/logs/[LOG_ID]`
+     * * `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]`
+     * * `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]`
+     * * `folders/[FOLDER_ID]/logs/[LOG_ID]`
+     *
+     * `[LOG_ID]` must be URL-encoded. For example:
+     *
+     *     "projects/my-project-id/logs/syslog"
+     *     "organizations/123/logs/cloudaudit.googleapis.com%2Factivity"
+     *
+     * The permission `logging.logEntries.create` is needed on each project,
+     * organization, billing account, or folder that is receiving new log
+     * entries, whether the resource is specified in `logName` or in an
+     * individual log entry.
+     * 
+ * + * + * string log_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The logName. + */ + public java.lang.String getLogName() { + java.lang.Object ref = logName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + logName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional. A default log resource name that is assigned to all log entries
+     * in `entries` that do not specify a value for `log_name`:
+     *
+     * * `projects/[PROJECT_ID]/logs/[LOG_ID]`
+     * * `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]`
+     * * `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]`
+     * * `folders/[FOLDER_ID]/logs/[LOG_ID]`
+     *
+     * `[LOG_ID]` must be URL-encoded. For example:
+     *
+     *     "projects/my-project-id/logs/syslog"
+     *     "organizations/123/logs/cloudaudit.googleapis.com%2Factivity"
+     *
+     * The permission `logging.logEntries.create` is needed on each project,
+     * organization, billing account, or folder that is receiving new log
+     * entries, whether the resource is specified in `logName` or in an
+     * individual log entry.
+     * 
+ * + * + * string log_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for logName. + */ + public com.google.protobuf.ByteString getLogNameBytes() { + java.lang.Object ref = logName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + logName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional. A default log resource name that is assigned to all log entries
+     * in `entries` that do not specify a value for `log_name`:
+     *
+     * * `projects/[PROJECT_ID]/logs/[LOG_ID]`
+     * * `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]`
+     * * `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]`
+     * * `folders/[FOLDER_ID]/logs/[LOG_ID]`
+     *
+     * `[LOG_ID]` must be URL-encoded. For example:
+     *
+     *     "projects/my-project-id/logs/syslog"
+     *     "organizations/123/logs/cloudaudit.googleapis.com%2Factivity"
+     *
+     * The permission `logging.logEntries.create` is needed on each project,
+     * organization, billing account, or folder that is receiving new log
+     * entries, whether the resource is specified in `logName` or in an
+     * individual log entry.
+     * 
+ * + * + * string log_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The logName to set. + * @return This builder for chaining. + */ + public Builder setLogName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + logName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. A default log resource name that is assigned to all log entries
+     * in `entries` that do not specify a value for `log_name`:
+     *
+     * * `projects/[PROJECT_ID]/logs/[LOG_ID]`
+     * * `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]`
+     * * `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]`
+     * * `folders/[FOLDER_ID]/logs/[LOG_ID]`
+     *
+     * `[LOG_ID]` must be URL-encoded. For example:
+     *
+     *     "projects/my-project-id/logs/syslog"
+     *     "organizations/123/logs/cloudaudit.googleapis.com%2Factivity"
+     *
+     * The permission `logging.logEntries.create` is needed on each project,
+     * organization, billing account, or folder that is receiving new log
+     * entries, whether the resource is specified in `logName` or in an
+     * individual log entry.
+     * 
+ * + * + * string log_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearLogName() { + logName_ = getDefaultInstance().getLogName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. A default log resource name that is assigned to all log entries
+     * in `entries` that do not specify a value for `log_name`:
+     *
+     * * `projects/[PROJECT_ID]/logs/[LOG_ID]`
+     * * `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]`
+     * * `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]`
+     * * `folders/[FOLDER_ID]/logs/[LOG_ID]`
+     *
+     * `[LOG_ID]` must be URL-encoded. For example:
+     *
+     *     "projects/my-project-id/logs/syslog"
+     *     "organizations/123/logs/cloudaudit.googleapis.com%2Factivity"
+     *
+     * The permission `logging.logEntries.create` is needed on each project,
+     * organization, billing account, or folder that is receiving new log
+     * entries, whether the resource is specified in `logName` or in an
+     * individual log entry.
+     * 
+ * + * + * string log_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for logName to set. + * @return This builder for chaining. + */ + public Builder setLogNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + logName_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.api.MonitoredResource resource_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.MonitoredResource, + com.google.api.MonitoredResource.Builder, + com.google.api.MonitoredResourceOrBuilder> + resourceBuilder_; + + /** + * + * + *
+     * Optional. A default monitored resource object that is assigned to all log
+     * entries in `entries` that do not specify a value for `resource`. Example:
+     *
+     *     { "type": "gce_instance",
+     *       "labels": {
+     *         "zone": "us-central1-a", "instance_id": "00000000000000000000" }}
+     *
+     * See [LogEntry][google.logging.v2.LogEntry].
+     * 
+ * + * .google.api.MonitoredResource resource = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the resource field is set. + */ + public boolean hasResource() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * + *
+     * Optional. A default monitored resource object that is assigned to all log
+     * entries in `entries` that do not specify a value for `resource`. Example:
+     *
+     *     { "type": "gce_instance",
+     *       "labels": {
+     *         "zone": "us-central1-a", "instance_id": "00000000000000000000" }}
+     *
+     * See [LogEntry][google.logging.v2.LogEntry].
+     * 
+ * + * .google.api.MonitoredResource resource = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The resource. + */ + public com.google.api.MonitoredResource getResource() { + if (resourceBuilder_ == null) { + return resource_ == null + ? com.google.api.MonitoredResource.getDefaultInstance() + : resource_; + } else { + return resourceBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * Optional. A default monitored resource object that is assigned to all log
+     * entries in `entries` that do not specify a value for `resource`. Example:
+     *
+     *     { "type": "gce_instance",
+     *       "labels": {
+     *         "zone": "us-central1-a", "instance_id": "00000000000000000000" }}
+     *
+     * See [LogEntry][google.logging.v2.LogEntry].
+     * 
+ * + * .google.api.MonitoredResource resource = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setResource(com.google.api.MonitoredResource value) { + if (resourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + resource_ = value; + } else { + resourceBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. A default monitored resource object that is assigned to all log
+     * entries in `entries` that do not specify a value for `resource`. Example:
+     *
+     *     { "type": "gce_instance",
+     *       "labels": {
+     *         "zone": "us-central1-a", "instance_id": "00000000000000000000" }}
+     *
+     * See [LogEntry][google.logging.v2.LogEntry].
+     * 
+ * + * .google.api.MonitoredResource resource = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setResource(com.google.api.MonitoredResource.Builder builderForValue) { + if (resourceBuilder_ == null) { + resource_ = builderForValue.build(); + } else { + resourceBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. A default monitored resource object that is assigned to all log
+     * entries in `entries` that do not specify a value for `resource`. Example:
+     *
+     *     { "type": "gce_instance",
+     *       "labels": {
+     *         "zone": "us-central1-a", "instance_id": "00000000000000000000" }}
+     *
+     * See [LogEntry][google.logging.v2.LogEntry].
+     * 
+ * + * .google.api.MonitoredResource resource = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeResource(com.google.api.MonitoredResource value) { + if (resourceBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && resource_ != null + && resource_ != com.google.api.MonitoredResource.getDefaultInstance()) { + getResourceBuilder().mergeFrom(value); + } else { + resource_ = value; + } + } else { + resourceBuilder_.mergeFrom(value); + } + if (resource_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * Optional. A default monitored resource object that is assigned to all log
+     * entries in `entries` that do not specify a value for `resource`. Example:
+     *
+     *     { "type": "gce_instance",
+     *       "labels": {
+     *         "zone": "us-central1-a", "instance_id": "00000000000000000000" }}
+     *
+     * See [LogEntry][google.logging.v2.LogEntry].
+     * 
+ * + * .google.api.MonitoredResource resource = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearResource() { + bitField0_ = (bitField0_ & ~0x00000002); + resource_ = null; + if (resourceBuilder_ != null) { + resourceBuilder_.dispose(); + resourceBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. A default monitored resource object that is assigned to all log
+     * entries in `entries` that do not specify a value for `resource`. Example:
+     *
+     *     { "type": "gce_instance",
+     *       "labels": {
+     *         "zone": "us-central1-a", "instance_id": "00000000000000000000" }}
+     *
+     * See [LogEntry][google.logging.v2.LogEntry].
+     * 
+ * + * .google.api.MonitoredResource resource = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.api.MonitoredResource.Builder getResourceBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getResourceFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * Optional. A default monitored resource object that is assigned to all log
+     * entries in `entries` that do not specify a value for `resource`. Example:
+     *
+     *     { "type": "gce_instance",
+     *       "labels": {
+     *         "zone": "us-central1-a", "instance_id": "00000000000000000000" }}
+     *
+     * See [LogEntry][google.logging.v2.LogEntry].
+     * 
+ * + * .google.api.MonitoredResource resource = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.api.MonitoredResourceOrBuilder getResourceOrBuilder() { + if (resourceBuilder_ != null) { + return resourceBuilder_.getMessageOrBuilder(); + } else { + return resource_ == null + ? com.google.api.MonitoredResource.getDefaultInstance() + : resource_; + } + } + + /** + * + * + *
+     * Optional. A default monitored resource object that is assigned to all log
+     * entries in `entries` that do not specify a value for `resource`. Example:
+     *
+     *     { "type": "gce_instance",
+     *       "labels": {
+     *         "zone": "us-central1-a", "instance_id": "00000000000000000000" }}
+     *
+     * See [LogEntry][google.logging.v2.LogEntry].
+     * 
+ * + * .google.api.MonitoredResource resource = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.MonitoredResource, + com.google.api.MonitoredResource.Builder, + com.google.api.MonitoredResourceOrBuilder> + getResourceFieldBuilder() { + if (resourceBuilder_ == null) { + resourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.api.MonitoredResource, + com.google.api.MonitoredResource.Builder, + com.google.api.MonitoredResourceOrBuilder>( + getResource(), getParentForChildren(), isClean()); + resource_ = null; + } + return resourceBuilder_; + } + + 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() { + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + bitField0_ |= 0x00000004; + onChanged(); + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + + /** + * + * + *
+     * Optional. Default labels that are added to the `labels` field of all log
+     * entries in `entries`. If a log entry already has a label with the same key
+     * as a label in this parameter, then the log entry's label is not changed.
+     * See [LogEntry][google.logging.v2.LogEntry].
+     * 
+ * + * map<string, string> labels = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + + /** + * + * + *
+     * Optional. Default labels that are added to the `labels` field of all log
+     * entries in `entries`. If a log entry already has a label with the same key
+     * as a label in this parameter, then the log entry's label is not changed.
+     * See [LogEntry][google.logging.v2.LogEntry].
+     * 
+ * + * map<string, string> labels = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + + /** + * + * + *
+     * Optional. Default labels that are added to the `labels` field of all log
+     * entries in `entries`. If a log entry already has a label with the same key
+     * as a label in this parameter, then the log entry's label is not changed.
+     * See [LogEntry][google.logging.v2.LogEntry].
+     * 
+ * + * map<string, string> labels = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + + /** + * + * + *
+     * Optional. Default labels that are added to the `labels` field of all log
+     * entries in `entries`. If a log entry already has a label with the same key
+     * as a label in this parameter, then the log entry's label is not changed.
+     * See [LogEntry][google.logging.v2.LogEntry].
+     * 
+ * + * map<string, string> labels = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + bitField0_ = (bitField0_ & ~0x00000004); + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + + /** + * + * + *
+     * Optional. Default labels that are added to the `labels` field of all log
+     * entries in `entries`. If a log entry already has a label with the same key
+     * as a label in this parameter, then the log entry's label is not changed.
+     * See [LogEntry][google.logging.v2.LogEntry].
+     * 
+ * + * map<string, string> labels = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + bitField0_ |= 0x00000004; + return internalGetMutableLabels().getMutableMap(); + } + + /** + * + * + *
+     * Optional. Default labels that are added to the `labels` field of all log
+     * entries in `entries`. If a log entry already has a label with the same key
+     * as a label in this parameter, then the log entry's label is not changed.
+     * See [LogEntry][google.logging.v2.LogEntry].
+     * 
+ * + * map<string, string> labels = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableLabels().getMutableMap().put(key, value); + bitField0_ |= 0x00000004; + return this; + } + + /** + * + * + *
+     * Optional. Default labels that are added to the `labels` field of all log
+     * entries in `entries`. If a log entry already has a label with the same key
+     * as a label in this parameter, then the log entry's label is not changed.
+     * See [LogEntry][google.logging.v2.LogEntry].
+     * 
+ * + * map<string, string> labels = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + bitField0_ |= 0x00000004; + return this; + } + + private java.util.List entries_ = + java.util.Collections.emptyList(); + + private void ensureEntriesIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + entries_ = new java.util.ArrayList(entries_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.logging.v2.LogEntry, + com.google.logging.v2.LogEntry.Builder, + com.google.logging.v2.LogEntryOrBuilder> + entriesBuilder_; + + /** + * + * + *
+     * Required. The log entries to send to Logging. The order of log
+     * entries in this list does not matter. Values supplied in this method's
+     * `log_name`, `resource`, and `labels` fields are copied into those log
+     * entries in this list that do not include values for their corresponding
+     * fields. For more information, see the
+     * [LogEntry][google.logging.v2.LogEntry] type.
+     *
+     * If the `timestamp` or `insert_id` fields are missing in log entries, then
+     * this method supplies the current time or a unique identifier, respectively.
+     * The supplied values are chosen so that, among the log entries that did not
+     * supply their own values, the entries earlier in the list will sort before
+     * the entries later in the list. See the `entries.list` method.
+     *
+     * Log entries with timestamps that are more than the
+     * [logs retention period](https://cloud.google.com/logging/quotas) in
+     * the past or more than 24 hours in the future will not be available when
+     * calling `entries.list`. However, those log entries can still be [exported
+     * with
+     * LogSinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs).
+     *
+     * To improve throughput and to avoid exceeding the
+     * [quota limit](https://cloud.google.com/logging/quotas) for calls to
+     * `entries.write`, you should try to include several log entries in this
+     * list, rather than calling this method for each individual log entry.
+     * 
+ * + * + * repeated .google.logging.v2.LogEntry entries = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List getEntriesList() { + if (entriesBuilder_ == null) { + return java.util.Collections.unmodifiableList(entries_); + } else { + return entriesBuilder_.getMessageList(); + } + } + + /** + * + * + *
+     * Required. The log entries to send to Logging. The order of log
+     * entries in this list does not matter. Values supplied in this method's
+     * `log_name`, `resource`, and `labels` fields are copied into those log
+     * entries in this list that do not include values for their corresponding
+     * fields. For more information, see the
+     * [LogEntry][google.logging.v2.LogEntry] type.
+     *
+     * If the `timestamp` or `insert_id` fields are missing in log entries, then
+     * this method supplies the current time or a unique identifier, respectively.
+     * The supplied values are chosen so that, among the log entries that did not
+     * supply their own values, the entries earlier in the list will sort before
+     * the entries later in the list. See the `entries.list` method.
+     *
+     * Log entries with timestamps that are more than the
+     * [logs retention period](https://cloud.google.com/logging/quotas) in
+     * the past or more than 24 hours in the future will not be available when
+     * calling `entries.list`. However, those log entries can still be [exported
+     * with
+     * LogSinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs).
+     *
+     * To improve throughput and to avoid exceeding the
+     * [quota limit](https://cloud.google.com/logging/quotas) for calls to
+     * `entries.write`, you should try to include several log entries in this
+     * list, rather than calling this method for each individual log entry.
+     * 
+ * + * + * repeated .google.logging.v2.LogEntry entries = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public int getEntriesCount() { + if (entriesBuilder_ == null) { + return entries_.size(); + } else { + return entriesBuilder_.getCount(); + } + } + + /** + * + * + *
+     * Required. The log entries to send to Logging. The order of log
+     * entries in this list does not matter. Values supplied in this method's
+     * `log_name`, `resource`, and `labels` fields are copied into those log
+     * entries in this list that do not include values for their corresponding
+     * fields. For more information, see the
+     * [LogEntry][google.logging.v2.LogEntry] type.
+     *
+     * If the `timestamp` or `insert_id` fields are missing in log entries, then
+     * this method supplies the current time or a unique identifier, respectively.
+     * The supplied values are chosen so that, among the log entries that did not
+     * supply their own values, the entries earlier in the list will sort before
+     * the entries later in the list. See the `entries.list` method.
+     *
+     * Log entries with timestamps that are more than the
+     * [logs retention period](https://cloud.google.com/logging/quotas) in
+     * the past or more than 24 hours in the future will not be available when
+     * calling `entries.list`. However, those log entries can still be [exported
+     * with
+     * LogSinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs).
+     *
+     * To improve throughput and to avoid exceeding the
+     * [quota limit](https://cloud.google.com/logging/quotas) for calls to
+     * `entries.write`, you should try to include several log entries in this
+     * list, rather than calling this method for each individual log entry.
+     * 
+ * + * + * repeated .google.logging.v2.LogEntry entries = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.logging.v2.LogEntry getEntries(int index) { + if (entriesBuilder_ == null) { + return entries_.get(index); + } else { + return entriesBuilder_.getMessage(index); + } + } + + /** + * + * + *
+     * Required. The log entries to send to Logging. The order of log
+     * entries in this list does not matter. Values supplied in this method's
+     * `log_name`, `resource`, and `labels` fields are copied into those log
+     * entries in this list that do not include values for their corresponding
+     * fields. For more information, see the
+     * [LogEntry][google.logging.v2.LogEntry] type.
+     *
+     * If the `timestamp` or `insert_id` fields are missing in log entries, then
+     * this method supplies the current time or a unique identifier, respectively.
+     * The supplied values are chosen so that, among the log entries that did not
+     * supply their own values, the entries earlier in the list will sort before
+     * the entries later in the list. See the `entries.list` method.
+     *
+     * Log entries with timestamps that are more than the
+     * [logs retention period](https://cloud.google.com/logging/quotas) in
+     * the past or more than 24 hours in the future will not be available when
+     * calling `entries.list`. However, those log entries can still be [exported
+     * with
+     * LogSinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs).
+     *
+     * To improve throughput and to avoid exceeding the
+     * [quota limit](https://cloud.google.com/logging/quotas) for calls to
+     * `entries.write`, you should try to include several log entries in this
+     * list, rather than calling this method for each individual log entry.
+     * 
+ * + * + * repeated .google.logging.v2.LogEntry entries = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setEntries(int index, com.google.logging.v2.LogEntry value) { + if (entriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEntriesIsMutable(); + entries_.set(index, value); + onChanged(); + } else { + entriesBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Required. The log entries to send to Logging. The order of log
+     * entries in this list does not matter. Values supplied in this method's
+     * `log_name`, `resource`, and `labels` fields are copied into those log
+     * entries in this list that do not include values for their corresponding
+     * fields. For more information, see the
+     * [LogEntry][google.logging.v2.LogEntry] type.
+     *
+     * If the `timestamp` or `insert_id` fields are missing in log entries, then
+     * this method supplies the current time or a unique identifier, respectively.
+     * The supplied values are chosen so that, among the log entries that did not
+     * supply their own values, the entries earlier in the list will sort before
+     * the entries later in the list. See the `entries.list` method.
+     *
+     * Log entries with timestamps that are more than the
+     * [logs retention period](https://cloud.google.com/logging/quotas) in
+     * the past or more than 24 hours in the future will not be available when
+     * calling `entries.list`. However, those log entries can still be [exported
+     * with
+     * LogSinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs).
+     *
+     * To improve throughput and to avoid exceeding the
+     * [quota limit](https://cloud.google.com/logging/quotas) for calls to
+     * `entries.write`, you should try to include several log entries in this
+     * list, rather than calling this method for each individual log entry.
+     * 
+ * + * + * repeated .google.logging.v2.LogEntry entries = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setEntries(int index, com.google.logging.v2.LogEntry.Builder builderForValue) { + if (entriesBuilder_ == null) { + ensureEntriesIsMutable(); + entries_.set(index, builderForValue.build()); + onChanged(); + } else { + entriesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Required. The log entries to send to Logging. The order of log
+     * entries in this list does not matter. Values supplied in this method's
+     * `log_name`, `resource`, and `labels` fields are copied into those log
+     * entries in this list that do not include values for their corresponding
+     * fields. For more information, see the
+     * [LogEntry][google.logging.v2.LogEntry] type.
+     *
+     * If the `timestamp` or `insert_id` fields are missing in log entries, then
+     * this method supplies the current time or a unique identifier, respectively.
+     * The supplied values are chosen so that, among the log entries that did not
+     * supply their own values, the entries earlier in the list will sort before
+     * the entries later in the list. See the `entries.list` method.
+     *
+     * Log entries with timestamps that are more than the
+     * [logs retention period](https://cloud.google.com/logging/quotas) in
+     * the past or more than 24 hours in the future will not be available when
+     * calling `entries.list`. However, those log entries can still be [exported
+     * with
+     * LogSinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs).
+     *
+     * To improve throughput and to avoid exceeding the
+     * [quota limit](https://cloud.google.com/logging/quotas) for calls to
+     * `entries.write`, you should try to include several log entries in this
+     * list, rather than calling this method for each individual log entry.
+     * 
+ * + * + * repeated .google.logging.v2.LogEntry entries = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addEntries(com.google.logging.v2.LogEntry value) { + if (entriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEntriesIsMutable(); + entries_.add(value); + onChanged(); + } else { + entriesBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+     * Required. The log entries to send to Logging. The order of log
+     * entries in this list does not matter. Values supplied in this method's
+     * `log_name`, `resource`, and `labels` fields are copied into those log
+     * entries in this list that do not include values for their corresponding
+     * fields. For more information, see the
+     * [LogEntry][google.logging.v2.LogEntry] type.
+     *
+     * If the `timestamp` or `insert_id` fields are missing in log entries, then
+     * this method supplies the current time or a unique identifier, respectively.
+     * The supplied values are chosen so that, among the log entries that did not
+     * supply their own values, the entries earlier in the list will sort before
+     * the entries later in the list. See the `entries.list` method.
+     *
+     * Log entries with timestamps that are more than the
+     * [logs retention period](https://cloud.google.com/logging/quotas) in
+     * the past or more than 24 hours in the future will not be available when
+     * calling `entries.list`. However, those log entries can still be [exported
+     * with
+     * LogSinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs).
+     *
+     * To improve throughput and to avoid exceeding the
+     * [quota limit](https://cloud.google.com/logging/quotas) for calls to
+     * `entries.write`, you should try to include several log entries in this
+     * list, rather than calling this method for each individual log entry.
+     * 
+ * + * + * repeated .google.logging.v2.LogEntry entries = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addEntries(int index, com.google.logging.v2.LogEntry value) { + if (entriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEntriesIsMutable(); + entries_.add(index, value); + onChanged(); + } else { + entriesBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+     * Required. The log entries to send to Logging. The order of log
+     * entries in this list does not matter. Values supplied in this method's
+     * `log_name`, `resource`, and `labels` fields are copied into those log
+     * entries in this list that do not include values for their corresponding
+     * fields. For more information, see the
+     * [LogEntry][google.logging.v2.LogEntry] type.
+     *
+     * If the `timestamp` or `insert_id` fields are missing in log entries, then
+     * this method supplies the current time or a unique identifier, respectively.
+     * The supplied values are chosen so that, among the log entries that did not
+     * supply their own values, the entries earlier in the list will sort before
+     * the entries later in the list. See the `entries.list` method.
+     *
+     * Log entries with timestamps that are more than the
+     * [logs retention period](https://cloud.google.com/logging/quotas) in
+     * the past or more than 24 hours in the future will not be available when
+     * calling `entries.list`. However, those log entries can still be [exported
+     * with
+     * LogSinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs).
+     *
+     * To improve throughput and to avoid exceeding the
+     * [quota limit](https://cloud.google.com/logging/quotas) for calls to
+     * `entries.write`, you should try to include several log entries in this
+     * list, rather than calling this method for each individual log entry.
+     * 
+ * + * + * repeated .google.logging.v2.LogEntry entries = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addEntries(com.google.logging.v2.LogEntry.Builder builderForValue) { + if (entriesBuilder_ == null) { + ensureEntriesIsMutable(); + entries_.add(builderForValue.build()); + onChanged(); + } else { + entriesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Required. The log entries to send to Logging. The order of log
+     * entries in this list does not matter. Values supplied in this method's
+     * `log_name`, `resource`, and `labels` fields are copied into those log
+     * entries in this list that do not include values for their corresponding
+     * fields. For more information, see the
+     * [LogEntry][google.logging.v2.LogEntry] type.
+     *
+     * If the `timestamp` or `insert_id` fields are missing in log entries, then
+     * this method supplies the current time or a unique identifier, respectively.
+     * The supplied values are chosen so that, among the log entries that did not
+     * supply their own values, the entries earlier in the list will sort before
+     * the entries later in the list. See the `entries.list` method.
+     *
+     * Log entries with timestamps that are more than the
+     * [logs retention period](https://cloud.google.com/logging/quotas) in
+     * the past or more than 24 hours in the future will not be available when
+     * calling `entries.list`. However, those log entries can still be [exported
+     * with
+     * LogSinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs).
+     *
+     * To improve throughput and to avoid exceeding the
+     * [quota limit](https://cloud.google.com/logging/quotas) for calls to
+     * `entries.write`, you should try to include several log entries in this
+     * list, rather than calling this method for each individual log entry.
+     * 
+ * + * + * repeated .google.logging.v2.LogEntry entries = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addEntries(int index, com.google.logging.v2.LogEntry.Builder builderForValue) { + if (entriesBuilder_ == null) { + ensureEntriesIsMutable(); + entries_.add(index, builderForValue.build()); + onChanged(); + } else { + entriesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+     * Required. The log entries to send to Logging. The order of log
+     * entries in this list does not matter. Values supplied in this method's
+     * `log_name`, `resource`, and `labels` fields are copied into those log
+     * entries in this list that do not include values for their corresponding
+     * fields. For more information, see the
+     * [LogEntry][google.logging.v2.LogEntry] type.
+     *
+     * If the `timestamp` or `insert_id` fields are missing in log entries, then
+     * this method supplies the current time or a unique identifier, respectively.
+     * The supplied values are chosen so that, among the log entries that did not
+     * supply their own values, the entries earlier in the list will sort before
+     * the entries later in the list. See the `entries.list` method.
+     *
+     * Log entries with timestamps that are more than the
+     * [logs retention period](https://cloud.google.com/logging/quotas) in
+     * the past or more than 24 hours in the future will not be available when
+     * calling `entries.list`. However, those log entries can still be [exported
+     * with
+     * LogSinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs).
+     *
+     * To improve throughput and to avoid exceeding the
+     * [quota limit](https://cloud.google.com/logging/quotas) for calls to
+     * `entries.write`, you should try to include several log entries in this
+     * list, rather than calling this method for each individual log entry.
+     * 
+ * + * + * repeated .google.logging.v2.LogEntry entries = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addAllEntries( + java.lang.Iterable values) { + if (entriesBuilder_ == null) { + ensureEntriesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, entries_); + onChanged(); + } else { + entriesBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+     * Required. The log entries to send to Logging. The order of log
+     * entries in this list does not matter. Values supplied in this method's
+     * `log_name`, `resource`, and `labels` fields are copied into those log
+     * entries in this list that do not include values for their corresponding
+     * fields. For more information, see the
+     * [LogEntry][google.logging.v2.LogEntry] type.
+     *
+     * If the `timestamp` or `insert_id` fields are missing in log entries, then
+     * this method supplies the current time or a unique identifier, respectively.
+     * The supplied values are chosen so that, among the log entries that did not
+     * supply their own values, the entries earlier in the list will sort before
+     * the entries later in the list. See the `entries.list` method.
+     *
+     * Log entries with timestamps that are more than the
+     * [logs retention period](https://cloud.google.com/logging/quotas) in
+     * the past or more than 24 hours in the future will not be available when
+     * calling `entries.list`. However, those log entries can still be [exported
+     * with
+     * LogSinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs).
+     *
+     * To improve throughput and to avoid exceeding the
+     * [quota limit](https://cloud.google.com/logging/quotas) for calls to
+     * `entries.write`, you should try to include several log entries in this
+     * list, rather than calling this method for each individual log entry.
+     * 
+ * + * + * repeated .google.logging.v2.LogEntry entries = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearEntries() { + if (entriesBuilder_ == null) { + entries_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + entriesBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+     * Required. The log entries to send to Logging. The order of log
+     * entries in this list does not matter. Values supplied in this method's
+     * `log_name`, `resource`, and `labels` fields are copied into those log
+     * entries in this list that do not include values for their corresponding
+     * fields. For more information, see the
+     * [LogEntry][google.logging.v2.LogEntry] type.
+     *
+     * If the `timestamp` or `insert_id` fields are missing in log entries, then
+     * this method supplies the current time or a unique identifier, respectively.
+     * The supplied values are chosen so that, among the log entries that did not
+     * supply their own values, the entries earlier in the list will sort before
+     * the entries later in the list. See the `entries.list` method.
+     *
+     * Log entries with timestamps that are more than the
+     * [logs retention period](https://cloud.google.com/logging/quotas) in
+     * the past or more than 24 hours in the future will not be available when
+     * calling `entries.list`. However, those log entries can still be [exported
+     * with
+     * LogSinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs).
+     *
+     * To improve throughput and to avoid exceeding the
+     * [quota limit](https://cloud.google.com/logging/quotas) for calls to
+     * `entries.write`, you should try to include several log entries in this
+     * list, rather than calling this method for each individual log entry.
+     * 
+ * + * + * repeated .google.logging.v2.LogEntry entries = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder removeEntries(int index) { + if (entriesBuilder_ == null) { + ensureEntriesIsMutable(); + entries_.remove(index); + onChanged(); + } else { + entriesBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+     * Required. The log entries to send to Logging. The order of log
+     * entries in this list does not matter. Values supplied in this method's
+     * `log_name`, `resource`, and `labels` fields are copied into those log
+     * entries in this list that do not include values for their corresponding
+     * fields. For more information, see the
+     * [LogEntry][google.logging.v2.LogEntry] type.
+     *
+     * If the `timestamp` or `insert_id` fields are missing in log entries, then
+     * this method supplies the current time or a unique identifier, respectively.
+     * The supplied values are chosen so that, among the log entries that did not
+     * supply their own values, the entries earlier in the list will sort before
+     * the entries later in the list. See the `entries.list` method.
+     *
+     * Log entries with timestamps that are more than the
+     * [logs retention period](https://cloud.google.com/logging/quotas) in
+     * the past or more than 24 hours in the future will not be available when
+     * calling `entries.list`. However, those log entries can still be [exported
+     * with
+     * LogSinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs).
+     *
+     * To improve throughput and to avoid exceeding the
+     * [quota limit](https://cloud.google.com/logging/quotas) for calls to
+     * `entries.write`, you should try to include several log entries in this
+     * list, rather than calling this method for each individual log entry.
+     * 
+ * + * + * repeated .google.logging.v2.LogEntry entries = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.logging.v2.LogEntry.Builder getEntriesBuilder(int index) { + return getEntriesFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+     * Required. The log entries to send to Logging. The order of log
+     * entries in this list does not matter. Values supplied in this method's
+     * `log_name`, `resource`, and `labels` fields are copied into those log
+     * entries in this list that do not include values for their corresponding
+     * fields. For more information, see the
+     * [LogEntry][google.logging.v2.LogEntry] type.
+     *
+     * If the `timestamp` or `insert_id` fields are missing in log entries, then
+     * this method supplies the current time or a unique identifier, respectively.
+     * The supplied values are chosen so that, among the log entries that did not
+     * supply their own values, the entries earlier in the list will sort before
+     * the entries later in the list. See the `entries.list` method.
+     *
+     * Log entries with timestamps that are more than the
+     * [logs retention period](https://cloud.google.com/logging/quotas) in
+     * the past or more than 24 hours in the future will not be available when
+     * calling `entries.list`. However, those log entries can still be [exported
+     * with
+     * LogSinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs).
+     *
+     * To improve throughput and to avoid exceeding the
+     * [quota limit](https://cloud.google.com/logging/quotas) for calls to
+     * `entries.write`, you should try to include several log entries in this
+     * list, rather than calling this method for each individual log entry.
+     * 
+ * + * + * repeated .google.logging.v2.LogEntry entries = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.logging.v2.LogEntryOrBuilder getEntriesOrBuilder(int index) { + if (entriesBuilder_ == null) { + return entries_.get(index); + } else { + return entriesBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+     * Required. The log entries to send to Logging. The order of log
+     * entries in this list does not matter. Values supplied in this method's
+     * `log_name`, `resource`, and `labels` fields are copied into those log
+     * entries in this list that do not include values for their corresponding
+     * fields. For more information, see the
+     * [LogEntry][google.logging.v2.LogEntry] type.
+     *
+     * If the `timestamp` or `insert_id` fields are missing in log entries, then
+     * this method supplies the current time or a unique identifier, respectively.
+     * The supplied values are chosen so that, among the log entries that did not
+     * supply their own values, the entries earlier in the list will sort before
+     * the entries later in the list. See the `entries.list` method.
+     *
+     * Log entries with timestamps that are more than the
+     * [logs retention period](https://cloud.google.com/logging/quotas) in
+     * the past or more than 24 hours in the future will not be available when
+     * calling `entries.list`. However, those log entries can still be [exported
+     * with
+     * LogSinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs).
+     *
+     * To improve throughput and to avoid exceeding the
+     * [quota limit](https://cloud.google.com/logging/quotas) for calls to
+     * `entries.write`, you should try to include several log entries in this
+     * list, rather than calling this method for each individual log entry.
+     * 
+ * + * + * repeated .google.logging.v2.LogEntry entries = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getEntriesOrBuilderList() { + if (entriesBuilder_ != null) { + return entriesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(entries_); + } + } + + /** + * + * + *
+     * Required. The log entries to send to Logging. The order of log
+     * entries in this list does not matter. Values supplied in this method's
+     * `log_name`, `resource`, and `labels` fields are copied into those log
+     * entries in this list that do not include values for their corresponding
+     * fields. For more information, see the
+     * [LogEntry][google.logging.v2.LogEntry] type.
+     *
+     * If the `timestamp` or `insert_id` fields are missing in log entries, then
+     * this method supplies the current time or a unique identifier, respectively.
+     * The supplied values are chosen so that, among the log entries that did not
+     * supply their own values, the entries earlier in the list will sort before
+     * the entries later in the list. See the `entries.list` method.
+     *
+     * Log entries with timestamps that are more than the
+     * [logs retention period](https://cloud.google.com/logging/quotas) in
+     * the past or more than 24 hours in the future will not be available when
+     * calling `entries.list`. However, those log entries can still be [exported
+     * with
+     * LogSinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs).
+     *
+     * To improve throughput and to avoid exceeding the
+     * [quota limit](https://cloud.google.com/logging/quotas) for calls to
+     * `entries.write`, you should try to include several log entries in this
+     * list, rather than calling this method for each individual log entry.
+     * 
+ * + * + * repeated .google.logging.v2.LogEntry entries = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.logging.v2.LogEntry.Builder addEntriesBuilder() { + return getEntriesFieldBuilder() + .addBuilder(com.google.logging.v2.LogEntry.getDefaultInstance()); + } + + /** + * + * + *
+     * Required. The log entries to send to Logging. The order of log
+     * entries in this list does not matter. Values supplied in this method's
+     * `log_name`, `resource`, and `labels` fields are copied into those log
+     * entries in this list that do not include values for their corresponding
+     * fields. For more information, see the
+     * [LogEntry][google.logging.v2.LogEntry] type.
+     *
+     * If the `timestamp` or `insert_id` fields are missing in log entries, then
+     * this method supplies the current time or a unique identifier, respectively.
+     * The supplied values are chosen so that, among the log entries that did not
+     * supply their own values, the entries earlier in the list will sort before
+     * the entries later in the list. See the `entries.list` method.
+     *
+     * Log entries with timestamps that are more than the
+     * [logs retention period](https://cloud.google.com/logging/quotas) in
+     * the past or more than 24 hours in the future will not be available when
+     * calling `entries.list`. However, those log entries can still be [exported
+     * with
+     * LogSinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs).
+     *
+     * To improve throughput and to avoid exceeding the
+     * [quota limit](https://cloud.google.com/logging/quotas) for calls to
+     * `entries.write`, you should try to include several log entries in this
+     * list, rather than calling this method for each individual log entry.
+     * 
+ * + * + * repeated .google.logging.v2.LogEntry entries = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.logging.v2.LogEntry.Builder addEntriesBuilder(int index) { + return getEntriesFieldBuilder() + .addBuilder(index, com.google.logging.v2.LogEntry.getDefaultInstance()); + } + + /** + * + * + *
+     * Required. The log entries to send to Logging. The order of log
+     * entries in this list does not matter. Values supplied in this method's
+     * `log_name`, `resource`, and `labels` fields are copied into those log
+     * entries in this list that do not include values for their corresponding
+     * fields. For more information, see the
+     * [LogEntry][google.logging.v2.LogEntry] type.
+     *
+     * If the `timestamp` or `insert_id` fields are missing in log entries, then
+     * this method supplies the current time or a unique identifier, respectively.
+     * The supplied values are chosen so that, among the log entries that did not
+     * supply their own values, the entries earlier in the list will sort before
+     * the entries later in the list. See the `entries.list` method.
+     *
+     * Log entries with timestamps that are more than the
+     * [logs retention period](https://cloud.google.com/logging/quotas) in
+     * the past or more than 24 hours in the future will not be available when
+     * calling `entries.list`. However, those log entries can still be [exported
+     * with
+     * LogSinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs).
+     *
+     * To improve throughput and to avoid exceeding the
+     * [quota limit](https://cloud.google.com/logging/quotas) for calls to
+     * `entries.write`, you should try to include several log entries in this
+     * list, rather than calling this method for each individual log entry.
+     * 
+ * + * + * repeated .google.logging.v2.LogEntry entries = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List getEntriesBuilderList() { + return getEntriesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.logging.v2.LogEntry, + com.google.logging.v2.LogEntry.Builder, + com.google.logging.v2.LogEntryOrBuilder> + getEntriesFieldBuilder() { + if (entriesBuilder_ == null) { + entriesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.logging.v2.LogEntry, + com.google.logging.v2.LogEntry.Builder, + com.google.logging.v2.LogEntryOrBuilder>( + entries_, ((bitField0_ & 0x00000008) != 0), getParentForChildren(), isClean()); + entries_ = null; + } + return entriesBuilder_; + } + + private boolean partialSuccess_; + + /** + * + * + *
+     * Optional. Whether a batch's valid entries should be written even if some
+     * other entry failed due to a permanent error such as INVALID_ARGUMENT or
+     * PERMISSION_DENIED. If any entry failed, then the response status is the
+     * response status of one of the failed entries. The response will include
+     * error details in `WriteLogEntriesPartialErrors.log_entry_errors` keyed by
+     * the entries' zero-based index in the `entries`. Failed requests for which
+     * no entries are written will not include per-entry errors.
+     * 
+ * + * bool partial_success = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The partialSuccess. + */ + @java.lang.Override + public boolean getPartialSuccess() { + return partialSuccess_; + } + + /** + * + * + *
+     * Optional. Whether a batch's valid entries should be written even if some
+     * other entry failed due to a permanent error such as INVALID_ARGUMENT or
+     * PERMISSION_DENIED. If any entry failed, then the response status is the
+     * response status of one of the failed entries. The response will include
+     * error details in `WriteLogEntriesPartialErrors.log_entry_errors` keyed by
+     * the entries' zero-based index in the `entries`. Failed requests for which
+     * no entries are written will not include per-entry errors.
+     * 
+ * + * bool partial_success = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The partialSuccess to set. + * @return This builder for chaining. + */ + public Builder setPartialSuccess(boolean value) { + + partialSuccess_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. Whether a batch's valid entries should be written even if some
+     * other entry failed due to a permanent error such as INVALID_ARGUMENT or
+     * PERMISSION_DENIED. If any entry failed, then the response status is the
+     * response status of one of the failed entries. The response will include
+     * error details in `WriteLogEntriesPartialErrors.log_entry_errors` keyed by
+     * the entries' zero-based index in the `entries`. Failed requests for which
+     * no entries are written will not include per-entry errors.
+     * 
+ * + * bool partial_success = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPartialSuccess() { + bitField0_ = (bitField0_ & ~0x00000010); + partialSuccess_ = false; + onChanged(); + return this; + } + + private boolean dryRun_; + + /** + * + * + *
+     * Optional. If true, the request should expect normal response, but the
+     * entries won't be persisted nor exported. Useful for checking whether the
+     * logging API endpoints are working properly before sending valuable data.
+     * 
+ * + * bool dry_run = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The dryRun. + */ + @java.lang.Override + public boolean getDryRun() { + return dryRun_; + } + + /** + * + * + *
+     * Optional. If true, the request should expect normal response, but the
+     * entries won't be persisted nor exported. Useful for checking whether the
+     * logging API endpoints are working properly before sending valuable data.
+     * 
+ * + * bool dry_run = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The dryRun to set. + * @return This builder for chaining. + */ + public Builder setDryRun(boolean value) { + + dryRun_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional. If true, the request should expect normal response, but the
+     * entries won't be persisted nor exported. Useful for checking whether the
+     * logging API endpoints are working properly before sending valuable data.
+     * 
+ * + * bool dry_run = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDryRun() { + bitField0_ = (bitField0_ & ~0x00000020); + dryRun_ = 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.logging.v2.WriteLogEntriesRequest) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.WriteLogEntriesRequest) + private static final com.google.logging.v2.WriteLogEntriesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.WriteLogEntriesRequest(); + } + + public static com.google.logging.v2.WriteLogEntriesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public WriteLogEntriesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.WriteLogEntriesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/WriteLogEntriesRequestOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/WriteLogEntriesRequestOrBuilder.java new file mode 100644 index 000000000000..6750e665f451 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/WriteLogEntriesRequestOrBuilder.java @@ -0,0 +1,441 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface WriteLogEntriesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.WriteLogEntriesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. A default log resource name that is assigned to all log entries
+   * in `entries` that do not specify a value for `log_name`:
+   *
+   * * `projects/[PROJECT_ID]/logs/[LOG_ID]`
+   * * `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]`
+   * * `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]`
+   * * `folders/[FOLDER_ID]/logs/[LOG_ID]`
+   *
+   * `[LOG_ID]` must be URL-encoded. For example:
+   *
+   *     "projects/my-project-id/logs/syslog"
+   *     "organizations/123/logs/cloudaudit.googleapis.com%2Factivity"
+   *
+   * The permission `logging.logEntries.create` is needed on each project,
+   * organization, billing account, or folder that is receiving new log
+   * entries, whether the resource is specified in `logName` or in an
+   * individual log entry.
+   * 
+ * + * + * string log_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The logName. + */ + java.lang.String getLogName(); + + /** + * + * + *
+   * Optional. A default log resource name that is assigned to all log entries
+   * in `entries` that do not specify a value for `log_name`:
+   *
+   * * `projects/[PROJECT_ID]/logs/[LOG_ID]`
+   * * `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]`
+   * * `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]`
+   * * `folders/[FOLDER_ID]/logs/[LOG_ID]`
+   *
+   * `[LOG_ID]` must be URL-encoded. For example:
+   *
+   *     "projects/my-project-id/logs/syslog"
+   *     "organizations/123/logs/cloudaudit.googleapis.com%2Factivity"
+   *
+   * The permission `logging.logEntries.create` is needed on each project,
+   * organization, billing account, or folder that is receiving new log
+   * entries, whether the resource is specified in `logName` or in an
+   * individual log entry.
+   * 
+ * + * + * string log_name = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for logName. + */ + com.google.protobuf.ByteString getLogNameBytes(); + + /** + * + * + *
+   * Optional. A default monitored resource object that is assigned to all log
+   * entries in `entries` that do not specify a value for `resource`. Example:
+   *
+   *     { "type": "gce_instance",
+   *       "labels": {
+   *         "zone": "us-central1-a", "instance_id": "00000000000000000000" }}
+   *
+   * See [LogEntry][google.logging.v2.LogEntry].
+   * 
+ * + * .google.api.MonitoredResource resource = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the resource field is set. + */ + boolean hasResource(); + + /** + * + * + *
+   * Optional. A default monitored resource object that is assigned to all log
+   * entries in `entries` that do not specify a value for `resource`. Example:
+   *
+   *     { "type": "gce_instance",
+   *       "labels": {
+   *         "zone": "us-central1-a", "instance_id": "00000000000000000000" }}
+   *
+   * See [LogEntry][google.logging.v2.LogEntry].
+   * 
+ * + * .google.api.MonitoredResource resource = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The resource. + */ + com.google.api.MonitoredResource getResource(); + + /** + * + * + *
+   * Optional. A default monitored resource object that is assigned to all log
+   * entries in `entries` that do not specify a value for `resource`. Example:
+   *
+   *     { "type": "gce_instance",
+   *       "labels": {
+   *         "zone": "us-central1-a", "instance_id": "00000000000000000000" }}
+   *
+   * See [LogEntry][google.logging.v2.LogEntry].
+   * 
+ * + * .google.api.MonitoredResource resource = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.api.MonitoredResourceOrBuilder getResourceOrBuilder(); + + /** + * + * + *
+   * Optional. Default labels that are added to the `labels` field of all log
+   * entries in `entries`. If a log entry already has a label with the same key
+   * as a label in this parameter, then the log entry's label is not changed.
+   * See [LogEntry][google.logging.v2.LogEntry].
+   * 
+ * + * map<string, string> labels = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + int getLabelsCount(); + + /** + * + * + *
+   * Optional. Default labels that are added to the `labels` field of all log
+   * entries in `entries`. If a log entry already has a label with the same key
+   * as a label in this parameter, then the log entry's label is not changed.
+   * See [LogEntry][google.logging.v2.LogEntry].
+   * 
+ * + * map<string, string> labels = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + boolean containsLabels(java.lang.String key); + + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + + /** + * + * + *
+   * Optional. Default labels that are added to the `labels` field of all log
+   * entries in `entries`. If a log entry already has a label with the same key
+   * as a label in this parameter, then the log entry's label is not changed.
+   * See [LogEntry][google.logging.v2.LogEntry].
+   * 
+ * + * map<string, string> labels = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + java.util.Map getLabelsMap(); + + /** + * + * + *
+   * Optional. Default labels that are added to the `labels` field of all log
+   * entries in `entries`. If a log entry already has a label with the same key
+   * as a label in this parameter, then the log entry's label is not changed.
+   * See [LogEntry][google.logging.v2.LogEntry].
+   * 
+ * + * map<string, string> labels = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + /* nullable */ + java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + + /** + * + * + *
+   * Optional. Default labels that are added to the `labels` field of all log
+   * entries in `entries`. If a log entry already has a label with the same key
+   * as a label in this parameter, then the log entry's label is not changed.
+   * See [LogEntry][google.logging.v2.LogEntry].
+   * 
+ * + * map<string, string> labels = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Required. The log entries to send to Logging. The order of log
+   * entries in this list does not matter. Values supplied in this method's
+   * `log_name`, `resource`, and `labels` fields are copied into those log
+   * entries in this list that do not include values for their corresponding
+   * fields. For more information, see the
+   * [LogEntry][google.logging.v2.LogEntry] type.
+   *
+   * If the `timestamp` or `insert_id` fields are missing in log entries, then
+   * this method supplies the current time or a unique identifier, respectively.
+   * The supplied values are chosen so that, among the log entries that did not
+   * supply their own values, the entries earlier in the list will sort before
+   * the entries later in the list. See the `entries.list` method.
+   *
+   * Log entries with timestamps that are more than the
+   * [logs retention period](https://cloud.google.com/logging/quotas) in
+   * the past or more than 24 hours in the future will not be available when
+   * calling `entries.list`. However, those log entries can still be [exported
+   * with
+   * LogSinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs).
+   *
+   * To improve throughput and to avoid exceeding the
+   * [quota limit](https://cloud.google.com/logging/quotas) for calls to
+   * `entries.write`, you should try to include several log entries in this
+   * list, rather than calling this method for each individual log entry.
+   * 
+ * + * + * repeated .google.logging.v2.LogEntry entries = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List getEntriesList(); + + /** + * + * + *
+   * Required. The log entries to send to Logging. The order of log
+   * entries in this list does not matter. Values supplied in this method's
+   * `log_name`, `resource`, and `labels` fields are copied into those log
+   * entries in this list that do not include values for their corresponding
+   * fields. For more information, see the
+   * [LogEntry][google.logging.v2.LogEntry] type.
+   *
+   * If the `timestamp` or `insert_id` fields are missing in log entries, then
+   * this method supplies the current time or a unique identifier, respectively.
+   * The supplied values are chosen so that, among the log entries that did not
+   * supply their own values, the entries earlier in the list will sort before
+   * the entries later in the list. See the `entries.list` method.
+   *
+   * Log entries with timestamps that are more than the
+   * [logs retention period](https://cloud.google.com/logging/quotas) in
+   * the past or more than 24 hours in the future will not be available when
+   * calling `entries.list`. However, those log entries can still be [exported
+   * with
+   * LogSinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs).
+   *
+   * To improve throughput and to avoid exceeding the
+   * [quota limit](https://cloud.google.com/logging/quotas) for calls to
+   * `entries.write`, you should try to include several log entries in this
+   * list, rather than calling this method for each individual log entry.
+   * 
+ * + * + * repeated .google.logging.v2.LogEntry entries = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.logging.v2.LogEntry getEntries(int index); + + /** + * + * + *
+   * Required. The log entries to send to Logging. The order of log
+   * entries in this list does not matter. Values supplied in this method's
+   * `log_name`, `resource`, and `labels` fields are copied into those log
+   * entries in this list that do not include values for their corresponding
+   * fields. For more information, see the
+   * [LogEntry][google.logging.v2.LogEntry] type.
+   *
+   * If the `timestamp` or `insert_id` fields are missing in log entries, then
+   * this method supplies the current time or a unique identifier, respectively.
+   * The supplied values are chosen so that, among the log entries that did not
+   * supply their own values, the entries earlier in the list will sort before
+   * the entries later in the list. See the `entries.list` method.
+   *
+   * Log entries with timestamps that are more than the
+   * [logs retention period](https://cloud.google.com/logging/quotas) in
+   * the past or more than 24 hours in the future will not be available when
+   * calling `entries.list`. However, those log entries can still be [exported
+   * with
+   * LogSinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs).
+   *
+   * To improve throughput and to avoid exceeding the
+   * [quota limit](https://cloud.google.com/logging/quotas) for calls to
+   * `entries.write`, you should try to include several log entries in this
+   * list, rather than calling this method for each individual log entry.
+   * 
+ * + * + * repeated .google.logging.v2.LogEntry entries = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + int getEntriesCount(); + + /** + * + * + *
+   * Required. The log entries to send to Logging. The order of log
+   * entries in this list does not matter. Values supplied in this method's
+   * `log_name`, `resource`, and `labels` fields are copied into those log
+   * entries in this list that do not include values for their corresponding
+   * fields. For more information, see the
+   * [LogEntry][google.logging.v2.LogEntry] type.
+   *
+   * If the `timestamp` or `insert_id` fields are missing in log entries, then
+   * this method supplies the current time or a unique identifier, respectively.
+   * The supplied values are chosen so that, among the log entries that did not
+   * supply their own values, the entries earlier in the list will sort before
+   * the entries later in the list. See the `entries.list` method.
+   *
+   * Log entries with timestamps that are more than the
+   * [logs retention period](https://cloud.google.com/logging/quotas) in
+   * the past or more than 24 hours in the future will not be available when
+   * calling `entries.list`. However, those log entries can still be [exported
+   * with
+   * LogSinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs).
+   *
+   * To improve throughput and to avoid exceeding the
+   * [quota limit](https://cloud.google.com/logging/quotas) for calls to
+   * `entries.write`, you should try to include several log entries in this
+   * list, rather than calling this method for each individual log entry.
+   * 
+ * + * + * repeated .google.logging.v2.LogEntry entries = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List getEntriesOrBuilderList(); + + /** + * + * + *
+   * Required. The log entries to send to Logging. The order of log
+   * entries in this list does not matter. Values supplied in this method's
+   * `log_name`, `resource`, and `labels` fields are copied into those log
+   * entries in this list that do not include values for their corresponding
+   * fields. For more information, see the
+   * [LogEntry][google.logging.v2.LogEntry] type.
+   *
+   * If the `timestamp` or `insert_id` fields are missing in log entries, then
+   * this method supplies the current time or a unique identifier, respectively.
+   * The supplied values are chosen so that, among the log entries that did not
+   * supply their own values, the entries earlier in the list will sort before
+   * the entries later in the list. See the `entries.list` method.
+   *
+   * Log entries with timestamps that are more than the
+   * [logs retention period](https://cloud.google.com/logging/quotas) in
+   * the past or more than 24 hours in the future will not be available when
+   * calling `entries.list`. However, those log entries can still be [exported
+   * with
+   * LogSinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs).
+   *
+   * To improve throughput and to avoid exceeding the
+   * [quota limit](https://cloud.google.com/logging/quotas) for calls to
+   * `entries.write`, you should try to include several log entries in this
+   * list, rather than calling this method for each individual log entry.
+   * 
+ * + * + * repeated .google.logging.v2.LogEntry entries = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.logging.v2.LogEntryOrBuilder getEntriesOrBuilder(int index); + + /** + * + * + *
+   * Optional. Whether a batch's valid entries should be written even if some
+   * other entry failed due to a permanent error such as INVALID_ARGUMENT or
+   * PERMISSION_DENIED. If any entry failed, then the response status is the
+   * response status of one of the failed entries. The response will include
+   * error details in `WriteLogEntriesPartialErrors.log_entry_errors` keyed by
+   * the entries' zero-based index in the `entries`. Failed requests for which
+   * no entries are written will not include per-entry errors.
+   * 
+ * + * bool partial_success = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The partialSuccess. + */ + boolean getPartialSuccess(); + + /** + * + * + *
+   * Optional. If true, the request should expect normal response, but the
+   * entries won't be persisted nor exported. Useful for checking whether the
+   * logging API endpoints are working properly before sending valuable data.
+   * 
+ * + * bool dry_run = 6 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The dryRun. + */ + boolean getDryRun(); +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/WriteLogEntriesResponse.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/WriteLogEntriesResponse.java new file mode 100644 index 000000000000..25ff97e4164c --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/WriteLogEntriesResponse.java @@ -0,0 +1,433 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +/** + * + * + *
+ * Result returned from WriteLogEntries.
+ * 
+ * + * Protobuf type {@code google.logging.v2.WriteLogEntriesResponse} + */ +public final class WriteLogEntriesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.logging.v2.WriteLogEntriesResponse) + WriteLogEntriesResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use WriteLogEntriesResponse.newBuilder() to construct. + private WriteLogEntriesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private WriteLogEntriesResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new WriteLogEntriesResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_WriteLogEntriesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_WriteLogEntriesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.WriteLogEntriesResponse.class, + com.google.logging.v2.WriteLogEntriesResponse.Builder.class); + } + + 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 { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().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.logging.v2.WriteLogEntriesResponse)) { + return super.equals(obj); + } + com.google.logging.v2.WriteLogEntriesResponse other = + (com.google.logging.v2.WriteLogEntriesResponse) obj; + + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.logging.v2.WriteLogEntriesResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.WriteLogEntriesResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.WriteLogEntriesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.WriteLogEntriesResponse 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.logging.v2.WriteLogEntriesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.logging.v2.WriteLogEntriesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.logging.v2.WriteLogEntriesResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.WriteLogEntriesResponse 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.logging.v2.WriteLogEntriesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.logging.v2.WriteLogEntriesResponse 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.logging.v2.WriteLogEntriesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.logging.v2.WriteLogEntriesResponse 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.logging.v2.WriteLogEntriesResponse 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; + } + + /** + * + * + *
+   * Result returned from WriteLogEntries.
+   * 
+ * + * Protobuf type {@code google.logging.v2.WriteLogEntriesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.logging.v2.WriteLogEntriesResponse) + com.google.logging.v2.WriteLogEntriesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_WriteLogEntriesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_WriteLogEntriesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.logging.v2.WriteLogEntriesResponse.class, + com.google.logging.v2.WriteLogEntriesResponse.Builder.class); + } + + // Construct using com.google.logging.v2.WriteLogEntriesResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.logging.v2.LoggingProto + .internal_static_google_logging_v2_WriteLogEntriesResponse_descriptor; + } + + @java.lang.Override + public com.google.logging.v2.WriteLogEntriesResponse getDefaultInstanceForType() { + return com.google.logging.v2.WriteLogEntriesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.logging.v2.WriteLogEntriesResponse build() { + com.google.logging.v2.WriteLogEntriesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.logging.v2.WriteLogEntriesResponse buildPartial() { + com.google.logging.v2.WriteLogEntriesResponse result = + new com.google.logging.v2.WriteLogEntriesResponse(this); + 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.logging.v2.WriteLogEntriesResponse) { + return mergeFrom((com.google.logging.v2.WriteLogEntriesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.logging.v2.WriteLogEntriesResponse other) { + if (other == com.google.logging.v2.WriteLogEntriesResponse.getDefaultInstance()) return this; + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + 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.logging.v2.WriteLogEntriesResponse) + } + + // @@protoc_insertion_point(class_scope:google.logging.v2.WriteLogEntriesResponse) + private static final com.google.logging.v2.WriteLogEntriesResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.logging.v2.WriteLogEntriesResponse(); + } + + public static com.google.logging.v2.WriteLogEntriesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public WriteLogEntriesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.logging.v2.WriteLogEntriesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/WriteLogEntriesResponseOrBuilder.java b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/WriteLogEntriesResponseOrBuilder.java new file mode 100644 index 000000000000..1014a7596d58 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/WriteLogEntriesResponseOrBuilder.java @@ -0,0 +1,25 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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/logging/v2/logging.proto + +// Protobuf Java Version: 3.25.8 +package com.google.logging.v2; + +public interface WriteLogEntriesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.logging.v2.WriteLogEntriesResponse) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/proto/google/logging/v2/log_entry.proto b/java-logging/proto-google-cloud-logging-v2/src/main/proto/google/logging/v2/log_entry.proto new file mode 100644 index 000000000000..820b047b5735 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/proto/google/logging/v2/log_entry.proto @@ -0,0 +1,280 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.logging.v2; + +import "google/api/field_behavior.proto"; +import "google/api/monitored_resource.proto"; +import "google/api/resource.proto"; +import "google/logging/type/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 cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Logging.V2"; +option go_package = "cloud.google.com/go/logging/apiv2/loggingpb;loggingpb"; +option java_multiple_files = true; +option java_outer_classname = "LogEntryProto"; +option java_package = "com.google.logging.v2"; +option php_namespace = "Google\\Cloud\\Logging\\V2"; +option ruby_package = "Google::Cloud::Logging::V2"; + +// An individual entry in a log. +message LogEntry { + option (google.api.resource) = { + type: "logging.googleapis.com/Log" + pattern: "projects/{project}/logs/{log}" + pattern: "organizations/{organization}/logs/{log}" + pattern: "folders/{folder}/logs/{log}" + pattern: "billingAccounts/{billing_account}/logs/{log}" + name_field: "log_name" + }; + + // Required. The resource name of the log to which this log entry belongs: + // + // "projects/[PROJECT_ID]/logs/[LOG_ID]" + // "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" + // "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" + // "folders/[FOLDER_ID]/logs/[LOG_ID]" + // + // A project number may be used in place of PROJECT_ID. The project number is + // translated to its corresponding PROJECT_ID internally and the `log_name` + // field will contain PROJECT_ID in queries and exports. + // + // `[LOG_ID]` must be URL-encoded within `log_name`. Example: + // `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`. + // + // `[LOG_ID]` must be less than 512 characters long and can only include the + // following characters: upper and lower case alphanumeric characters, + // forward-slash, underscore, hyphen, and period. + // + // For backward compatibility, if `log_name` begins with a forward-slash, such + // as `/projects/...`, then the log entry is ingested as usual, but the + // forward-slash is removed. Listing the log entry will not show the leading + // slash and filtering for a log name with a leading slash will never return + // any results. + string log_name = 12 [(google.api.field_behavior) = REQUIRED]; + + // Required. The monitored resource that produced this log entry. + // + // Example: a log entry that reports a database error would be associated with + // the monitored resource designating the particular database that reported + // the error. + google.api.MonitoredResource resource = 8 + [(google.api.field_behavior) = REQUIRED]; + + // The log entry payload, which can be one of multiple types. + oneof payload { + // The log entry payload, represented as a protocol buffer. Some Google + // Cloud Platform services use this field for their log entry payloads. + // + // The following protocol buffer types are supported; user-defined types + // are not supported: + // + // "type.googleapis.com/google.cloud.audit.AuditLog" + // "type.googleapis.com/google.appengine.logging.v1.RequestLog" + 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 json_payload = 6; + } + + // Optional. The time the event described by the log entry occurred. This time + // is used to compute the log entry's age and to enforce the logs retention + // period. If this field is omitted in a new log entry, then Logging assigns + // it the current time. Timestamps have nanosecond accuracy, but trailing + // zeros in the fractional seconds might be omitted when the timestamp is + // displayed. + // + // Incoming log entries must have timestamps that don't exceed the + // [logs retention + // period](https://cloud.google.com/logging/quotas#logs_retention_periods) in + // the past, and that don't exceed 24 hours in the future. Log entries outside + // those time boundaries aren't ingested by Logging. + google.protobuf.Timestamp timestamp = 9 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The time the log entry was received by Logging. + google.protobuf.Timestamp receive_timestamp = 24 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The severity of the log entry. The default value is + // `LogSeverity.DEFAULT`. + google.logging.type.LogSeverity severity = 10 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A unique identifier for the log entry. If you provide a value, + // then Logging considers other log entries in the same project, with the same + // `timestamp`, and with the same `insert_id` to be duplicates which are + // removed in a single query result. However, there are no guarantees of + // de-duplication in the export of logs. + // + // If the `insert_id` is omitted when writing a log entry, the Logging API + // assigns its own unique identifier in this field. + // + // In queries, the `insert_id` is also used to order log entries that have + // the same `log_name` and `timestamp` values. + string insert_id = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Information about the HTTP request associated with this log + // entry, if applicable. + google.logging.type.HttpRequest http_request = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A map of key, value pairs that provides additional information + // about the log entry. The labels can be user-defined or system-defined. + // + // User-defined labels are arbitrary key, value pairs that you can use to + // classify logs. + // + // System-defined labels are defined by GCP services for platform logs. + // They have two components - a service namespace component and the + // attribute name. For example: `compute.googleapis.com/resource_name`. + // + // Cloud Logging truncates label keys that exceed 512 B and label + // values that exceed 64 KB upon their associated log entry being + // written. The truncation is indicated by an ellipsis at the + // end of the character string. + map labels = 11 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Information about an operation associated with the log entry, if + // applicable. + LogEntryOperation operation = 15 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The REST resource name of the trace being written to + // [Cloud Trace](https://cloud.google.com/trace) in + // association with this log entry. For example, if your trace data is stored + // in the Cloud project "my-trace-project" and if the service that is creating + // the log entry receives a trace header that includes the trace ID "12345", + // then the service should use "projects/my-tracing-project/traces/12345". + // + // The `trace` field provides the link between logs and traces. By using + // this field, you can navigate from a log entry to a trace. + string trace = 22 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The ID of the [Cloud Trace](https://cloud.google.com/trace) span + // associated with the current operation in which the log is being written. + // For example, if a span has the REST resource name of + // "projects/some-project/traces/some-trace/spans/some-span-id", then the + // `span_id` field is "some-span-id". + // + // A + // [Span](https://cloud.google.com/trace/docs/reference/v2/rest/v2/projects.traces/batchWrite#Span) + // represents a single operation within a trace. Whereas a trace may involve + // multiple different microservices running on multiple different machines, + // a span generally corresponds to a single logical operation being performed + // in a single instance of a microservice on one specific machine. Spans + // are the nodes within the tree that is a trace. + // + // Applications that are [instrumented for + // tracing](https://cloud.google.com/trace/docs/setup) will generally assign a + // new, unique span ID on each incoming request. It is also common to create + // and record additional spans corresponding to internal processing elements + // as well as issuing requests to dependencies. + // + // The span ID is expected to be a 16-character, hexadecimal encoding of an + // 8-byte array and should not be zero. It should be unique within the trace + // and should, ideally, be generated in a manner that is uniformly random. + // + // Example values: + // + // - `000000000000004a` + // - `7a2190356c3fc94b` + // - `0000f00300090021` + // - `d39223e101960076` + string span_id = 27 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The sampling decision of the trace associated with the log entry. + // + // True means that the trace resource name in the `trace` field was sampled + // for storage in a trace backend. False means that the trace was not sampled + // for storage when this log entry was written, or the sampling decision was + // unknown at the time. A non-sampled `trace` value is still useful as a + // request correlation identifier. The default is False. + bool trace_sampled = 30 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Source code location information associated with the log entry, + // if any. + LogEntrySourceLocation source_location = 23 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Information indicating this LogEntry is part of a sequence of + // multiple log entries split from a single LogEntry. + LogSplit split = 35 [(google.api.field_behavior) = OPTIONAL]; +} + +// 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 [(google.api.field_behavior) = OPTIONAL]; + + // 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 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Set this to True if this is the first log entry in the operation. + bool first = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Set this to True if this is the last log entry in the operation. + bool last = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// 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 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Line within the source file. 1-based; 0 indicates no line number + // available. + int64 line = 2 [(google.api.field_behavior) = OPTIONAL]; + + // 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 [(google.api.field_behavior) = OPTIONAL]; +} + +// Additional information used to correlate multiple log entries. Used when a +// single LogEntry would exceed the Google Cloud Logging size limit and is +// split across multiple log entries. +message LogSplit { + // A globally unique identifier for all log entries in a sequence of split log + // entries. All log entries with the same |LogSplit.uid| are assumed to be + // part of the same sequence of split log entries. + string uid = 1; + + // The index of this LogEntry in the sequence of split log entries. Log + // entries are given |index| values 0, 1, ..., n-1 for a sequence of n log + // entries. + int32 index = 2; + + // The total number of log entries that the original LogEntry was split into. + int32 total_splits = 3; +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/proto/google/logging/v2/logging.proto b/java-logging/proto-google-cloud-logging-v2/src/main/proto/google/logging/v2/logging.proto new file mode 100644 index 000000000000..e984d6ec0d5b --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/proto/google/logging/v2/logging.proto @@ -0,0 +1,483 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.logging.v2; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/monitored_resource.proto"; +import "google/api/resource.proto"; +import "google/logging/v2/log_entry.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/empty.proto"; +import "google/rpc/status.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Logging.V2"; +option go_package = "cloud.google.com/go/logging/apiv2/loggingpb;loggingpb"; +option java_multiple_files = true; +option java_outer_classname = "LoggingProto"; +option java_package = "com.google.logging.v2"; +option php_namespace = "Google\\Cloud\\Logging\\V2"; +option ruby_package = "Google::Cloud::Logging::V2"; + +// Service for ingesting and querying logs. +service LoggingServiceV2 { + option (google.api.default_host) = "logging.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/cloud-platform.read-only," + "https://www.googleapis.com/auth/logging.admin," + "https://www.googleapis.com/auth/logging.read," + "https://www.googleapis.com/auth/logging.write"; + + // Deletes all the log entries in a log for the _Default Log Bucket. The log + // reappears if it receives new entries. Log entries written shortly before + // the delete operation might not be deleted. Entries received after the + // delete operation with a timestamp before the operation will be deleted. + rpc DeleteLog(DeleteLogRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v2/{log_name=projects/*/logs/*}" + additional_bindings { delete: "/v2/{log_name=*/*/logs/*}" } + additional_bindings { delete: "/v2/{log_name=organizations/*/logs/*}" } + additional_bindings { delete: "/v2/{log_name=folders/*/logs/*}" } + additional_bindings { delete: "/v2/{log_name=billingAccounts/*/logs/*}" } + }; + option (google.api.method_signature) = "log_name"; + } + + // Writes log entries to Logging. This API method is the + // only way to send log entries to Logging. This method + // is used, directly or indirectly, by the Logging agent + // (fluentd) and all logging libraries configured to use Logging. + // A single request may contain log entries for a maximum of 1000 + // different resources (projects, organizations, billing accounts or + // folders) + rpc WriteLogEntries(WriteLogEntriesRequest) + returns (WriteLogEntriesResponse) { + option (google.api.http) = { + post: "/v2/entries:write" + body: "*" + }; + option (google.api.method_signature) = "log_name,resource,labels,entries"; + } + + // Lists log entries. Use this method to retrieve log entries that originated + // from a project/folder/organization/billing account. For ways to export log + // entries, see [Exporting + // Logs](https://cloud.google.com/logging/docs/export). + rpc ListLogEntries(ListLogEntriesRequest) returns (ListLogEntriesResponse) { + option (google.api.http) = { + post: "/v2/entries:list" + body: "*" + }; + option (google.api.method_signature) = "resource_names,filter,order_by"; + } + + // Lists the descriptors for monitored resource types used by Logging. + rpc ListMonitoredResourceDescriptors(ListMonitoredResourceDescriptorsRequest) + returns (ListMonitoredResourceDescriptorsResponse) { + option (google.api.http) = { + get: "/v2/monitoredResourceDescriptors" + }; + } + + // Lists the logs in projects, organizations, folders, or billing accounts. + // Only logs that have entries are listed. + rpc ListLogs(ListLogsRequest) returns (ListLogsResponse) { + option (google.api.http) = { + get: "/v2/{parent=*/*}/logs" + additional_bindings { get: "/v2/{parent=projects/*}/logs" } + additional_bindings { get: "/v2/{parent=organizations/*}/logs" } + additional_bindings { get: "/v2/{parent=folders/*}/logs" } + additional_bindings { get: "/v2/{parent=billingAccounts/*}/logs" } + additional_bindings { + get: "/v2/{parent=projects/*/locations/*/buckets/*/views/*}/logs" + } + additional_bindings { + get: "/v2/{parent=organizations/*/locations/*/buckets/*/views/*}/logs" + } + additional_bindings { + get: "/v2/{parent=folders/*/locations/*/buckets/*/views/*}/logs" + } + additional_bindings { + get: "/v2/{parent=billingAccounts/*/locations/*/buckets/*/views/*}/logs" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Streaming read of log entries as they are ingested. Until the stream is + // terminated, it will continue reading logs. + rpc TailLogEntries(stream TailLogEntriesRequest) + returns (stream TailLogEntriesResponse) { + option (google.api.http) = { + post: "/v2/entries:tail" + body: "*" + }; + } +} + +// The parameters to DeleteLog. +message DeleteLogRequest { + // Required. The resource name of the log to delete: + // + // * `projects/[PROJECT_ID]/logs/[LOG_ID]` + // * `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]` + // * `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]` + // * `folders/[FOLDER_ID]/logs/[LOG_ID]` + // + // `[LOG_ID]` must be URL-encoded. For example, + // `"projects/my-project-id/logs/syslog"`, + // `"organizations/123/logs/cloudaudit.googleapis.com%2Factivity"`. + // + // For more information about log names, see + // [LogEntry][google.logging.v2.LogEntry]. + string log_name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "logging.googleapis.com/Log" } + ]; +} + +// The parameters to WriteLogEntries. +message WriteLogEntriesRequest { + // Optional. A default log resource name that is assigned to all log entries + // in `entries` that do not specify a value for `log_name`: + // + // * `projects/[PROJECT_ID]/logs/[LOG_ID]` + // * `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]` + // * `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]` + // * `folders/[FOLDER_ID]/logs/[LOG_ID]` + // + // `[LOG_ID]` must be URL-encoded. For example: + // + // "projects/my-project-id/logs/syslog" + // "organizations/123/logs/cloudaudit.googleapis.com%2Factivity" + // + // The permission `logging.logEntries.create` is needed on each project, + // organization, billing account, or folder that is receiving new log + // entries, whether the resource is specified in `logName` or in an + // individual log entry. + string log_name = 1 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { type: "logging.googleapis.com/Log" } + ]; + + // Optional. A default monitored resource object that is assigned to all log + // entries in `entries` that do not specify a value for `resource`. Example: + // + // { "type": "gce_instance", + // "labels": { + // "zone": "us-central1-a", "instance_id": "00000000000000000000" }} + // + // See [LogEntry][google.logging.v2.LogEntry]. + google.api.MonitoredResource resource = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Default labels that are added to the `labels` field of all log + // entries in `entries`. If a log entry already has a label with the same key + // as a label in this parameter, then the log entry's label is not changed. + // See [LogEntry][google.logging.v2.LogEntry]. + map labels = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The log entries to send to Logging. The order of log + // entries in this list does not matter. Values supplied in this method's + // `log_name`, `resource`, and `labels` fields are copied into those log + // entries in this list that do not include values for their corresponding + // fields. For more information, see the + // [LogEntry][google.logging.v2.LogEntry] type. + // + // If the `timestamp` or `insert_id` fields are missing in log entries, then + // this method supplies the current time or a unique identifier, respectively. + // The supplied values are chosen so that, among the log entries that did not + // supply their own values, the entries earlier in the list will sort before + // the entries later in the list. See the `entries.list` method. + // + // Log entries with timestamps that are more than the + // [logs retention period](https://cloud.google.com/logging/quotas) in + // the past or more than 24 hours in the future will not be available when + // calling `entries.list`. However, those log entries can still be [exported + // with + // LogSinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs). + // + // To improve throughput and to avoid exceeding the + // [quota limit](https://cloud.google.com/logging/quotas) for calls to + // `entries.write`, you should try to include several log entries in this + // list, rather than calling this method for each individual log entry. + repeated LogEntry entries = 4 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Whether a batch's valid entries should be written even if some + // other entry failed due to a permanent error such as INVALID_ARGUMENT or + // PERMISSION_DENIED. If any entry failed, then the response status is the + // response status of one of the failed entries. The response will include + // error details in `WriteLogEntriesPartialErrors.log_entry_errors` keyed by + // the entries' zero-based index in the `entries`. Failed requests for which + // no entries are written will not include per-entry errors. + bool partial_success = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, the request should expect normal response, but the + // entries won't be persisted nor exported. Useful for checking whether the + // logging API endpoints are working properly before sending valuable data. + bool dry_run = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// Result returned from WriteLogEntries. +message WriteLogEntriesResponse {} + +// Error details for WriteLogEntries with partial success. +message WriteLogEntriesPartialErrors { + // When `WriteLogEntriesRequest.partial_success` is true, records the error + // status for entries that were not written due to a permanent error, keyed + // by the entry's zero-based index in `WriteLogEntriesRequest.entries`. + // + // Failed requests for which no entries are written will not include + // per-entry errors. + map log_entry_errors = 1; +} + +// The parameters to `ListLogEntries`. +message ListLogEntriesRequest { + // Required. Names of one or more parent resources from which to + // retrieve log entries: + // + // * `projects/[PROJECT_ID]` + // * `organizations/[ORGANIZATION_ID]` + // * `billingAccounts/[BILLING_ACCOUNT_ID]` + // * `folders/[FOLDER_ID]` + // + // May alternatively be one or more views: + // + // * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + // * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + // * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + // * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + // + // Projects listed in the `project_ids` field are added to this list. + // A maximum of 100 resources may be specified in a single request. + repeated string resource_names = 8 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "logging.googleapis.com/Log" + } + ]; + + // Optional. Only log entries that match the filter are returned. An empty + // filter matches all log entries in the resources listed in `resource_names`. + // Referencing a parent resource that is not listed in `resource_names` will + // cause the filter to return no results. The maximum length of a filter is + // 20,000 characters. + string filter = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. How the results should be sorted. Presently, the only permitted + // values are `"timestamp asc"` (default) and `"timestamp desc"`. The first + // option returns entries in order of increasing values of + // `LogEntry.timestamp` (oldest first), and the second option returns entries + // in order of decreasing timestamps (newest first). Entries with equal + // timestamps are returned in order of their `insert_id` values. + string order_by = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of results to return from this request. + // Default is 50. If the value is negative or exceeds 1000, the request is + // rejected. The presence of `next_page_token` in the response indicates that + // more results might be available. + int32 page_size = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If present, then retrieve the next batch of results from the + // preceding call to this method. `page_token` must be the value of + // `next_page_token` from the previous response. The values of other method + // parameters should be identical to those in the previous call. + string page_token = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Result returned from `ListLogEntries`. +message ListLogEntriesResponse { + // A list of log entries. If `entries` is empty, `nextPageToken` may still be + // returned, indicating that more entries may exist. See `nextPageToken` for + // more information. + repeated LogEntry entries = 1; + + // If there might be more results than those appearing in this response, then + // `nextPageToken` is included. To get the next set of results, call this + // method again using the value of `nextPageToken` as `pageToken`. + // + // If a value for `next_page_token` appears and the `entries` field is empty, + // it means that the search found no log entries so far but it did not have + // time to search all the possible log entries. Retry the method with this + // value for `page_token` to continue the search. Alternatively, consider + // speeding up the search by changing your filter to specify a single log name + // or resource type, or to narrow the time range of the search. + string next_page_token = 2; +} + +// The parameters to ListMonitoredResourceDescriptors +message ListMonitoredResourceDescriptorsRequest { + // Optional. The maximum number of results to return from this request. + // Non-positive values are ignored. The presence of `nextPageToken` in the + // response indicates that more results might be available. + int32 page_size = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If present, then retrieve the next batch of results from the + // preceding call to this method. `pageToken` must be the value of + // `nextPageToken` from the previous response. The values of other method + // parameters should be identical to those in the previous call. + string page_token = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Result returned from ListMonitoredResourceDescriptors. +message ListMonitoredResourceDescriptorsResponse { + // A list of resource descriptors. + repeated google.api.MonitoredResourceDescriptor resource_descriptors = 1; + + // If there might be more results than those appearing in this response, then + // `nextPageToken` is included. To get the next set of results, call this + // method again using the value of `nextPageToken` as `pageToken`. + string next_page_token = 2; +} + +// The parameters to ListLogs. +message ListLogsRequest { + // Required. The resource name to list logs for: + // + // * `projects/[PROJECT_ID]` + // * `organizations/[ORGANIZATION_ID]` + // * `billingAccounts/[BILLING_ACCOUNT_ID]` + // * `folders/[FOLDER_ID]` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "logging.googleapis.com/Log" + } + ]; + + // Optional. List of resource names to list logs for: + // + // * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + // * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + // * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + // * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + // + // To support legacy queries, it could also be: + // + // * `projects/[PROJECT_ID]` + // * `organizations/[ORGANIZATION_ID]` + // * `billingAccounts/[BILLING_ACCOUNT_ID]` + // * `folders/[FOLDER_ID]` + // + // The resource name in the `parent` field is added to this list. + repeated string resource_names = 8 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + child_type: "logging.googleapis.com/Log" + } + ]; + + // Optional. The maximum number of results to return from this request. + // Non-positive values are ignored. The presence of `nextPageToken` in the + // response indicates that more results might be available. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If present, then retrieve the next batch of results from the + // preceding call to this method. `pageToken` must be the value of + // `nextPageToken` from the previous response. The values of other method + // parameters should be identical to those in the previous call. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Result returned from ListLogs. +message ListLogsResponse { + // A list of log names. For example, + // `"projects/my-project/logs/syslog"` or + // `"organizations/123/logs/cloudresourcemanager.googleapis.com%2Factivity"`. + repeated string log_names = 3; + + // If there might be more results than those appearing in this response, then + // `nextPageToken` is included. To get the next set of results, call this + // method again using the value of `nextPageToken` as `pageToken`. + string next_page_token = 2; +} + +// The parameters to `TailLogEntries`. +message TailLogEntriesRequest { + // Required. Name of a parent resource from which to retrieve log entries: + // + // * `projects/[PROJECT_ID]` + // * `organizations/[ORGANIZATION_ID]` + // * `billingAccounts/[BILLING_ACCOUNT_ID]` + // * `folders/[FOLDER_ID]` + // + // May alternatively be one or more views: + // + // * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + // * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + // * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + // * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]` + repeated string resource_names = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Only log entries that match the filter are returned. An empty + // filter matches all log entries in the resources listed in `resource_names`. + // Referencing a parent resource that is not listed in `resource_names` will + // cause the filter to return no results. The maximum length of a filter is + // 20,000 characters. + string filter = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The amount of time to buffer log entries at the server before + // being returned to prevent out of order results due to late arriving log + // entries. Valid values are between 0-60000 milliseconds. Defaults to 2000 + // milliseconds. + google.protobuf.Duration buffer_window = 3 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Result returned from `TailLogEntries`. +message TailLogEntriesResponse { + // Information about entries that were omitted from the session. + message SuppressionInfo { + // An indicator of why entries were omitted. + enum Reason { + // Unexpected default. + REASON_UNSPECIFIED = 0; + + // Indicates suppression occurred due to relevant entries being + // received in excess of rate limits. For quotas and limits, see + // [Logging API quotas and + // limits](https://cloud.google.com/logging/quotas#api-limits). + RATE_LIMIT = 1; + + // Indicates suppression occurred due to the client not consuming + // responses quickly enough. + NOT_CONSUMED = 2; + } + + // The reason that entries were omitted from the session. + Reason reason = 1; + + // A lower bound on the count of entries omitted due to `reason`. + int32 suppressed_count = 2; + } + + // A list of log entries. Each response in the stream will order entries with + // increasing values of `LogEntry.timestamp`. Ordering is not guaranteed + // between separate responses. + repeated LogEntry entries = 1; + + // If entries that otherwise would have been included in the session were not + // sent back to the client, counts of relevant entries omitted from the + // session with the reason that they were not included. There will be at most + // one of each reason per response. The counts represent the number of + // suppressed entries since the last streamed response. + repeated SuppressionInfo suppression_info = 2; +} diff --git a/java-logging/proto-google-cloud-logging-v2/src/main/proto/google/logging/v2/logging_config.proto b/java-logging/proto-google-cloud-logging-v2/src/main/proto/google/logging/v2/logging_config.proto new file mode 100644 index 000000000000..05ed940b3972 --- /dev/null +++ b/java-logging/proto-google-cloud-logging-v2/src/main/proto/google/logging/v2/logging_config.proto @@ -0,0 +1,2317 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.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.logging.v2; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Logging.V2"; +option go_package = "cloud.google.com/go/logging/apiv2/loggingpb;loggingpb"; +option java_multiple_files = true; +option java_outer_classname = "LoggingConfigProto"; +option java_package = "com.google.logging.v2"; +option php_namespace = "Google\\Cloud\\Logging\\V2"; +option ruby_package = "Google::Cloud::Logging::V2"; +option (google.api.resource_definition) = { + type: "logging.googleapis.com/OrganizationLocation" + pattern: "organizations/{organization}/locations/{location}" +}; +option (google.api.resource_definition) = { + type: "logging.googleapis.com/FolderLocation" + pattern: "folders/{folder}/locations/{location}" +}; +option (google.api.resource_definition) = { + type: "logging.googleapis.com/BillingAccountLocation" + pattern: "billingAccounts/{billing_account}/locations/{location}" +}; + +// Service for configuring sinks used to route log entries. +service ConfigServiceV2 { + option (google.api.default_host) = "logging.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/cloud-platform.read-only," + "https://www.googleapis.com/auth/logging.admin," + "https://www.googleapis.com/auth/logging.read"; + + // Lists log buckets. + rpc ListBuckets(ListBucketsRequest) returns (ListBucketsResponse) { + option (google.api.http) = { + get: "/v2/{parent=*/*/locations/*}/buckets" + additional_bindings { get: "/v2/{parent=projects/*/locations/*}/buckets" } + additional_bindings { + get: "/v2/{parent=organizations/*/locations/*}/buckets" + } + additional_bindings { get: "/v2/{parent=folders/*/locations/*}/buckets" } + additional_bindings { + get: "/v2/{parent=billingAccounts/*/locations/*}/buckets" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Gets a log bucket. + rpc GetBucket(GetBucketRequest) returns (LogBucket) { + option (google.api.http) = { + get: "/v2/{name=*/*/locations/*/buckets/*}" + additional_bindings { get: "/v2/{name=projects/*/locations/*/buckets/*}" } + additional_bindings { + get: "/v2/{name=organizations/*/locations/*/buckets/*}" + } + additional_bindings { get: "/v2/{name=folders/*/locations/*/buckets/*}" } + additional_bindings { + get: "/v2/{name=billingAccounts/*/locations/*/buckets/*}" + } + }; + } + + // Creates a log bucket asynchronously that can be used to store log entries. + // + // After a bucket has been created, the bucket's location cannot be changed. + rpc CreateBucketAsync(CreateBucketRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{parent=*/*/locations/*}/buckets:createAsync" + body: "bucket" + additional_bindings { + post: "/v2/{parent=projects/*/locations/*}/buckets:createAsync" + body: "bucket" + } + additional_bindings { + post: "/v2/{parent=organizations/*/locations/*}/buckets:createAsync" + body: "bucket" + } + additional_bindings { + post: "/v2/{parent=folders/*/locations/*}/buckets:createAsync" + body: "bucket" + } + additional_bindings { + post: "/v2/{parent=billingAccounts/*/locations/*}/buckets:createAsync" + body: "bucket" + } + }; + option (google.longrunning.operation_info) = { + response_type: "LogBucket" + metadata_type: "BucketMetadata" + }; + } + + // Updates a log bucket asynchronously. + // + // If the bucket has a `lifecycle_state` of `DELETE_REQUESTED`, then + // `FAILED_PRECONDITION` will be returned. + // + // After a bucket has been created, the bucket's location cannot be changed. + rpc UpdateBucketAsync(UpdateBucketRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{name=*/*/locations/*/buckets/*}:updateAsync" + body: "bucket" + additional_bindings { + post: "/v2/{name=projects/*/locations/*/buckets/*}:updateAsync" + body: "bucket" + } + additional_bindings { + post: "/v2/{name=organizations/*/locations/*/buckets/*}:updateAsync" + body: "bucket" + } + additional_bindings { + post: "/v2/{name=folders/*/locations/*/buckets/*}:updateAsync" + body: "bucket" + } + additional_bindings { + post: "/v2/{name=billingAccounts/*/locations/*/buckets/*}:updateAsync" + body: "bucket" + } + }; + option (google.longrunning.operation_info) = { + response_type: "LogBucket" + metadata_type: "BucketMetadata" + }; + } + + // Creates a log bucket that can be used to store log entries. After a bucket + // has been created, the bucket's location cannot be changed. + rpc CreateBucket(CreateBucketRequest) returns (LogBucket) { + option (google.api.http) = { + post: "/v2/{parent=*/*/locations/*}/buckets" + body: "bucket" + additional_bindings { + post: "/v2/{parent=projects/*/locations/*}/buckets" + body: "bucket" + } + additional_bindings { + post: "/v2/{parent=organizations/*/locations/*}/buckets" + body: "bucket" + } + additional_bindings { + post: "/v2/{parent=folders/*/locations/*}/buckets" + body: "bucket" + } + additional_bindings { + post: "/v2/{parent=billingAccounts/*/locations/*}/buckets" + body: "bucket" + } + }; + } + + // Updates a log bucket. + // + // If the bucket has a `lifecycle_state` of `DELETE_REQUESTED`, then + // `FAILED_PRECONDITION` will be returned. + // + // After a bucket has been created, the bucket's location cannot be changed. + rpc UpdateBucket(UpdateBucketRequest) returns (LogBucket) { + option (google.api.http) = { + patch: "/v2/{name=*/*/locations/*/buckets/*}" + body: "bucket" + additional_bindings { + patch: "/v2/{name=projects/*/locations/*/buckets/*}" + body: "bucket" + } + additional_bindings { + patch: "/v2/{name=organizations/*/locations/*/buckets/*}" + body: "bucket" + } + additional_bindings { + patch: "/v2/{name=folders/*/locations/*/buckets/*}" + body: "bucket" + } + additional_bindings { + patch: "/v2/{name=billingAccounts/*/locations/*/buckets/*}" + body: "bucket" + } + }; + } + + // Deletes a log bucket. + // + // Changes the bucket's `lifecycle_state` to the `DELETE_REQUESTED` state. + // After 7 days, the bucket will be purged and all log entries in the bucket + // will be permanently deleted. + rpc DeleteBucket(DeleteBucketRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v2/{name=*/*/locations/*/buckets/*}" + additional_bindings { + delete: "/v2/{name=projects/*/locations/*/buckets/*}" + } + additional_bindings { + delete: "/v2/{name=organizations/*/locations/*/buckets/*}" + } + additional_bindings { + delete: "/v2/{name=folders/*/locations/*/buckets/*}" + } + additional_bindings { + delete: "/v2/{name=billingAccounts/*/locations/*/buckets/*}" + } + }; + } + + // Undeletes a log bucket. A bucket that has been deleted can be undeleted + // within the grace period of 7 days. + rpc UndeleteBucket(UndeleteBucketRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v2/{name=*/*/locations/*/buckets/*}:undelete" + body: "*" + additional_bindings { + post: "/v2/{name=projects/*/locations/*/buckets/*}:undelete" + body: "*" + } + additional_bindings { + post: "/v2/{name=organizations/*/locations/*/buckets/*}:undelete" + body: "*" + } + additional_bindings { + post: "/v2/{name=folders/*/locations/*/buckets/*}:undelete" + body: "*" + } + additional_bindings { + post: "/v2/{name=billingAccounts/*/locations/*/buckets/*}:undelete" + body: "*" + } + }; + } + + // Lists views on a log bucket. + rpc ListViews(ListViewsRequest) returns (ListViewsResponse) { + option (google.api.http) = { + get: "/v2/{parent=*/*/locations/*/buckets/*}/views" + additional_bindings { + get: "/v2/{parent=projects/*/locations/*/buckets/*}/views" + } + additional_bindings { + get: "/v2/{parent=organizations/*/locations/*/buckets/*}/views" + } + additional_bindings { + get: "/v2/{parent=folders/*/locations/*/buckets/*}/views" + } + additional_bindings { + get: "/v2/{parent=billingAccounts/*/locations/*/buckets/*}/views" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Gets a view on a log bucket.. + rpc GetView(GetViewRequest) returns (LogView) { + option (google.api.http) = { + get: "/v2/{name=*/*/locations/*/buckets/*/views/*}" + additional_bindings { + get: "/v2/{name=projects/*/locations/*/buckets/*/views/*}" + } + additional_bindings { + get: "/v2/{name=organizations/*/locations/*/buckets/*/views/*}" + } + additional_bindings { + get: "/v2/{name=folders/*/locations/*/buckets/*/views/*}" + } + additional_bindings { + get: "/v2/{name=billingAccounts/*/locations/*/buckets/*/views/*}" + } + }; + } + + // Creates a view over log entries in a log bucket. A bucket may contain a + // maximum of 30 views. + rpc CreateView(CreateViewRequest) returns (LogView) { + option (google.api.http) = { + post: "/v2/{parent=*/*/locations/*/buckets/*}/views" + body: "view" + additional_bindings { + post: "/v2/{parent=projects/*/locations/*/buckets/*}/views" + body: "view" + } + additional_bindings { + post: "/v2/{parent=organizations/*/locations/*/buckets/*}/views" + body: "view" + } + additional_bindings { + post: "/v2/{parent=folders/*/locations/*/buckets/*}/views" + body: "view" + } + additional_bindings { + post: "/v2/{parent=billingAccounts/*/locations/*/buckets/*}/views" + body: "view" + } + }; + } + + // Updates a view on a log bucket. This method replaces the following fields + // in the existing view with values from the new view: `filter`. + // If an `UNAVAILABLE` error is returned, this indicates that system is not in + // a state where it can update the view. If this occurs, please try again in a + // few minutes. + rpc UpdateView(UpdateViewRequest) returns (LogView) { + option (google.api.http) = { + patch: "/v2/{name=*/*/locations/*/buckets/*/views/*}" + body: "view" + additional_bindings { + patch: "/v2/{name=projects/*/locations/*/buckets/*/views/*}" + body: "view" + } + additional_bindings { + patch: "/v2/{name=organizations/*/locations/*/buckets/*/views/*}" + body: "view" + } + additional_bindings { + patch: "/v2/{name=folders/*/locations/*/buckets/*/views/*}" + body: "view" + } + additional_bindings { + patch: "/v2/{name=billingAccounts/*/locations/*/buckets/*/views/*}" + body: "view" + } + }; + } + + // Deletes a view on a log bucket. + // If an `UNAVAILABLE` error is returned, this indicates that system is not in + // a state where it can delete the view. If this occurs, please try again in a + // few minutes. + rpc DeleteView(DeleteViewRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v2/{name=*/*/locations/*/buckets/*/views/*}" + additional_bindings { + delete: "/v2/{name=projects/*/locations/*/buckets/*/views/*}" + } + additional_bindings { + delete: "/v2/{name=organizations/*/locations/*/buckets/*/views/*}" + } + additional_bindings { + delete: "/v2/{name=folders/*/locations/*/buckets/*/views/*}" + } + additional_bindings { + delete: "/v2/{name=billingAccounts/*/locations/*/buckets/*/views/*}" + } + }; + } + + // Lists sinks. + rpc ListSinks(ListSinksRequest) returns (ListSinksResponse) { + option (google.api.http) = { + get: "/v2/{parent=*/*}/sinks" + additional_bindings { get: "/v2/{parent=projects/*}/sinks" } + additional_bindings { get: "/v2/{parent=organizations/*}/sinks" } + additional_bindings { get: "/v2/{parent=folders/*}/sinks" } + additional_bindings { get: "/v2/{parent=billingAccounts/*}/sinks" } + }; + option (google.api.method_signature) = "parent"; + } + + // Gets a sink. + rpc GetSink(GetSinkRequest) returns (LogSink) { + option (google.api.http) = { + get: "/v2/{sink_name=*/*/sinks/*}" + additional_bindings { get: "/v2/{sink_name=projects/*/sinks/*}" } + additional_bindings { get: "/v2/{sink_name=organizations/*/sinks/*}" } + additional_bindings { get: "/v2/{sink_name=folders/*/sinks/*}" } + additional_bindings { get: "/v2/{sink_name=billingAccounts/*/sinks/*}" } + }; + option (google.api.method_signature) = "sink_name"; + } + + // Creates a sink that exports specified log entries to a destination. The + // export of newly-ingested log entries begins immediately, unless the sink's + // `writer_identity` is not permitted to write to the destination. A sink can + // export log entries only from the resource owning the sink. + rpc CreateSink(CreateSinkRequest) returns (LogSink) { + option (google.api.http) = { + post: "/v2/{parent=*/*}/sinks" + body: "sink" + additional_bindings { post: "/v2/{parent=projects/*}/sinks" body: "sink" } + additional_bindings { + post: "/v2/{parent=organizations/*}/sinks" + body: "sink" + } + additional_bindings { post: "/v2/{parent=folders/*}/sinks" body: "sink" } + additional_bindings { + post: "/v2/{parent=billingAccounts/*}/sinks" + body: "sink" + } + }; + option (google.api.method_signature) = "parent,sink"; + } + + // Updates a sink. This method replaces the following fields in the existing + // sink with values from the new sink: `destination`, and `filter`. + // + // The updated sink might also have a new `writer_identity`; see the + // `unique_writer_identity` field. + rpc UpdateSink(UpdateSinkRequest) returns (LogSink) { + option (google.api.http) = { + put: "/v2/{sink_name=*/*/sinks/*}" + body: "sink" + additional_bindings { + put: "/v2/{sink_name=projects/*/sinks/*}" + body: "sink" + } + additional_bindings { + put: "/v2/{sink_name=organizations/*/sinks/*}" + body: "sink" + } + additional_bindings { + put: "/v2/{sink_name=folders/*/sinks/*}" + body: "sink" + } + additional_bindings { + put: "/v2/{sink_name=billingAccounts/*/sinks/*}" + body: "sink" + } + additional_bindings { + patch: "/v2/{sink_name=projects/*/sinks/*}" + body: "sink" + } + additional_bindings { + patch: "/v2/{sink_name=organizations/*/sinks/*}" + body: "sink" + } + additional_bindings { + patch: "/v2/{sink_name=folders/*/sinks/*}" + body: "sink" + } + additional_bindings { + patch: "/v2/{sink_name=billingAccounts/*/sinks/*}" + body: "sink" + } + }; + option (google.api.method_signature) = "sink_name,sink,update_mask"; + option (google.api.method_signature) = "sink_name,sink"; + } + + // Deletes a sink. If the sink has a unique `writer_identity`, then that + // service account is also deleted. + rpc DeleteSink(DeleteSinkRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v2/{sink_name=*/*/sinks/*}" + additional_bindings { delete: "/v2/{sink_name=projects/*/sinks/*}" } + additional_bindings { delete: "/v2/{sink_name=organizations/*/sinks/*}" } + additional_bindings { delete: "/v2/{sink_name=folders/*/sinks/*}" } + additional_bindings { + delete: "/v2/{sink_name=billingAccounts/*/sinks/*}" + } + }; + option (google.api.method_signature) = "sink_name"; + } + + // Asynchronously creates a linked dataset in BigQuery which makes it possible + // to use BigQuery to read the logs stored in the log bucket. A log bucket may + // currently only contain one link. + rpc CreateLink(CreateLinkRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{parent=*/*/locations/*/buckets/*}/links" + body: "link" + additional_bindings { + post: "/v2/{parent=projects/*/locations/*/buckets/*}/links" + body: "link" + } + additional_bindings { + post: "/v2/{parent=organizations/*/locations/*/buckets/*}/links" + body: "link" + } + additional_bindings { + post: "/v2/{parent=folders/*/locations/*/buckets/*}/links" + body: "link" + } + additional_bindings { + post: "/v2/{parent=billingAccounts/*/locations/*/buckets/*}/links" + body: "link" + } + }; + option (google.api.method_signature) = "parent,link,link_id"; + option (google.longrunning.operation_info) = { + response_type: "Link" + metadata_type: "LinkMetadata" + }; + } + + // Deletes a link. This will also delete the corresponding BigQuery linked + // dataset. + rpc DeleteLink(DeleteLinkRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v2/{name=*/*/locations/*/buckets/*/links/*}" + additional_bindings { + delete: "/v2/{name=projects/*/locations/*/buckets/*/links/*}" + } + additional_bindings { + delete: "/v2/{name=organizations/*/locations/*/buckets/*/links/*}" + } + additional_bindings { + delete: "/v2/{name=folders/*/locations/*/buckets/*/links/*}" + } + additional_bindings { + delete: "/v2/{name=billingAccounts/*/locations/*/buckets/*/links/*}" + } + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "LinkMetadata" + }; + } + + // Lists links. + rpc ListLinks(ListLinksRequest) returns (ListLinksResponse) { + option (google.api.http) = { + get: "/v2/{parent=*/*/locations/*/buckets/*}/links" + additional_bindings { + get: "/v2/{parent=projects/*/locations/*/buckets/*}/links" + } + additional_bindings { + get: "/v2/{parent=organizations/*/locations/*/buckets/*}/links" + } + additional_bindings { + get: "/v2/{parent=folders/*/locations/*/buckets/*}/links" + } + additional_bindings { + get: "/v2/{parent=billingAccounts/*/locations/*/buckets/*}/links" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Gets a link. + rpc GetLink(GetLinkRequest) returns (Link) { + option (google.api.http) = { + get: "/v2/{name=*/*/locations/*/buckets/*/links/*}" + additional_bindings { + get: "/v2/{name=projects/*/locations/*/buckets/*/links/*}" + } + additional_bindings { + get: "/v2/{name=organizations/*/locations/*/buckets/*/links/*}" + } + additional_bindings { + get: "/v2/{name=folders/*/locations/*/buckets/*/links/*}" + } + additional_bindings { + get: "/v2/{name=billingAccounts/*/locations/*/buckets/*/links/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Lists all the exclusions on the _Default sink in a parent resource. + rpc ListExclusions(ListExclusionsRequest) returns (ListExclusionsResponse) { + option (google.api.http) = { + get: "/v2/{parent=*/*}/exclusions" + additional_bindings { get: "/v2/{parent=projects/*}/exclusions" } + additional_bindings { get: "/v2/{parent=organizations/*}/exclusions" } + additional_bindings { get: "/v2/{parent=folders/*}/exclusions" } + additional_bindings { get: "/v2/{parent=billingAccounts/*}/exclusions" } + }; + option (google.api.method_signature) = "parent"; + } + + // Gets the description of an exclusion in the _Default sink. + rpc GetExclusion(GetExclusionRequest) returns (LogExclusion) { + option (google.api.http) = { + get: "/v2/{name=*/*/exclusions/*}" + additional_bindings { get: "/v2/{name=projects/*/exclusions/*}" } + additional_bindings { get: "/v2/{name=organizations/*/exclusions/*}" } + additional_bindings { get: "/v2/{name=folders/*/exclusions/*}" } + additional_bindings { get: "/v2/{name=billingAccounts/*/exclusions/*}" } + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new exclusion in the _Default sink in a specified parent + // resource. Only log entries belonging to that resource can be excluded. You + // can have up to 10 exclusions in a resource. + rpc CreateExclusion(CreateExclusionRequest) returns (LogExclusion) { + option (google.api.http) = { + post: "/v2/{parent=*/*}/exclusions" + body: "exclusion" + additional_bindings { + post: "/v2/{parent=projects/*}/exclusions" + body: "exclusion" + } + additional_bindings { + post: "/v2/{parent=organizations/*}/exclusions" + body: "exclusion" + } + additional_bindings { + post: "/v2/{parent=folders/*}/exclusions" + body: "exclusion" + } + additional_bindings { + post: "/v2/{parent=billingAccounts/*}/exclusions" + body: "exclusion" + } + }; + option (google.api.method_signature) = "parent,exclusion"; + } + + // Changes one or more properties of an existing exclusion in the _Default + // sink. + rpc UpdateExclusion(UpdateExclusionRequest) returns (LogExclusion) { + option (google.api.http) = { + patch: "/v2/{name=*/*/exclusions/*}" + body: "exclusion" + additional_bindings { + patch: "/v2/{name=projects/*/exclusions/*}" + body: "exclusion" + } + additional_bindings { + patch: "/v2/{name=organizations/*/exclusions/*}" + body: "exclusion" + } + additional_bindings { + patch: "/v2/{name=folders/*/exclusions/*}" + body: "exclusion" + } + additional_bindings { + patch: "/v2/{name=billingAccounts/*/exclusions/*}" + body: "exclusion" + } + }; + option (google.api.method_signature) = "name,exclusion,update_mask"; + } + + // Deletes an exclusion in the _Default sink. + rpc DeleteExclusion(DeleteExclusionRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v2/{name=*/*/exclusions/*}" + additional_bindings { delete: "/v2/{name=projects/*/exclusions/*}" } + additional_bindings { delete: "/v2/{name=organizations/*/exclusions/*}" } + additional_bindings { delete: "/v2/{name=folders/*/exclusions/*}" } + additional_bindings { + delete: "/v2/{name=billingAccounts/*/exclusions/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Gets the Logging CMEK settings for the given resource. + // + // Note: CMEK for the Log Router can be configured for Google Cloud projects, + // folders, organizations and billing accounts. Once configured for an + // organization, it applies to all projects and folders in the Google Cloud + // organization. + // + // See [Enabling CMEK for Log + // Router](https://cloud.google.com/logging/docs/routing/managed-encryption) + // for more information. + rpc GetCmekSettings(GetCmekSettingsRequest) returns (CmekSettings) { + option (google.api.http) = { + get: "/v2/{name=*/*}/cmekSettings" + additional_bindings { get: "/v2/{name=projects/*}/cmekSettings" } + additional_bindings { get: "/v2/{name=organizations/*}/cmekSettings" } + additional_bindings { get: "/v2/{name=folders/*}/cmekSettings" } + additional_bindings { get: "/v2/{name=billingAccounts/*}/cmekSettings" } + }; + } + + // Updates the Log Router CMEK settings for the given resource. + // + // Note: CMEK for the Log Router can currently only be configured for Google + // Cloud organizations. Once configured, it applies to all projects and + // folders in the Google Cloud organization. + // + // [UpdateCmekSettings][google.logging.v2.ConfigServiceV2.UpdateCmekSettings] + // will fail if 1) `kms_key_name` is invalid, or 2) the associated service + // account does not have the required + // `roles/cloudkms.cryptoKeyEncrypterDecrypter` role assigned for the key, or + // 3) access to the key is disabled. + // + // See [Enabling CMEK for Log + // Router](https://cloud.google.com/logging/docs/routing/managed-encryption) + // for more information. + rpc UpdateCmekSettings(UpdateCmekSettingsRequest) returns (CmekSettings) { + option (google.api.http) = { + patch: "/v2/{name=*/*}/cmekSettings" + body: "cmek_settings" + additional_bindings { + patch: "/v2/{name=organizations/*}/cmekSettings" + body: "cmek_settings" + } + }; + } + + // Gets the Log Router settings for the given resource. + // + // Note: Settings for the Log Router can be get for Google Cloud projects, + // folders, organizations and billing accounts. Currently it can only be + // configured for organizations. Once configured for an organization, it + // applies to all projects and folders in the Google Cloud organization. + // + // See [Enabling CMEK for Log + // Router](https://cloud.google.com/logging/docs/routing/managed-encryption) + // for more information. + rpc GetSettings(GetSettingsRequest) returns (Settings) { + option (google.api.http) = { + get: "/v2/{name=*/*}/settings" + additional_bindings { get: "/v2/{name=projects/*}/settings" } + additional_bindings { get: "/v2/{name=organizations/*}/settings" } + additional_bindings { get: "/v2/{name=folders/*}/settings" } + additional_bindings { get: "/v2/{name=billingAccounts/*}/settings" } + }; + option (google.api.method_signature) = "name"; + } + + // Updates the Log Router settings for the given resource. + // + // Note: Settings for the Log Router can currently only be configured for + // Google Cloud organizations. Once configured, it applies to all projects and + // folders in the Google Cloud organization. + // + // [UpdateSettings][google.logging.v2.ConfigServiceV2.UpdateSettings] + // will fail if 1) `kms_key_name` is invalid, or 2) the associated service + // account does not have the required + // `roles/cloudkms.cryptoKeyEncrypterDecrypter` role assigned for the key, or + // 3) access to the key is disabled. 4) `location_id` is not supported by + // Logging. 5) `location_id` violate OrgPolicy. + // + // See [Enabling CMEK for Log + // Router](https://cloud.google.com/logging/docs/routing/managed-encryption) + // for more information. + rpc UpdateSettings(UpdateSettingsRequest) returns (Settings) { + option (google.api.http) = { + patch: "/v2/{name=*/*}/settings" + body: "settings" + additional_bindings { + patch: "/v2/{name=organizations/*}/settings" + body: "settings" + } + additional_bindings { + patch: "/v2/{name=folders/*}/settings" + body: "settings" + } + }; + option (google.api.method_signature) = "settings,update_mask"; + } + + // Copies a set of log entries from a log bucket to a Cloud Storage bucket. + rpc CopyLogEntries(CopyLogEntriesRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/entries:copy" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "CopyLogEntriesResponse" + metadata_type: "CopyLogEntriesMetadata" + }; + } +} + +// Configuration for an indexed field. +message IndexConfig { + // Required. The LogEntry field path to index. + // + // Note that some paths are automatically indexed, and other paths are not + // eligible for indexing. See [indexing documentation]( + // https://cloud.google.com/logging/docs/view/advanced-queries#indexed-fields) + // for details. + // + // For example: `jsonPayload.request.status` + string field_path = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The type of data in this index. + IndexType type = 2 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The timestamp when the index was last modified. + // + // This is used to return the timestamp, and will be ignored if supplied + // during update. + google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Describes a repository in which log entries are stored. +message LogBucket { + option (google.api.resource) = { + type: "logging.googleapis.com/LogBucket" + pattern: "projects/{project}/locations/{location}/buckets/{bucket}" + pattern: "organizations/{organization}/locations/{location}/buckets/{bucket}" + pattern: "folders/{folder}/locations/{location}/buckets/{bucket}" + pattern: "billingAccounts/{billing_account}/locations/{location}/buckets/{bucket}" + }; + + // Output only. The resource name of the bucket. + // + // For example: + // + // `projects/my-project/locations/global/buckets/my-bucket` + // + // For a list of supported locations, see [Supported + // Regions](https://cloud.google.com/logging/docs/region-support) + // + // For the location of `global` it is unspecified where log entries are + // actually stored. + // + // After a bucket has been created, the location cannot be changed. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Describes this bucket. + string description = 3; + + // Output only. The creation timestamp of the bucket. This is not set for any + // of the default buckets. + google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last update timestamp of the bucket. + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Logs will be retained by default for this amount of time, after which they + // will automatically be deleted. The minimum retention period is 1 day. If + // this value is set to zero at bucket creation time, the default time of 30 + // days will be used. + int32 retention_days = 11; + + // Whether the bucket is locked. + // + // The retention period on a locked bucket cannot be changed. Locked buckets + // may only be deleted if they are empty. + bool locked = 9; + + // Output only. The bucket lifecycle state. + LifecycleState lifecycle_state = 12 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Whether log analytics is enabled for this bucket. + // + // Once enabled, log analytics features cannot be disabled. + bool analytics_enabled = 14; + + // Log entry field paths that are denied access in this bucket. + // + // The following fields and their children are eligible: `textPayload`, + // `jsonPayload`, `protoPayload`, `httpRequest`, `labels`, `sourceLocation`. + // + // Restricting a repeated field will restrict all values. Adding a parent will + // block all child fields. (e.g. `foo.bar` will block `foo.bar.baz`) + repeated string restricted_fields = 15; + + // A list of indexed fields and related configuration data. + repeated IndexConfig index_configs = 17; + + // The CMEK settings of the log bucket. If present, new log entries written to + // this log bucket are encrypted using the CMEK key provided in this + // configuration. If a log bucket has CMEK settings, the CMEK settings cannot + // be disabled later by updating the log bucket. Changing the KMS key is + // allowed. + CmekSettings cmek_settings = 19; +} + +// Describes a view over log entries in a bucket. +message LogView { + option (google.api.resource) = { + type: "logging.googleapis.com/LogView" + pattern: "projects/{project}/locations/{location}/buckets/{bucket}/views/{view}" + pattern: "organizations/{organization}/locations/{location}/buckets/{bucket}/views/{view}" + pattern: "folders/{folder}/locations/{location}/buckets/{bucket}/views/{view}" + pattern: "billingAccounts/{billing_account}/locations/{location}/buckets/{bucket}/views/{view}" + }; + + // The resource name of the view. + // + // For example: + // + // `projects/my-project/locations/global/buckets/my-bucket/views/my-view` + string name = 1; + + // Describes this view. + string description = 3; + + // Output only. The creation timestamp of the view. + google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last update timestamp of the view. + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Filter that restricts which log entries in a bucket are visible in this + // view. + // + // Filters are restricted to be a logical AND of ==/!= of any of the + // following: + // + // - originating project/folder/organization/billing account. + // - resource type + // - log id + // + // For example: + // + // SOURCE("projects/myproject") AND resource.type = "gce_instance" + // AND LOG_ID("stdout") + string filter = 7; +} + +// Describes a sink used to export log entries to one of the following +// destinations in any project: a Cloud Storage bucket, a BigQuery dataset, a +// Pub/Sub topic or a Cloud Logging log bucket. A logs filter controls which log +// entries are exported. The sink must be created within a project, +// organization, billing account, or folder. +message LogSink { + option (google.api.resource) = { + type: "logging.googleapis.com/LogSink" + pattern: "projects/{project}/sinks/{sink}" + pattern: "organizations/{organization}/sinks/{sink}" + pattern: "folders/{folder}/sinks/{sink}" + pattern: "billingAccounts/{billing_account}/sinks/{sink}" + }; + + // Deprecated. This is unused. + enum VersionFormat { + // An unspecified format version that will default to V2. + VERSION_FORMAT_UNSPECIFIED = 0; + + // `LogEntry` version 2 format. + V2 = 1; + + // `LogEntry` version 1 format. + V1 = 2; + } + + // Required. The client-assigned sink identifier, unique within the project. + // + // For example: `"my-syslog-errors-to-pubsub"`. Sink identifiers are limited + // to 100 characters and can include only the following characters: upper and + // lower-case alphanumeric characters, underscores, hyphens, and periods. + // First character has to be alphanumeric. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The export destination: + // + // "storage.googleapis.com/[GCS_BUCKET]" + // "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]" + // "pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]" + // + // The sink's `writer_identity`, set when the sink is created, must have + // permission to write to the destination or else the log entries are not + // exported. For more information, see + // [Exporting Logs with + // Sinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs). + string destination = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "*" } + ]; + + // Optional. An [advanced logs + // filter](https://cloud.google.com/logging/docs/view/advanced-queries). The + // only exported log entries are those that are in the resource owning the + // sink and that match the filter. + // + // For example: + // + // `logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR` + string filter = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A description of this sink. + // + // The maximum length of the description is 8000 characters. + string description = 18 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to true, then this sink is disabled and it does not export + // any log entries. + bool disabled = 19 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Log entries that match any of these exclusion filters will not be + // exported. + // + // If a log entry is matched by both `filter` and one of `exclusion_filters` + // it will not be exported. + repeated LogExclusion exclusions = 16 + [(google.api.field_behavior) = OPTIONAL]; + + // Deprecated. This field is unused. + VersionFormat output_version_format = 6 [deprecated = true]; + + // Output only. An IAM identity—a service account or group—under + // which Cloud Logging writes the exported log entries to the sink's + // destination. This field is either set by specifying + // `custom_writer_identity` or set automatically by + // [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink] and + // [sinks.update][google.logging.v2.ConfigServiceV2.UpdateSink] based on the + // value of `unique_writer_identity` in those methods. + // + // Until you grant this identity write-access to the destination, log entry + // exports from this sink will fail. For more information, see [Granting + // Access for a + // Resource](https://cloud.google.com/iam/docs/granting-roles-to-service-accounts#granting_access_to_a_service_account_for_a_resource). + // Consult the destination service's documentation to determine the + // appropriate IAM roles to assign to the identity. + // + // Sinks that have a destination that is a log bucket in the same project as + // the sink cannot have a writer_identity and no additional permissions are + // required. + string writer_identity = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. This field applies only to sinks owned by organizations and + // folders. If the field is false, the default, only the logs owned by the + // sink's parent resource are available for export. If the field is true, then + // log entries from all the projects, folders, and billing accounts contained + // in the sink's parent resource are also available for export. Whether a + // particular log entry from the children is exported depends on the sink's + // filter expression. + // + // For example, if this field is true, then the filter + // `resource.type=gce_instance` would export all Compute Engine VM instance + // log entries from all projects in the sink's parent. + // + // To only export entries from certain child projects, filter on the project + // part of the log name: + // + // logName:("projects/test-project1/" OR "projects/test-project2/") AND + // resource.type=gce_instance + bool include_children = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Destination dependent options. + oneof options { + // Optional. Options that affect sinks exporting data to BigQuery. + BigQueryOptions bigquery_options = 12 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Output only. The creation timestamp of the sink. + // + // This field may not be present for older sinks. + google.protobuf.Timestamp create_time = 13 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last update timestamp of the sink. + // + // This field may not be present for older sinks. + google.protobuf.Timestamp update_time = 14 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Describes a BigQuery dataset that was created by a link. +message BigQueryDataset { + // Output only. The full resource name of the BigQuery dataset. The DATASET_ID + // will match the ID of the link, so the link must match the naming + // restrictions of BigQuery datasets (alphanumeric characters and underscores + // only). + // + // The dataset will have a resource path of + // "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET_ID]" + string dataset_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Describes a link connected to an analytics enabled bucket. +message Link { + option (google.api.resource) = { + type: "logging.googleapis.com/Link" + pattern: "projects/{project}/locations/{location}/buckets/{bucket}/links/{link}" + pattern: "organizations/{organization}/locations/{location}/buckets/{bucket}/links/{link}" + pattern: "folders/{folder}/locations/{location}/buckets/{bucket}/links/{link}" + pattern: "billingAccounts/{billing_account}/locations/{location}/buckets/{bucket}/links/{link}" + }; + + // The resource name of the link. The name can have up to 100 characters. + // A valid link id (at the end of the link name) must only have alphanumeric + // characters and underscores within it. + // + // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + // "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + // "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + // "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + // + // For example: + // + // `projects/my-project/locations/global/buckets/my-bucket/links/my_link + string name = 1; + + // Describes this link. + // + // The maximum length of the description is 8000 characters. + string description = 2; + + // Output only. The creation timestamp of the link. + google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The resource lifecycle state. + LifecycleState lifecycle_state = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The information of a BigQuery Dataset. When a link is created, a BigQuery + // dataset is created along with it, in the same project as the LogBucket it's + // linked to. This dataset will also have BigQuery Views corresponding to the + // LogViews in the bucket. + BigQueryDataset bigquery_dataset = 5; +} + +// Options that change functionality of a sink exporting data to BigQuery. +message BigQueryOptions { + // Optional. Whether to use [BigQuery's partition + // tables](https://cloud.google.com/bigquery/docs/partitioned-tables). By + // default, Cloud Logging creates dated tables based on the log entries' + // timestamps, e.g. syslog_20170523. With partitioned tables the date suffix + // is no longer present and [special query + // syntax](https://cloud.google.com/bigquery/docs/querying-partitioned-tables) + // has to be used instead. In both cases, tables are sharded based on UTC + // timezone. + bool use_partitioned_tables = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. True if new timestamp column based partitioning is in use, + // false if legacy ingestion-time partitioning is in use. + // + // All new sinks will have this field set true and will use timestamp column + // based partitioning. If use_partitioned_tables is false, this value has no + // meaning and will be false. Legacy sinks using partitioned tables will have + // this field set to false. + bool uses_timestamp_column_partitioning = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The parameters to `ListBuckets`. +message ListBucketsRequest { + // Required. The parent resource whose buckets are to be listed: + // + // "projects/[PROJECT_ID]/locations/[LOCATION_ID]" + // "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]" + // "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]" + // "folders/[FOLDER_ID]/locations/[LOCATION_ID]" + // + // Note: The locations portion of the resource must be specified, but + // supplying the character `-` in place of [LOCATION_ID] will return all + // buckets. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "logging.googleapis.com/LogBucket" + } + ]; + + // Optional. If present, then retrieve the next batch of results from the + // preceding call to this method. `pageToken` must be the value of + // `nextPageToken` from the previous response. The values of other method + // parameters should be identical to those in the previous call. + string page_token = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of results to return from this request. + // Non-positive values are ignored. The presence of `nextPageToken` in the + // response indicates that more results might be available. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response from ListBuckets. +message ListBucketsResponse { + // A list of buckets. + repeated LogBucket buckets = 1; + + // If there might be more results than appear in this response, then + // `nextPageToken` is included. To get the next set of results, call the same + // method again using the value of `nextPageToken` as `pageToken`. + string next_page_token = 2; +} + +// The parameters to `CreateBucket`. +message CreateBucketRequest { + // Required. The resource in which to create the log bucket: + // + // "projects/[PROJECT_ID]/locations/[LOCATION_ID]" + // + // For example: + // + // `"projects/my-project/locations/global"` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "logging.googleapis.com/LogBucket" + } + ]; + + // Required. A client-assigned identifier such as `"my-bucket"`. Identifiers + // are limited to 100 characters and can include only letters, digits, + // underscores, hyphens, and periods. + string bucket_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The new bucket. The region specified in the new bucket must be + // compliant with any Location Restriction Org Policy. The name field in the + // bucket is ignored. + LogBucket bucket = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// The parameters to `UpdateBucket`. +message UpdateBucketRequest { + // Required. The full resource name of the bucket to update. + // + // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + // "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + // "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + // "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + // + // For example: + // + // `"projects/my-project/locations/global/buckets/my-bucket"` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "logging.googleapis.com/LogBucket" + } + ]; + + // Required. The updated bucket. + LogBucket bucket = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Field mask that specifies the fields in `bucket` that need an + // update. A bucket field will be overwritten if, and only if, it is in the + // update mask. `name` and output only fields cannot be updated. + // + // For a detailed `FieldMask` definition, see: + // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask + // + // For example: `updateMask=retention_days` + google.protobuf.FieldMask update_mask = 4 + [(google.api.field_behavior) = REQUIRED]; +} + +// The parameters to `GetBucket`. +message GetBucketRequest { + // Required. The resource name of the bucket: + // + // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + // "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + // "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + // "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + // + // For example: + // + // `"projects/my-project/locations/global/buckets/my-bucket"` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "logging.googleapis.com/LogBucket" + } + ]; +} + +// The parameters to `DeleteBucket`. +message DeleteBucketRequest { + // Required. The full resource name of the bucket to delete. + // + // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + // "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + // "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + // "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + // + // For example: + // + // `"projects/my-project/locations/global/buckets/my-bucket"` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "logging.googleapis.com/LogBucket" + } + ]; +} + +// The parameters to `UndeleteBucket`. +message UndeleteBucketRequest { + // Required. The full resource name of the bucket to undelete. + // + // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + // "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + // "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + // "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + // + // For example: + // + // `"projects/my-project/locations/global/buckets/my-bucket"` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "logging.googleapis.com/LogBucket" + } + ]; +} + +// The parameters to `ListViews`. +message ListViewsRequest { + // Required. The bucket whose views are to be listed: + // + // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. If present, then retrieve the next batch of results from the + // preceding call to this method. `pageToken` must be the value of + // `nextPageToken` from the previous response. The values of other method + // parameters should be identical to those in the previous call. + string page_token = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of results to return from this request. + // + // Non-positive values are ignored. The presence of `nextPageToken` in the + // response indicates that more results might be available. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response from ListViews. +message ListViewsResponse { + // A list of views. + repeated LogView views = 1; + + // If there might be more results than appear in this response, then + // `nextPageToken` is included. To get the next set of results, call the same + // method again using the value of `nextPageToken` as `pageToken`. + string next_page_token = 2; +} + +// The parameters to `CreateView`. +message CreateViewRequest { + // Required. The bucket in which to create the view + // + // `"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"` + // + // For example: + // + // `"projects/my-project/locations/global/buckets/my-bucket"` + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. A client-assigned identifier such as `"my-view"`. Identifiers are + // limited to 100 characters and can include only letters, digits, + // underscores, hyphens, and periods. + string view_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The new view. + LogView view = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// The parameters to `UpdateView`. +message UpdateViewRequest { + // Required. The full resource name of the view to update + // + // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" + // + // For example: + // + // `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"` + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The updated view. + LogView view = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Field mask that specifies the fields in `view` that need + // an update. A field will be overwritten if, and only if, it is + // in the update mask. `name` and output only fields cannot be updated. + // + // For a detailed `FieldMask` definition, see + // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask + // + // For example: `updateMask=filter` + google.protobuf.FieldMask update_mask = 4 + [(google.api.field_behavior) = OPTIONAL]; +} + +// The parameters to `GetView`. +message GetViewRequest { + // Required. The resource name of the policy: + // + // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" + // + // For example: + // + // `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "logging.googleapis.com/LogView" } + ]; +} + +// The parameters to `DeleteView`. +message DeleteViewRequest { + // Required. The full resource name of the view to delete: + // + // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]" + // + // For example: + // + // `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "logging.googleapis.com/LogView" } + ]; +} + +// The parameters to `ListSinks`. +message ListSinksRequest { + // Required. The parent resource whose sinks are to be listed: + // + // "projects/[PROJECT_ID]" + // "organizations/[ORGANIZATION_ID]" + // "billingAccounts/[BILLING_ACCOUNT_ID]" + // "folders/[FOLDER_ID]" + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "logging.googleapis.com/LogSink" + } + ]; + + // Optional. If present, then retrieve the next batch of results from the + // preceding call to this method. `pageToken` must be the value of + // `nextPageToken` from the previous response. The values of other method + // parameters should be identical to those in the previous call. + string page_token = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of results to return from this request. + // Non-positive values are ignored. The presence of `nextPageToken` in the + // response indicates that more results might be available. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Result returned from `ListSinks`. +message ListSinksResponse { + // A list of sinks. + repeated LogSink sinks = 1; + + // If there might be more results than appear in this response, then + // `nextPageToken` is included. To get the next set of results, call the same + // method again using the value of `nextPageToken` as `pageToken`. + string next_page_token = 2; +} + +// The parameters to `GetSink`. +message GetSinkRequest { + // Required. The resource name of the sink: + // + // "projects/[PROJECT_ID]/sinks/[SINK_ID]" + // "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + // "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + // "folders/[FOLDER_ID]/sinks/[SINK_ID]" + // + // For example: + // + // `"projects/my-project/sinks/my-sink"` + string sink_name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "logging.googleapis.com/LogSink" } + ]; +} + +// The parameters to `CreateSink`. +message CreateSinkRequest { + // Required. The resource in which to create the sink: + // + // "projects/[PROJECT_ID]" + // "organizations/[ORGANIZATION_ID]" + // "billingAccounts/[BILLING_ACCOUNT_ID]" + // "folders/[FOLDER_ID]" + // + // For examples: + // + // `"projects/my-project"` + // `"organizations/123456789"` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "logging.googleapis.com/LogSink" + } + ]; + + // Required. The new sink, whose `name` parameter is a sink identifier that + // is not already in use. + LogSink sink = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Determines the kind of IAM identity returned as `writer_identity` + // in the new sink. If this value is omitted or set to false, and if the + // sink's parent is a project, then the value returned as `writer_identity` is + // the same group or service account used by Cloud Logging before the addition + // of writer identities to this API. The sink's destination must be in the + // same project as the sink itself. + // + // If this field is set to true, or if the sink is owned by a non-project + // resource such as an organization, then the value of `writer_identity` will + // be a unique service account used only for exports from the new sink. For + // more information, see `writer_identity` in + // [LogSink][google.logging.v2.LogSink]. + bool unique_writer_identity = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The parameters to `UpdateSink`. +message UpdateSinkRequest { + // Required. The full resource name of the sink to update, including the + // parent resource and the sink identifier: + // + // "projects/[PROJECT_ID]/sinks/[SINK_ID]" + // "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + // "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + // "folders/[FOLDER_ID]/sinks/[SINK_ID]" + // + // For example: + // + // `"projects/my-project/sinks/my-sink"` + string sink_name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "logging.googleapis.com/LogSink" } + ]; + + // Required. The updated sink, whose name is the same identifier that appears + // as part of `sink_name`. + LogSink sink = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. See [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink] + // for a description of this field. When updating a sink, the effect of this + // field on the value of `writer_identity` in the updated sink depends on both + // the old and new values of this field: + // + // + If the old and new values of this field are both false or both true, + // then there is no change to the sink's `writer_identity`. + // + If the old value is false and the new value is true, then + // `writer_identity` is changed to a unique service account. + // + It is an error if the old value is true and the new value is + // set to false or defaulted to false. + bool unique_writer_identity = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Field mask that specifies the fields in `sink` that need + // an update. A sink field will be overwritten if, and only if, it is + // in the update mask. `name` and output only fields cannot be updated. + // + // An empty `updateMask` is temporarily treated as using the following mask + // for backwards compatibility purposes: + // + // `destination,filter,includeChildren` + // + // At some point in the future, behavior will be removed and specifying an + // empty `updateMask` will be an error. + // + // For a detailed `FieldMask` definition, see + // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask + // + // For example: `updateMask=filter` + google.protobuf.FieldMask update_mask = 4 + [(google.api.field_behavior) = OPTIONAL]; +} + +// The parameters to `DeleteSink`. +message DeleteSinkRequest { + // Required. The full resource name of the sink to delete, including the + // parent resource and the sink identifier: + // + // "projects/[PROJECT_ID]/sinks/[SINK_ID]" + // "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + // "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + // "folders/[FOLDER_ID]/sinks/[SINK_ID]" + // + // For example: + // + // `"projects/my-project/sinks/my-sink"` + string sink_name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "logging.googleapis.com/LogSink" } + ]; +} + +// The parameters to CreateLink. +message CreateLinkRequest { + // Required. The full resource name of the bucket to create a link for. + // + // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + // "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + // "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + // "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]" + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "logging.googleapis.com/Link" + } + ]; + + // Required. The new link. + Link link = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID to use for the link. The link_id can have up to 100 + // characters. A valid link_id must only have alphanumeric characters and + // underscores within it. + string link_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// The parameters to DeleteLink. +message DeleteLinkRequest { + // Required. The full resource name of the link to delete. + // + // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + // "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + // "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + // "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "logging.googleapis.com/Link" } + ]; +} + +// The parameters to ListLinks. +message ListLinksRequest { + // Required. The parent resource whose links are to be listed: + // + // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/" + // "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/" + // "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/" + // "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/ + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "logging.googleapis.com/Link" + } + ]; + + // Optional. If present, then retrieve the next batch of results from the + // preceding call to this method. `pageToken` must be the value of + // `nextPageToken` from the previous response. + string page_token = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of results to return from this request. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response from ListLinks. +message ListLinksResponse { + // A list of links. + repeated Link links = 1; + + // If there might be more results than those appearing in this response, then + // `nextPageToken` is included. To get the next set of results, call the same + // method again using the value of `nextPageToken` as `pageToken`. + string next_page_token = 2; +} + +// The parameters to GetLink. +message GetLinkRequest { + // Required. The resource name of the link: + // + // "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + // "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + // "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]" + // "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID] + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "logging.googleapis.com/Link" } + ]; +} + +// Specifies a set of log entries that are filtered out by a sink. If +// your Google Cloud resource receives a large volume of log entries, you can +// use exclusions to reduce your chargeable logs. Note that exclusions on +// organization-level and folder-level sinks don't apply to child resources. +// Note also that you cannot modify the _Required sink or exclude logs from it. +message LogExclusion { + option (google.api.resource) = { + type: "logging.googleapis.com/LogExclusion" + pattern: "projects/{project}/exclusions/{exclusion}" + pattern: "organizations/{organization}/exclusions/{exclusion}" + pattern: "folders/{folder}/exclusions/{exclusion}" + pattern: "billingAccounts/{billing_account}/exclusions/{exclusion}" + }; + + // Required. A client-assigned identifier, such as + // `"load-balancer-exclusion"`. Identifiers are limited to 100 characters and + // can include only letters, digits, underscores, hyphens, and periods. First + // character has to be alphanumeric. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A description of this exclusion. + string description = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. An [advanced logs + // filter](https://cloud.google.com/logging/docs/view/advanced-queries) that + // matches the log entries to be excluded. By using the [sample + // function](https://cloud.google.com/logging/docs/view/advanced-queries#sample), + // you can exclude less than 100% of the matching log entries. + // + // For example, the following query matches 99% of low-severity log entries + // from Google Cloud Storage buckets: + // + // `resource.type=gcs_bucket severity=ERROR" + // + // The maximum length of the filter is 20000 characters. + string filter = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The resource name of the Log Bucket that owns the Log Metric. + // Only Log Buckets in projects are supported. The bucket has to be in the + // same project as the metric. + // + // For example: + // + // `projects/my-project/locations/global/buckets/my-bucket` + // + // If empty, then the Log Metric is considered a non-Bucket Log Metric. + string bucket_name = 13 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to True, then this metric is disabled and it does not + // generate any points. + bool disabled = 12 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The metric descriptor associated with the logs-based metric. + // If unspecified, it uses a default metric descriptor with a DELTA metric + // kind, INT64 value type, with no labels and a unit of "1". Such a metric + // counts the number of log entries matching the `filter` expression. + // + // The `name`, `type`, and `description` fields in the `metric_descriptor` + // are output only, and is constructed using the `name` and `description` + // field in the LogMetric. + // + // To create a logs-based metric that records a distribution of log values, a + // DELTA metric kind with a DISTRIBUTION value type must be used along with + // a `value_extractor` expression in the LogMetric. + // + // Each label in the metric descriptor must have a matching label + // name as the key and an extractor expression as the value in the + // `label_extractors` map. + // + // The `metric_kind` and `value_type` fields in the `metric_descriptor` cannot + // be updated once initially configured. New labels can be added in the + // `metric_descriptor`, but existing labels cannot be modified except for + // their description. + google.api.MetricDescriptor metric_descriptor = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A `value_extractor` is required when using a distribution + // logs-based metric to extract the values to record from a log entry. + // Two functions are supported for value extraction: `EXTRACT(field)` or + // `REGEXP_EXTRACT(field, regex)`. The arguments are: + // + // 1. field: The name of the log entry field from which the value is to be + // extracted. + // 2. regex: A regular expression using the Google RE2 syntax + // (https://github.com/google/re2/wiki/Syntax) with a single capture + // group to extract data from the specified log entry field. The value + // of the field is converted to a string before applying the regex. + // It is an error to specify a regex that does not include exactly one + // capture group. + // + // The result of the extraction must be convertible to a double type, as the + // distribution always records double values. If either the extraction or + // the conversion to double fails, then those values are not recorded in the + // distribution. + // + // Example: `REGEXP_EXTRACT(jsonPayload.request, ".*quantity=(\d+).*")` + string value_extractor = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A map from a label key string to an extractor expression which is + // used to extract data from a log entry field and assign as the label value. + // Each label key specified in the LabelDescriptor must have an associated + // extractor expression in this map. The syntax of the extractor expression + // is the same as for the `value_extractor` field. + // + // The extracted value is converted to the type defined in the label + // descriptor. If either the extraction or the type conversion fails, + // the label will have a default value. The default value for a string + // label is an empty string, for an integer label its 0, and for a boolean + // label its `false`. + // + // Note that there are upper bounds on the maximum number of labels and the + // number of active time series that are allowed in a project. + map label_extractors = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The `bucket_options` are required when the logs-based metric is + // using a DISTRIBUTION value type and it describes the bucket boundaries + // used to create a histogram of the extracted values. + google.api.Distribution.BucketOptions bucket_options = 8 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The creation timestamp of the metric. + // + // This field may not be present for older metrics. + google.protobuf.Timestamp create_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last update timestamp of the metric. + // + // This field may not be present for older metrics. + google.protobuf.Timestamp update_time = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Deprecated. The API version that created or updated this metric. + // The v2 format is used by default and cannot be changed. + ApiVersion version = 4 [deprecated = true]; +} + +// The parameters to ListLogMetrics. +message ListLogMetricsRequest { + // Required. The name of the project containing the metrics: + // + // "projects/[PROJECT_ID]" + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Optional. If present, then retrieve the next batch of results from the + // preceding call to this method. `pageToken` must be the value of + // `nextPageToken` from the previous response. The values of other method + // parameters should be identical to those in the previous call. + string page_token = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of results to return from this request. + // Non-positive values are ignored. The presence of `nextPageToken` in the + // response indicates that more results might be available. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Result returned from ListLogMetrics. +message ListLogMetricsResponse { + // A list of logs-based metrics. + repeated LogMetric metrics = 1; + + // If there might be more results than appear in this response, then + // `nextPageToken` is included. To get the next set of results, call this + // method again using the value of `nextPageToken` as `pageToken`. + string next_page_token = 2; +} + +// The parameters to GetLogMetric. +message GetLogMetricRequest { + // Required. The resource name of the desired metric: + // + // "projects/[PROJECT_ID]/metrics/[METRIC_ID]" + string metric_name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "logging.googleapis.com/LogMetric" + } + ]; +} + +// The parameters to CreateLogMetric. +message CreateLogMetricRequest { + // Required. The resource name of the project in which to create the metric: + // + // "projects/[PROJECT_ID]" + // + // The new metric must be provided in the request. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "logging.googleapis.com/LogMetric" + } + ]; + + // Required. The new logs-based metric, which must not have an identifier that + // already exists. + LogMetric metric = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The parameters to UpdateLogMetric. +message UpdateLogMetricRequest { + // Required. The resource name of the metric to update: + // + // "projects/[PROJECT_ID]/metrics/[METRIC_ID]" + // + // The updated metric must be provided in the request and it's + // `name` field must be the same as `[METRIC_ID]` If the metric + // does not exist in `[PROJECT_ID]`, then a new metric is created. + string metric_name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "logging.googleapis.com/LogMetric" + } + ]; + + // Required. The updated metric. + LogMetric metric = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The parameters to DeleteLogMetric. +message DeleteLogMetricRequest { + // Required. The resource name of the metric to delete: + // + // "projects/[PROJECT_ID]/metrics/[METRIC_ID]" + string metric_name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "logging.googleapis.com/LogMetric" + } + ]; +} diff --git a/java-logging/renovate.json b/java-logging/renovate.json new file mode 100644 index 000000000000..cc8ca334cfd7 --- /dev/null +++ b/java-logging/renovate.json @@ -0,0 +1,98 @@ + +{ + + "extends": [ + ":separateMajorReleases", + ":combinePatchMinorReleases", + ":ignoreUnstable", + ":prImmediately", + ":updateNotScheduled", + ":automergeDisabled", + ":ignoreModulesAndTests", + ":maintainLockFilesDisabled", + ":autodetectPinVersions" + ], + "ignorePaths": [ + ".kokoro/requirements.txt", + ".github/workflows/approve-readme.yaml", + ".github/workflows/ci.yaml", + ".github/workflows/renovate_config_check.yaml", + ".github/workflows/samples.yaml" + ], + "customManagers": [ + { + "customType": "regex", + "fileMatch": [ + "^.github/workflows/unmanaged_dependency_check.yaml$" + ], + "matchStrings": [ + "uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@google-cloud-shared-dependencies/v(?.+?)\\n" + ], + "depNameTemplate": "com.google.cloud:sdk-platform-java-config", + "datasourceTemplate": "maven" + } + ], + "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.google.cloud:google-cloud-shared-config" + ], + "semanticCommitType": "build", + "semanticCommitScope": "deps" + }, + { + "packagePatterns": [ + "^com.google.cloud:google-cloud-logging", + "^com.google.cloud:libraries-bom", + "^com.google.cloud.samples:shared-configuration" + ], + "semanticCommitType": "chore", + "semanticCommitScope": "deps" + }, + { + "packagePatterns": [ + "^junit:junit", + "^com.google.truth:truth", + "^org.mockito:mockito-core", + "^org.objenesis:objenesis", + "^com.google.cloud:google-cloud-conformance-tests", + "^org.graalvm.buildtools:junit-platform-native" + ], + "semanticCommitType": "test", + "semanticCommitScope": "deps" + }, + { + "packagePatterns": [ + "^com.google.cloud:google-cloud-" + ], + "ignoreUnstable": false + }, + { + "packagePatterns": [ + "^com.fasterxml.jackson.core" + ], + "groupName": "jackson dependencies" + } + ], + "semanticCommits": true, + "dependencyDashboard": true, + "prConcurrentLimit": 0, + "prHourlyLimit": 0 +} diff --git a/java-logging/samples/install-without-bom/pom.xml b/java-logging/samples/install-without-bom/pom.xml new file mode 100644 index 000000000000..d5934cfad4fc --- /dev/null +++ b/java-logging/samples/install-without-bom/pom.xml @@ -0,0 +1,82 @@ + + + 4.0.0 + com.google.cloud + logging-install-without-bom + jar + Google Cloud Logging Install Without BOM Sample + https://github.com/googleapis/java-logging + + + + com.google.cloud.samples + shared-configuration + 1.2.2 + + + + 1.8 + 1.8 + UTF-8 + + + + + + com.google.cloud + google-cloud-logging + 3.21.3 + + + + + junit + junit + 4.13.2 + test + + + com.google.truth + truth + 1.4.4 + test + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + add-snippets-source + + add-source + + + + ../snippets/src/main/java + + + + + add-snippets-tests + + add-test-source + + + + ../snippets/src/test/java + + + + + + + + diff --git a/java-logging/samples/native-image-sample/README.md b/java-logging/samples/native-image-sample/README.md new file mode 100644 index 000000000000..555c42fbc4e2 --- /dev/null +++ b/java-logging/samples/native-image-sample/README.md @@ -0,0 +1,71 @@ +# Cloud Logging Client Libraries with Native Image + +This application uses the Google Cloud [Logging Client Libraries](https://github.com/googleapis/java-logging) and can be compiled with Native Image Native Image. + +## Setup Instructions + +You will need to follow these prerequisite steps in order to run the samples: + +1. If you have not already, [create a Google Cloud Platform Project](https://cloud.google.com/resource-manager/docs/creating-managing-projects#creating_a_project). + +2. Install the [Google Cloud SDK](https://cloud.google.com/sdk/) which will allow you to run the sample with your project's credentials. + + Once installed, log in with Application Default Credentials using the following command: + + ``` + gcloud auth application-default login + ``` + + **Note:** Authenticating with Application Default Credentials is convenient to use during development, but we recommend [alternate methods of authentication](https://cloud.google.com/docs/authentication/production) during production use. + +3. Install the native image compiler. + + You can follow the [official installation instructions](https://www.graalvm.org/docs/getting-started/#install-graalvm). + After following the instructions, ensure that you install the native image extension installed by running: + + ``` + gu install native-image + ``` + + Once you finish following the instructions, verify that the default version of Java is set to the correct version by running `java -version` in a terminal. + + You will see something similar to the below output: + + ``` + $ java -version + + openjdk version "17.0.3" 2022-04-19 + OpenJDK Runtime Environment GraalVM CE 22.1.0 (build 17.0.3+7-jvmci-22.1-b06) + OpenJDK 64-Bit Server VM GraalVM CE 22.1.0 (build 17.0.3+7-jvmci-22.1-b06, mixed mode, sharing) + ``` + +4. Enable the [Logging APIs](https://console.cloud.google.com/flows/enableapi?apiid=logging.googleapis.com). + +## Sample + +Navigate to this directory in a new terminal. + +1. Compile the application using the native image Compiler. This step may take a few minutes. + + ``` + mvn package -P native -DskipTests + ``` + +2. Run the application: + + ``` + ./target/native-image-sample + ``` + +3. The application will log a message to your local terminal and to Google Cloud Console. + + Navigate to the [Cloud Console Logs Viewer](https://console.cloud.google.com/logs/viewer) to view you logs and find the newly generated log entry in Cloud Console: + ``` + This is a log produced by Native Image. + ``` +### Sample Integration test with Native Image Support +In order to run the sample integration test as a native image, call the following command: + + ``` + mvn test -Pnative + ``` diff --git a/java-logging/samples/native-image-sample/pom.xml b/java-logging/samples/native-image-sample/pom.xml new file mode 100644 index 000000000000..4d358e923b2a --- /dev/null +++ b/java-logging/samples/native-image-sample/pom.xml @@ -0,0 +1,165 @@ + + + + 4.0.0 + com.example.logging + native-image-sample + Native Image Sample + https://github.com/googleapis/java-logging + + + + com.google.cloud.samples + shared-configuration + 1.2.2 + + + + + 1.8 + 1.8 + UTF-8 + + + + + + com.google.cloud + libraries-bom + 26.55.0 + pom + import + + + + + + + com.google.cloud + google-cloud-logging + + + + junit + junit + 4.13.2 + test + + + com.google.truth + truth + 1.4.4 + test + + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.4.2 + + + + true + dependency-jars/ + com.example.logging.NativeImageLoggingSample + + + + + + org.apache.maven.plugins + maven-dependency-plugin + 3.6.1 + + + copy-dependencies + package + + copy-dependencies + + + + ${project.build.directory}/dependency-jars/ + + + + + + + + + + + + native + + + + org.junit.vintage + junit-vintage-engine + 5.10.2 + test + + + org.graalvm.buildtools + junit-platform-native + 0.10.1 + test + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + 3.5.2 + + + **/IT* + + + + + org.graalvm.buildtools + native-maven-plugin + 0.10.1 + true + + com.example.logging.NativeImageLoggingSample + + --no-fallback + --no-server + + + + + build-native + + build + test + + package + + + test-native + + test + + test + + + + + + + + diff --git a/java-logging/samples/native-image-sample/src/main/java/com/example/logging/NativeImageLoggingSample.java b/java-logging/samples/native-image-sample/src/main/java/com/example/logging/NativeImageLoggingSample.java new file mode 100644 index 000000000000..a35a78ad799e --- /dev/null +++ b/java-logging/samples/native-image-sample/src/main/java/com/example/logging/NativeImageLoggingSample.java @@ -0,0 +1,64 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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.example.logging; + +import com.google.cloud.MonitoredResource; +import com.google.cloud.logging.LogEntry; +import com.google.cloud.logging.Logging; +import com.google.cloud.logging.LoggingOptions; +import com.google.cloud.logging.Payload.StringPayload; +import com.google.cloud.logging.Severity; +import java.time.Duration; +import java.time.Instant; +import java.util.Collections; + +/** Basic sample application which writes a log message to Cloud Logging. */ +public class NativeImageLoggingSample { + + /** Runs the Logging Sample Application. */ + public static void main(String[] args) throws Exception { + Instant startTime = Instant.now(); + // Instantiates a client + Logging client = LoggingOptions.getDefaultInstance().getService(); + + // The name of the log to write to + String logName = "nativeimage_logging_sample.log"; + + // The data to write to the log + String text = "This is a log produced by Native Image."; + + LogEntry entry = + LogEntry.newBuilder(StringPayload.of(text)) + .setSeverity(Severity.INFO) + .setLogName(logName) + .setResource(MonitoredResource.newBuilder("global").build()) + .build(); + + client.write(Collections.singleton(entry)); + client.flush(); + client.close(); + + System.out.println(String.format("Logged: %s", text)); + System.out.println("Log message written to Cloud Logging."); + System.out.println( + "See your logs in the Cloud Console: https://console.cloud.google.com/logs/viewer " + + "(Might take a few seconds to load.)"); + Instant endTime = Instant.now(); + Duration duration = Duration.between(startTime, endTime); + System.out.println("Duration: " + duration.toString()); + } +} diff --git a/java-logging/samples/native-image-sample/src/test/java/com/example/logging/ITNativeImageLoggingSample.java b/java-logging/samples/native-image-sample/src/test/java/com/example/logging/ITNativeImageLoggingSample.java new file mode 100644 index 000000000000..1d70ed0c1f4a --- /dev/null +++ b/java-logging/samples/native-image-sample/src/test/java/com/example/logging/ITNativeImageLoggingSample.java @@ -0,0 +1,35 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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.example.logging; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.cloud.testing.junit4.StdOutCaptureRule; +import org.junit.Rule; +import org.junit.Test; + +public class ITNativeImageLoggingSample { + + @Rule public StdOutCaptureRule stdOut = new StdOutCaptureRule(); + + @Test + public void testLogging() throws Exception { + NativeImageLoggingSample.main(new String[] {}); + assertThat(stdOut.getCapturedOutputAsUtf8String()) + .contains("Logged: This is a log produced by Native Image."); + } +} diff --git a/java-logging/samples/pom.xml b/java-logging/samples/pom.xml new file mode 100644 index 000000000000..db6680766245 --- /dev/null +++ b/java-logging/samples/pom.xml @@ -0,0 +1,72 @@ + + + 4.0.0 + com.google.cloud + google-cloud-logging-samples + 0.0.1-SNAPSHOT + pom + Google Cloud Logging Samples Parent + https://github.com/googleapis/java-logging + + Java idiomatic client for Google Cloud Platform services. + + + + + com.google.cloud.samples + shared-configuration + 1.2.2 + + + + 1.8 + 1.8 + UTF-8 + + + + snapshot + install-without-bom + snippets + native-image-sample + + + + + + org.apache.maven.plugins + maven-deploy-plugin + 3.1.3 + + true + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.7.0 + + true + + + + + + + + junit + junit + 4.13.2 + test + + + com.google.truth + truth + 1.4.4 + test + + + diff --git a/java-logging/samples/snapshot/pom.xml b/java-logging/samples/snapshot/pom.xml new file mode 100644 index 000000000000..153333434044 --- /dev/null +++ b/java-logging/samples/snapshot/pom.xml @@ -0,0 +1,82 @@ + + + 4.0.0 + com.google.cloud + logging-snapshot + jar + Google Cloud Logging Snapshot Samples + https://github.com/googleapis/java-logging + + + + com.google.cloud.samples + shared-configuration + 1.2.2 + + + + 1.8 + 1.8 + UTF-8 + + + + + + com.google.cloud + google-cloud-logging + 3.23.10-SNAPSHOT + + + + junit + junit + 4.13.2 + test + + + com.google.truth + truth + 1.4.4 + test + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.6.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/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/copylogentries/AsyncCopyLogEntries.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/copylogentries/AsyncCopyLogEntries.java new file mode 100644 index 000000000000..3457a1515812 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/copylogentries/AsyncCopyLogEntries.java @@ -0,0 +1,50 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_CopyLogEntries_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.CopyLogEntriesRequest; +import com.google.longrunning.Operation; + +public class AsyncCopyLogEntries { + + public static void main(String[] args) throws Exception { + asyncCopyLogEntries(); + } + + public static void asyncCopyLogEntries() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + CopyLogEntriesRequest request = + CopyLogEntriesRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setDestination("destination-1429847026") + .build(); + ApiFuture future = configClient.copyLogEntriesCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_CopyLogEntries_async] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/copylogentries/AsyncCopyLogEntriesLRO.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/copylogentries/AsyncCopyLogEntriesLRO.java new file mode 100644 index 000000000000..2ece2d11a404 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/copylogentries/AsyncCopyLogEntriesLRO.java @@ -0,0 +1,52 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_CopyLogEntries_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.CopyLogEntriesMetadata; +import com.google.logging.v2.CopyLogEntriesRequest; +import com.google.logging.v2.CopyLogEntriesResponse; + +public class AsyncCopyLogEntriesLRO { + + public static void main(String[] args) throws Exception { + asyncCopyLogEntriesLRO(); + } + + public static void asyncCopyLogEntriesLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + CopyLogEntriesRequest request = + CopyLogEntriesRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setDestination("destination-1429847026") + .build(); + OperationFuture future = + configClient.copyLogEntriesOperationCallable().futureCall(request); + // Do something. + CopyLogEntriesResponse response = future.get(); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_CopyLogEntries_LRO_async] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/copylogentries/SyncCopyLogEntries.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/copylogentries/SyncCopyLogEntries.java new file mode 100644 index 000000000000..fb9660eec957 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/copylogentries/SyncCopyLogEntries.java @@ -0,0 +1,47 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_CopyLogEntries_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.CopyLogEntriesRequest; +import com.google.logging.v2.CopyLogEntriesResponse; + +public class SyncCopyLogEntries { + + public static void main(String[] args) throws Exception { + syncCopyLogEntries(); + } + + public static void syncCopyLogEntries() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + CopyLogEntriesRequest request = + CopyLogEntriesRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setDestination("destination-1429847026") + .build(); + CopyLogEntriesResponse response = configClient.copyLogEntriesAsync(request).get(); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_CopyLogEntries_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/create/SyncCreateSetCredentialsProvider.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..6f0dcbff6a55 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,44 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.logging.v2.ConfigClient; +import com.google.cloud.logging.v2.ConfigSettings; +import com.google.cloud.logging.v2.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + ConfigSettings configSettings = + ConfigSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + ConfigClient configClient = ConfigClient.create(configSettings); + } +} +// [END logging_v2_generated_ConfigServiceV2_Create_SetCredentialsProvider_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/create/SyncCreateSetEndpoint.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..779105ade316 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/create/SyncCreateSetEndpoint.java @@ -0,0 +1,40 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_Create_SetEndpoint_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.cloud.logging.v2.ConfigSettings; +import com.google.cloud.logging.v2.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + ConfigSettings configSettings = ConfigSettings.newBuilder().setEndpoint(myEndpoint).build(); + ConfigClient configClient = ConfigClient.create(configSettings); + } +} +// [END logging_v2_generated_ConfigServiceV2_Create_SetEndpoint_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createbucket/AsyncCreateBucket.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createbucket/AsyncCreateBucket.java new file mode 100644 index 000000000000..9a8ba0fee15e --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createbucket/AsyncCreateBucket.java @@ -0,0 +1,51 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_CreateBucket_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.CreateBucketRequest; +import com.google.logging.v2.LocationName; +import com.google.logging.v2.LogBucket; + +public class AsyncCreateBucket { + + public static void main(String[] args) throws Exception { + asyncCreateBucket(); + } + + public static void asyncCreateBucket() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + CreateBucketRequest request = + CreateBucketRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setBucketId("bucketId-1603305307") + .setBucket(LogBucket.newBuilder().build()) + .build(); + ApiFuture future = configClient.createBucketCallable().futureCall(request); + // Do something. + LogBucket response = future.get(); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_CreateBucket_async] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createbucket/SyncCreateBucket.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createbucket/SyncCreateBucket.java new file mode 100644 index 000000000000..4c75b2b52411 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createbucket/SyncCreateBucket.java @@ -0,0 +1,48 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_CreateBucket_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.CreateBucketRequest; +import com.google.logging.v2.LocationName; +import com.google.logging.v2.LogBucket; + +public class SyncCreateBucket { + + public static void main(String[] args) throws Exception { + syncCreateBucket(); + } + + public static void syncCreateBucket() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + CreateBucketRequest request = + CreateBucketRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setBucketId("bucketId-1603305307") + .setBucket(LogBucket.newBuilder().build()) + .build(); + LogBucket response = configClient.createBucket(request); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_CreateBucket_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createbucketasync/AsyncCreateBucketAsync.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createbucketasync/AsyncCreateBucketAsync.java new file mode 100644 index 000000000000..ab71025f6fa6 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createbucketasync/AsyncCreateBucketAsync.java @@ -0,0 +1,52 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_CreateBucketAsync_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.CreateBucketRequest; +import com.google.logging.v2.LocationName; +import com.google.logging.v2.LogBucket; +import com.google.longrunning.Operation; + +public class AsyncCreateBucketAsync { + + public static void main(String[] args) throws Exception { + asyncCreateBucketAsync(); + } + + public static void asyncCreateBucketAsync() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + CreateBucketRequest request = + CreateBucketRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setBucketId("bucketId-1603305307") + .setBucket(LogBucket.newBuilder().build()) + .build(); + ApiFuture future = configClient.createBucketAsyncCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_CreateBucketAsync_async] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createbucketasync/AsyncCreateBucketAsyncLRO.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createbucketasync/AsyncCreateBucketAsyncLRO.java new file mode 100644 index 000000000000..ece498ca17f6 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createbucketasync/AsyncCreateBucketAsyncLRO.java @@ -0,0 +1,53 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_CreateBucketAsync_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.BucketMetadata; +import com.google.logging.v2.CreateBucketRequest; +import com.google.logging.v2.LocationName; +import com.google.logging.v2.LogBucket; + +public class AsyncCreateBucketAsyncLRO { + + public static void main(String[] args) throws Exception { + asyncCreateBucketAsyncLRO(); + } + + public static void asyncCreateBucketAsyncLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + CreateBucketRequest request = + CreateBucketRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setBucketId("bucketId-1603305307") + .setBucket(LogBucket.newBuilder().build()) + .build(); + OperationFuture future = + configClient.createBucketAsyncOperationCallable().futureCall(request); + // Do something. + LogBucket response = future.get(); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_CreateBucketAsync_LRO_async] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createbucketasync/SyncCreateBucketAsync.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createbucketasync/SyncCreateBucketAsync.java new file mode 100644 index 000000000000..339e72d43af1 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createbucketasync/SyncCreateBucketAsync.java @@ -0,0 +1,48 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_CreateBucketAsync_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.CreateBucketRequest; +import com.google.logging.v2.LocationName; +import com.google.logging.v2.LogBucket; + +public class SyncCreateBucketAsync { + + public static void main(String[] args) throws Exception { + syncCreateBucketAsync(); + } + + public static void syncCreateBucketAsync() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + CreateBucketRequest request = + CreateBucketRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setBucketId("bucketId-1603305307") + .setBucket(LogBucket.newBuilder().build()) + .build(); + LogBucket response = configClient.createBucketAsyncAsync(request).get(); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_CreateBucketAsync_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createexclusion/AsyncCreateExclusion.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createexclusion/AsyncCreateExclusion.java new file mode 100644 index 000000000000..0d9629966108 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createexclusion/AsyncCreateExclusion.java @@ -0,0 +1,50 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_CreateExclusion_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.CreateExclusionRequest; +import com.google.logging.v2.LogExclusion; +import com.google.logging.v2.ProjectName; + +public class AsyncCreateExclusion { + + public static void main(String[] args) throws Exception { + asyncCreateExclusion(); + } + + public static void asyncCreateExclusion() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + CreateExclusionRequest request = + CreateExclusionRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setExclusion(LogExclusion.newBuilder().build()) + .build(); + ApiFuture future = configClient.createExclusionCallable().futureCall(request); + // Do something. + LogExclusion response = future.get(); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_CreateExclusion_async] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createexclusion/SyncCreateExclusion.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createexclusion/SyncCreateExclusion.java new file mode 100644 index 000000000000..8052f4d4441e --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createexclusion/SyncCreateExclusion.java @@ -0,0 +1,47 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_CreateExclusion_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.CreateExclusionRequest; +import com.google.logging.v2.LogExclusion; +import com.google.logging.v2.ProjectName; + +public class SyncCreateExclusion { + + public static void main(String[] args) throws Exception { + syncCreateExclusion(); + } + + public static void syncCreateExclusion() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + CreateExclusionRequest request = + CreateExclusionRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setExclusion(LogExclusion.newBuilder().build()) + .build(); + LogExclusion response = configClient.createExclusion(request); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_CreateExclusion_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createexclusion/SyncCreateExclusionBillingaccountnameLogexclusion.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createexclusion/SyncCreateExclusionBillingaccountnameLogexclusion.java new file mode 100644 index 000000000000..f33b3988b1a7 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createexclusion/SyncCreateExclusionBillingaccountnameLogexclusion.java @@ -0,0 +1,43 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_CreateExclusion_BillingaccountnameLogexclusion_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.BillingAccountName; +import com.google.logging.v2.LogExclusion; + +public class SyncCreateExclusionBillingaccountnameLogexclusion { + + public static void main(String[] args) throws Exception { + syncCreateExclusionBillingaccountnameLogexclusion(); + } + + public static void syncCreateExclusionBillingaccountnameLogexclusion() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]"); + LogExclusion exclusion = LogExclusion.newBuilder().build(); + LogExclusion response = configClient.createExclusion(parent, exclusion); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_CreateExclusion_BillingaccountnameLogexclusion_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createexclusion/SyncCreateExclusionFoldernameLogexclusion.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createexclusion/SyncCreateExclusionFoldernameLogexclusion.java new file mode 100644 index 000000000000..d7847d2d1dc1 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createexclusion/SyncCreateExclusionFoldernameLogexclusion.java @@ -0,0 +1,43 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_CreateExclusion_FoldernameLogexclusion_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.FolderName; +import com.google.logging.v2.LogExclusion; + +public class SyncCreateExclusionFoldernameLogexclusion { + + public static void main(String[] args) throws Exception { + syncCreateExclusionFoldernameLogexclusion(); + } + + public static void syncCreateExclusionFoldernameLogexclusion() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + FolderName parent = FolderName.of("[FOLDER]"); + LogExclusion exclusion = LogExclusion.newBuilder().build(); + LogExclusion response = configClient.createExclusion(parent, exclusion); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_CreateExclusion_FoldernameLogexclusion_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createexclusion/SyncCreateExclusionOrganizationnameLogexclusion.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createexclusion/SyncCreateExclusionOrganizationnameLogexclusion.java new file mode 100644 index 000000000000..6e8ff7bc4f54 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createexclusion/SyncCreateExclusionOrganizationnameLogexclusion.java @@ -0,0 +1,43 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_CreateExclusion_OrganizationnameLogexclusion_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogExclusion; +import com.google.logging.v2.OrganizationName; + +public class SyncCreateExclusionOrganizationnameLogexclusion { + + public static void main(String[] args) throws Exception { + syncCreateExclusionOrganizationnameLogexclusion(); + } + + public static void syncCreateExclusionOrganizationnameLogexclusion() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + LogExclusion exclusion = LogExclusion.newBuilder().build(); + LogExclusion response = configClient.createExclusion(parent, exclusion); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_CreateExclusion_OrganizationnameLogexclusion_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createexclusion/SyncCreateExclusionProjectnameLogexclusion.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createexclusion/SyncCreateExclusionProjectnameLogexclusion.java new file mode 100644 index 000000000000..0ec4bbe1c2da --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createexclusion/SyncCreateExclusionProjectnameLogexclusion.java @@ -0,0 +1,43 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_CreateExclusion_ProjectnameLogexclusion_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogExclusion; +import com.google.logging.v2.ProjectName; + +public class SyncCreateExclusionProjectnameLogexclusion { + + public static void main(String[] args) throws Exception { + syncCreateExclusionProjectnameLogexclusion(); + } + + public static void syncCreateExclusionProjectnameLogexclusion() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + ProjectName parent = ProjectName.of("[PROJECT]"); + LogExclusion exclusion = LogExclusion.newBuilder().build(); + LogExclusion response = configClient.createExclusion(parent, exclusion); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_CreateExclusion_ProjectnameLogexclusion_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createexclusion/SyncCreateExclusionStringLogexclusion.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createexclusion/SyncCreateExclusionStringLogexclusion.java new file mode 100644 index 000000000000..e42be122a51b --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createexclusion/SyncCreateExclusionStringLogexclusion.java @@ -0,0 +1,43 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_CreateExclusion_StringLogexclusion_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogExclusion; +import com.google.logging.v2.ProjectName; + +public class SyncCreateExclusionStringLogexclusion { + + public static void main(String[] args) throws Exception { + syncCreateExclusionStringLogexclusion(); + } + + public static void syncCreateExclusionStringLogexclusion() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + String parent = ProjectName.of("[PROJECT]").toString(); + LogExclusion exclusion = LogExclusion.newBuilder().build(); + LogExclusion response = configClient.createExclusion(parent, exclusion); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_CreateExclusion_StringLogexclusion_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createlink/AsyncCreateLink.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createlink/AsyncCreateLink.java new file mode 100644 index 000000000000..f01fb495cf30 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createlink/AsyncCreateLink.java @@ -0,0 +1,54 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_CreateLink_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.CreateLinkRequest; +import com.google.logging.v2.Link; +import com.google.logging.v2.LogBucketName; +import com.google.longrunning.Operation; + +public class AsyncCreateLink { + + public static void main(String[] args) throws Exception { + asyncCreateLink(); + } + + public static void asyncCreateLink() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + CreateLinkRequest request = + CreateLinkRequest.newBuilder() + .setParent( + LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]") + .toString()) + .setLink(Link.newBuilder().build()) + .setLinkId("linkId-1102667083") + .build(); + ApiFuture future = configClient.createLinkCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_CreateLink_async] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createlink/AsyncCreateLinkLRO.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createlink/AsyncCreateLinkLRO.java new file mode 100644 index 000000000000..5ad384c9ed68 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createlink/AsyncCreateLinkLRO.java @@ -0,0 +1,55 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_CreateLink_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.CreateLinkRequest; +import com.google.logging.v2.Link; +import com.google.logging.v2.LinkMetadata; +import com.google.logging.v2.LogBucketName; + +public class AsyncCreateLinkLRO { + + public static void main(String[] args) throws Exception { + asyncCreateLinkLRO(); + } + + public static void asyncCreateLinkLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + CreateLinkRequest request = + CreateLinkRequest.newBuilder() + .setParent( + LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]") + .toString()) + .setLink(Link.newBuilder().build()) + .setLinkId("linkId-1102667083") + .build(); + OperationFuture future = + configClient.createLinkOperationCallable().futureCall(request); + // Do something. + Link response = future.get(); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_CreateLink_LRO_async] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createlink/SyncCreateLink.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createlink/SyncCreateLink.java new file mode 100644 index 000000000000..43d536c2049b --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createlink/SyncCreateLink.java @@ -0,0 +1,50 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_CreateLink_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.CreateLinkRequest; +import com.google.logging.v2.Link; +import com.google.logging.v2.LogBucketName; + +public class SyncCreateLink { + + public static void main(String[] args) throws Exception { + syncCreateLink(); + } + + public static void syncCreateLink() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + CreateLinkRequest request = + CreateLinkRequest.newBuilder() + .setParent( + LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]") + .toString()) + .setLink(Link.newBuilder().build()) + .setLinkId("linkId-1102667083") + .build(); + Link response = configClient.createLinkAsync(request).get(); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_CreateLink_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createlink/SyncCreateLinkLogbucketnameLinkString.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createlink/SyncCreateLinkLogbucketnameLinkString.java new file mode 100644 index 000000000000..d145ec4dc258 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createlink/SyncCreateLinkLogbucketnameLinkString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_CreateLink_LogbucketnameLinkString_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.Link; +import com.google.logging.v2.LogBucketName; + +public class SyncCreateLinkLogbucketnameLinkString { + + public static void main(String[] args) throws Exception { + syncCreateLinkLogbucketnameLinkString(); + } + + public static void syncCreateLinkLogbucketnameLinkString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + LogBucketName parent = + LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]"); + Link link = Link.newBuilder().build(); + String linkId = "linkId-1102667083"; + Link response = configClient.createLinkAsync(parent, link, linkId).get(); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_CreateLink_LogbucketnameLinkString_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createlink/SyncCreateLinkStringLinkString.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createlink/SyncCreateLinkStringLinkString.java new file mode 100644 index 000000000000..dca103f6a9cf --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createlink/SyncCreateLinkStringLinkString.java @@ -0,0 +1,46 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_CreateLink_StringLinkString_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.Link; +import com.google.logging.v2.LogBucketName; + +public class SyncCreateLinkStringLinkString { + + public static void main(String[] args) throws Exception { + syncCreateLinkStringLinkString(); + } + + public static void syncCreateLinkStringLinkString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + String parent = + LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]") + .toString(); + Link link = Link.newBuilder().build(); + String linkId = "linkId-1102667083"; + Link response = configClient.createLinkAsync(parent, link, linkId).get(); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_CreateLink_StringLinkString_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createsink/AsyncCreateSink.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createsink/AsyncCreateSink.java new file mode 100644 index 000000000000..5a15c56ee75d --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createsink/AsyncCreateSink.java @@ -0,0 +1,51 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_CreateSink_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.CreateSinkRequest; +import com.google.logging.v2.LogSink; +import com.google.logging.v2.ProjectName; + +public class AsyncCreateSink { + + public static void main(String[] args) throws Exception { + asyncCreateSink(); + } + + public static void asyncCreateSink() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + CreateSinkRequest request = + CreateSinkRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setSink(LogSink.newBuilder().build()) + .setUniqueWriterIdentity(true) + .build(); + ApiFuture future = configClient.createSinkCallable().futureCall(request); + // Do something. + LogSink response = future.get(); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_CreateSink_async] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createsink/SyncCreateSink.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createsink/SyncCreateSink.java new file mode 100644 index 000000000000..82606f679f29 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createsink/SyncCreateSink.java @@ -0,0 +1,48 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_CreateSink_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.CreateSinkRequest; +import com.google.logging.v2.LogSink; +import com.google.logging.v2.ProjectName; + +public class SyncCreateSink { + + public static void main(String[] args) throws Exception { + syncCreateSink(); + } + + public static void syncCreateSink() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + CreateSinkRequest request = + CreateSinkRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setSink(LogSink.newBuilder().build()) + .setUniqueWriterIdentity(true) + .build(); + LogSink response = configClient.createSink(request); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_CreateSink_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createsink/SyncCreateSinkBillingaccountnameLogsink.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createsink/SyncCreateSinkBillingaccountnameLogsink.java new file mode 100644 index 000000000000..2a3f9708c535 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createsink/SyncCreateSinkBillingaccountnameLogsink.java @@ -0,0 +1,43 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_CreateSink_BillingaccountnameLogsink_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.BillingAccountName; +import com.google.logging.v2.LogSink; + +public class SyncCreateSinkBillingaccountnameLogsink { + + public static void main(String[] args) throws Exception { + syncCreateSinkBillingaccountnameLogsink(); + } + + public static void syncCreateSinkBillingaccountnameLogsink() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]"); + LogSink sink = LogSink.newBuilder().build(); + LogSink response = configClient.createSink(parent, sink); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_CreateSink_BillingaccountnameLogsink_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createsink/SyncCreateSinkFoldernameLogsink.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createsink/SyncCreateSinkFoldernameLogsink.java new file mode 100644 index 000000000000..f99b225f498a --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createsink/SyncCreateSinkFoldernameLogsink.java @@ -0,0 +1,43 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_CreateSink_FoldernameLogsink_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.FolderName; +import com.google.logging.v2.LogSink; + +public class SyncCreateSinkFoldernameLogsink { + + public static void main(String[] args) throws Exception { + syncCreateSinkFoldernameLogsink(); + } + + public static void syncCreateSinkFoldernameLogsink() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + FolderName parent = FolderName.of("[FOLDER]"); + LogSink sink = LogSink.newBuilder().build(); + LogSink response = configClient.createSink(parent, sink); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_CreateSink_FoldernameLogsink_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createsink/SyncCreateSinkOrganizationnameLogsink.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createsink/SyncCreateSinkOrganizationnameLogsink.java new file mode 100644 index 000000000000..2e3831ad5431 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createsink/SyncCreateSinkOrganizationnameLogsink.java @@ -0,0 +1,43 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_CreateSink_OrganizationnameLogsink_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogSink; +import com.google.logging.v2.OrganizationName; + +public class SyncCreateSinkOrganizationnameLogsink { + + public static void main(String[] args) throws Exception { + syncCreateSinkOrganizationnameLogsink(); + } + + public static void syncCreateSinkOrganizationnameLogsink() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + LogSink sink = LogSink.newBuilder().build(); + LogSink response = configClient.createSink(parent, sink); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_CreateSink_OrganizationnameLogsink_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createsink/SyncCreateSinkProjectnameLogsink.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createsink/SyncCreateSinkProjectnameLogsink.java new file mode 100644 index 000000000000..782587b661c4 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createsink/SyncCreateSinkProjectnameLogsink.java @@ -0,0 +1,43 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_CreateSink_ProjectnameLogsink_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogSink; +import com.google.logging.v2.ProjectName; + +public class SyncCreateSinkProjectnameLogsink { + + public static void main(String[] args) throws Exception { + syncCreateSinkProjectnameLogsink(); + } + + public static void syncCreateSinkProjectnameLogsink() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + ProjectName parent = ProjectName.of("[PROJECT]"); + LogSink sink = LogSink.newBuilder().build(); + LogSink response = configClient.createSink(parent, sink); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_CreateSink_ProjectnameLogsink_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createsink/SyncCreateSinkStringLogsink.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createsink/SyncCreateSinkStringLogsink.java new file mode 100644 index 000000000000..f53303f00071 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createsink/SyncCreateSinkStringLogsink.java @@ -0,0 +1,43 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_CreateSink_StringLogsink_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogSink; +import com.google.logging.v2.ProjectName; + +public class SyncCreateSinkStringLogsink { + + public static void main(String[] args) throws Exception { + syncCreateSinkStringLogsink(); + } + + public static void syncCreateSinkStringLogsink() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + String parent = ProjectName.of("[PROJECT]").toString(); + LogSink sink = LogSink.newBuilder().build(); + LogSink response = configClient.createSink(parent, sink); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_CreateSink_StringLogsink_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createview/AsyncCreateView.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createview/AsyncCreateView.java new file mode 100644 index 000000000000..a12eb482b0f6 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createview/AsyncCreateView.java @@ -0,0 +1,50 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_CreateView_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.CreateViewRequest; +import com.google.logging.v2.LogView; + +public class AsyncCreateView { + + public static void main(String[] args) throws Exception { + asyncCreateView(); + } + + public static void asyncCreateView() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + CreateViewRequest request = + CreateViewRequest.newBuilder() + .setParent("parent-995424086") + .setViewId("viewId-816632160") + .setView(LogView.newBuilder().build()) + .build(); + ApiFuture future = configClient.createViewCallable().futureCall(request); + // Do something. + LogView response = future.get(); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_CreateView_async] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createview/SyncCreateView.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createview/SyncCreateView.java new file mode 100644 index 000000000000..09a6ab22ba55 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/createview/SyncCreateView.java @@ -0,0 +1,47 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_CreateView_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.CreateViewRequest; +import com.google.logging.v2.LogView; + +public class SyncCreateView { + + public static void main(String[] args) throws Exception { + syncCreateView(); + } + + public static void syncCreateView() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + CreateViewRequest request = + CreateViewRequest.newBuilder() + .setParent("parent-995424086") + .setViewId("viewId-816632160") + .setView(LogView.newBuilder().build()) + .build(); + LogView response = configClient.createView(request); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_CreateView_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/deletebucket/AsyncDeleteBucket.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/deletebucket/AsyncDeleteBucket.java new file mode 100644 index 000000000000..80948c0cd028 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/deletebucket/AsyncDeleteBucket.java @@ -0,0 +1,51 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_DeleteBucket_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.DeleteBucketRequest; +import com.google.logging.v2.LogBucketName; +import com.google.protobuf.Empty; + +public class AsyncDeleteBucket { + + public static void main(String[] args) throws Exception { + asyncDeleteBucket(); + } + + public static void asyncDeleteBucket() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + DeleteBucketRequest request = + DeleteBucketRequest.newBuilder() + .setName( + LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]") + .toString()) + .build(); + ApiFuture future = configClient.deleteBucketCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_DeleteBucket_async] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/deletebucket/SyncDeleteBucket.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/deletebucket/SyncDeleteBucket.java new file mode 100644 index 000000000000..bbc3866a5b0d --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/deletebucket/SyncDeleteBucket.java @@ -0,0 +1,48 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_DeleteBucket_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.DeleteBucketRequest; +import com.google.logging.v2.LogBucketName; +import com.google.protobuf.Empty; + +public class SyncDeleteBucket { + + public static void main(String[] args) throws Exception { + syncDeleteBucket(); + } + + public static void syncDeleteBucket() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + DeleteBucketRequest request = + DeleteBucketRequest.newBuilder() + .setName( + LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]") + .toString()) + .build(); + configClient.deleteBucket(request); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_DeleteBucket_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/deleteexclusion/AsyncDeleteExclusion.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/deleteexclusion/AsyncDeleteExclusion.java new file mode 100644 index 000000000000..598124cf8dc1 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/deleteexclusion/AsyncDeleteExclusion.java @@ -0,0 +1,50 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_DeleteExclusion_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.DeleteExclusionRequest; +import com.google.logging.v2.LogExclusionName; +import com.google.protobuf.Empty; + +public class AsyncDeleteExclusion { + + public static void main(String[] args) throws Exception { + asyncDeleteExclusion(); + } + + public static void asyncDeleteExclusion() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + DeleteExclusionRequest request = + DeleteExclusionRequest.newBuilder() + .setName( + LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString()) + .build(); + ApiFuture future = configClient.deleteExclusionCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_DeleteExclusion_async] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/deleteexclusion/SyncDeleteExclusion.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/deleteexclusion/SyncDeleteExclusion.java new file mode 100644 index 000000000000..5968e746438b --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/deleteexclusion/SyncDeleteExclusion.java @@ -0,0 +1,47 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_DeleteExclusion_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.DeleteExclusionRequest; +import com.google.logging.v2.LogExclusionName; +import com.google.protobuf.Empty; + +public class SyncDeleteExclusion { + + public static void main(String[] args) throws Exception { + syncDeleteExclusion(); + } + + public static void syncDeleteExclusion() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + DeleteExclusionRequest request = + DeleteExclusionRequest.newBuilder() + .setName( + LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString()) + .build(); + configClient.deleteExclusion(request); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_DeleteExclusion_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/deleteexclusion/SyncDeleteExclusionLogexclusionname.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/deleteexclusion/SyncDeleteExclusionLogexclusionname.java new file mode 100644 index 000000000000..151968316420 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/deleteexclusion/SyncDeleteExclusionLogexclusionname.java @@ -0,0 +1,42 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_DeleteExclusion_Logexclusionname_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogExclusionName; +import com.google.protobuf.Empty; + +public class SyncDeleteExclusionLogexclusionname { + + public static void main(String[] args) throws Exception { + syncDeleteExclusionLogexclusionname(); + } + + public static void syncDeleteExclusionLogexclusionname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + LogExclusionName name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]"); + configClient.deleteExclusion(name); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_DeleteExclusion_Logexclusionname_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/deleteexclusion/SyncDeleteExclusionString.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/deleteexclusion/SyncDeleteExclusionString.java new file mode 100644 index 000000000000..0d35beaee6c9 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/deleteexclusion/SyncDeleteExclusionString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_DeleteExclusion_String_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogExclusionName; +import com.google.protobuf.Empty; + +public class SyncDeleteExclusionString { + + public static void main(String[] args) throws Exception { + syncDeleteExclusionString(); + } + + public static void syncDeleteExclusionString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + String name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString(); + configClient.deleteExclusion(name); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_DeleteExclusion_String_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/deletelink/AsyncDeleteLink.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/deletelink/AsyncDeleteLink.java new file mode 100644 index 000000000000..45ebdf8c2079 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/deletelink/AsyncDeleteLink.java @@ -0,0 +1,52 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_DeleteLink_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.DeleteLinkRequest; +import com.google.logging.v2.LinkName; +import com.google.longrunning.Operation; + +public class AsyncDeleteLink { + + public static void main(String[] args) throws Exception { + asyncDeleteLink(); + } + + public static void asyncDeleteLink() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + DeleteLinkRequest request = + DeleteLinkRequest.newBuilder() + .setName( + LinkName.ofProjectLocationBucketLinkName( + "[PROJECT]", "[LOCATION]", "[BUCKET]", "[LINK]") + .toString()) + .build(); + ApiFuture future = configClient.deleteLinkCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_DeleteLink_async] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/deletelink/AsyncDeleteLinkLRO.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/deletelink/AsyncDeleteLinkLRO.java new file mode 100644 index 000000000000..60d5d5315364 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/deletelink/AsyncDeleteLinkLRO.java @@ -0,0 +1,54 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_DeleteLink_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.DeleteLinkRequest; +import com.google.logging.v2.LinkMetadata; +import com.google.logging.v2.LinkName; +import com.google.protobuf.Empty; + +public class AsyncDeleteLinkLRO { + + public static void main(String[] args) throws Exception { + asyncDeleteLinkLRO(); + } + + public static void asyncDeleteLinkLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + DeleteLinkRequest request = + DeleteLinkRequest.newBuilder() + .setName( + LinkName.ofProjectLocationBucketLinkName( + "[PROJECT]", "[LOCATION]", "[BUCKET]", "[LINK]") + .toString()) + .build(); + OperationFuture future = + configClient.deleteLinkOperationCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_DeleteLink_LRO_async] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/deletelink/SyncDeleteLink.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/deletelink/SyncDeleteLink.java new file mode 100644 index 000000000000..88be5f0d9a0b --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/deletelink/SyncDeleteLink.java @@ -0,0 +1,49 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_DeleteLink_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.DeleteLinkRequest; +import com.google.logging.v2.LinkName; +import com.google.protobuf.Empty; + +public class SyncDeleteLink { + + public static void main(String[] args) throws Exception { + syncDeleteLink(); + } + + public static void syncDeleteLink() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + DeleteLinkRequest request = + DeleteLinkRequest.newBuilder() + .setName( + LinkName.ofProjectLocationBucketLinkName( + "[PROJECT]", "[LOCATION]", "[BUCKET]", "[LINK]") + .toString()) + .build(); + configClient.deleteLinkAsync(request).get(); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_DeleteLink_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/deletelink/SyncDeleteLinkLinkname.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/deletelink/SyncDeleteLinkLinkname.java new file mode 100644 index 000000000000..55b32322ca15 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/deletelink/SyncDeleteLinkLinkname.java @@ -0,0 +1,43 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_DeleteLink_Linkname_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LinkName; +import com.google.protobuf.Empty; + +public class SyncDeleteLinkLinkname { + + public static void main(String[] args) throws Exception { + syncDeleteLinkLinkname(); + } + + public static void syncDeleteLinkLinkname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + LinkName name = + LinkName.ofProjectLocationBucketLinkName("[PROJECT]", "[LOCATION]", "[BUCKET]", "[LINK]"); + configClient.deleteLinkAsync(name).get(); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_DeleteLink_Linkname_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/deletelink/SyncDeleteLinkString.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/deletelink/SyncDeleteLinkString.java new file mode 100644 index 000000000000..454c26b70431 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/deletelink/SyncDeleteLinkString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_DeleteLink_String_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LinkName; +import com.google.protobuf.Empty; + +public class SyncDeleteLinkString { + + public static void main(String[] args) throws Exception { + syncDeleteLinkString(); + } + + public static void syncDeleteLinkString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + String name = + LinkName.ofProjectLocationBucketLinkName("[PROJECT]", "[LOCATION]", "[BUCKET]", "[LINK]") + .toString(); + configClient.deleteLinkAsync(name).get(); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_DeleteLink_String_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/deletesink/AsyncDeleteSink.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/deletesink/AsyncDeleteSink.java new file mode 100644 index 000000000000..a745768248f7 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/deletesink/AsyncDeleteSink.java @@ -0,0 +1,49 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_DeleteSink_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.DeleteSinkRequest; +import com.google.logging.v2.LogSinkName; +import com.google.protobuf.Empty; + +public class AsyncDeleteSink { + + public static void main(String[] args) throws Exception { + asyncDeleteSink(); + } + + public static void asyncDeleteSink() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + DeleteSinkRequest request = + DeleteSinkRequest.newBuilder() + .setSinkName(LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString()) + .build(); + ApiFuture future = configClient.deleteSinkCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_DeleteSink_async] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/deletesink/SyncDeleteSink.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/deletesink/SyncDeleteSink.java new file mode 100644 index 000000000000..112413e45ac8 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/deletesink/SyncDeleteSink.java @@ -0,0 +1,46 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_DeleteSink_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.DeleteSinkRequest; +import com.google.logging.v2.LogSinkName; +import com.google.protobuf.Empty; + +public class SyncDeleteSink { + + public static void main(String[] args) throws Exception { + syncDeleteSink(); + } + + public static void syncDeleteSink() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + DeleteSinkRequest request = + DeleteSinkRequest.newBuilder() + .setSinkName(LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString()) + .build(); + configClient.deleteSink(request); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_DeleteSink_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/deletesink/SyncDeleteSinkLogsinkname.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/deletesink/SyncDeleteSinkLogsinkname.java new file mode 100644 index 000000000000..0078edc7deca --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/deletesink/SyncDeleteSinkLogsinkname.java @@ -0,0 +1,42 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_DeleteSink_Logsinkname_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogSinkName; +import com.google.protobuf.Empty; + +public class SyncDeleteSinkLogsinkname { + + public static void main(String[] args) throws Exception { + syncDeleteSinkLogsinkname(); + } + + public static void syncDeleteSinkLogsinkname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]"); + configClient.deleteSink(sinkName); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_DeleteSink_Logsinkname_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/deletesink/SyncDeleteSinkString.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/deletesink/SyncDeleteSinkString.java new file mode 100644 index 000000000000..e70e5ef44f4c --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/deletesink/SyncDeleteSinkString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_DeleteSink_String_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogSinkName; +import com.google.protobuf.Empty; + +public class SyncDeleteSinkString { + + public static void main(String[] args) throws Exception { + syncDeleteSinkString(); + } + + public static void syncDeleteSinkString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + String sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString(); + configClient.deleteSink(sinkName); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_DeleteSink_String_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/deleteview/AsyncDeleteView.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/deleteview/AsyncDeleteView.java new file mode 100644 index 000000000000..a74dc54bd2db --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/deleteview/AsyncDeleteView.java @@ -0,0 +1,52 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_DeleteView_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.DeleteViewRequest; +import com.google.logging.v2.LogViewName; +import com.google.protobuf.Empty; + +public class AsyncDeleteView { + + public static void main(String[] args) throws Exception { + asyncDeleteView(); + } + + public static void asyncDeleteView() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + DeleteViewRequest request = + DeleteViewRequest.newBuilder() + .setName( + LogViewName.ofProjectLocationBucketViewName( + "[PROJECT]", "[LOCATION]", "[BUCKET]", "[VIEW]") + .toString()) + .build(); + ApiFuture future = configClient.deleteViewCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_DeleteView_async] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/deleteview/SyncDeleteView.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/deleteview/SyncDeleteView.java new file mode 100644 index 000000000000..9428a2dc9614 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/deleteview/SyncDeleteView.java @@ -0,0 +1,49 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_DeleteView_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.DeleteViewRequest; +import com.google.logging.v2.LogViewName; +import com.google.protobuf.Empty; + +public class SyncDeleteView { + + public static void main(String[] args) throws Exception { + syncDeleteView(); + } + + public static void syncDeleteView() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + DeleteViewRequest request = + DeleteViewRequest.newBuilder() + .setName( + LogViewName.ofProjectLocationBucketViewName( + "[PROJECT]", "[LOCATION]", "[BUCKET]", "[VIEW]") + .toString()) + .build(); + configClient.deleteView(request); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_DeleteView_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getbucket/AsyncGetBucket.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getbucket/AsyncGetBucket.java new file mode 100644 index 000000000000..03e006bc1a9e --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getbucket/AsyncGetBucket.java @@ -0,0 +1,51 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_GetBucket_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.GetBucketRequest; +import com.google.logging.v2.LogBucket; +import com.google.logging.v2.LogBucketName; + +public class AsyncGetBucket { + + public static void main(String[] args) throws Exception { + asyncGetBucket(); + } + + public static void asyncGetBucket() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + GetBucketRequest request = + GetBucketRequest.newBuilder() + .setName( + LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]") + .toString()) + .build(); + ApiFuture future = configClient.getBucketCallable().futureCall(request); + // Do something. + LogBucket response = future.get(); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_GetBucket_async] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getbucket/SyncGetBucket.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getbucket/SyncGetBucket.java new file mode 100644 index 000000000000..72c55025dae3 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getbucket/SyncGetBucket.java @@ -0,0 +1,48 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_GetBucket_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.GetBucketRequest; +import com.google.logging.v2.LogBucket; +import com.google.logging.v2.LogBucketName; + +public class SyncGetBucket { + + public static void main(String[] args) throws Exception { + syncGetBucket(); + } + + public static void syncGetBucket() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + GetBucketRequest request = + GetBucketRequest.newBuilder() + .setName( + LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]") + .toString()) + .build(); + LogBucket response = configClient.getBucket(request); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_GetBucket_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getcmeksettings/AsyncGetCmekSettings.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getcmeksettings/AsyncGetCmekSettings.java new file mode 100644 index 000000000000..a795c405fcb7 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getcmeksettings/AsyncGetCmekSettings.java @@ -0,0 +1,49 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_GetCmekSettings_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.CmekSettings; +import com.google.logging.v2.CmekSettingsName; +import com.google.logging.v2.GetCmekSettingsRequest; + +public class AsyncGetCmekSettings { + + public static void main(String[] args) throws Exception { + asyncGetCmekSettings(); + } + + public static void asyncGetCmekSettings() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + GetCmekSettingsRequest request = + GetCmekSettingsRequest.newBuilder() + .setName(CmekSettingsName.ofProjectName("[PROJECT]").toString()) + .build(); + ApiFuture future = configClient.getCmekSettingsCallable().futureCall(request); + // Do something. + CmekSettings response = future.get(); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_GetCmekSettings_async] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getcmeksettings/SyncGetCmekSettings.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getcmeksettings/SyncGetCmekSettings.java new file mode 100644 index 000000000000..91aa99a2eb8b --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getcmeksettings/SyncGetCmekSettings.java @@ -0,0 +1,46 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_GetCmekSettings_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.CmekSettings; +import com.google.logging.v2.CmekSettingsName; +import com.google.logging.v2.GetCmekSettingsRequest; + +public class SyncGetCmekSettings { + + public static void main(String[] args) throws Exception { + syncGetCmekSettings(); + } + + public static void syncGetCmekSettings() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + GetCmekSettingsRequest request = + GetCmekSettingsRequest.newBuilder() + .setName(CmekSettingsName.ofProjectName("[PROJECT]").toString()) + .build(); + CmekSettings response = configClient.getCmekSettings(request); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_GetCmekSettings_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getexclusion/AsyncGetExclusion.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getexclusion/AsyncGetExclusion.java new file mode 100644 index 000000000000..380303f95c73 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getexclusion/AsyncGetExclusion.java @@ -0,0 +1,50 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_GetExclusion_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.GetExclusionRequest; +import com.google.logging.v2.LogExclusion; +import com.google.logging.v2.LogExclusionName; + +public class AsyncGetExclusion { + + public static void main(String[] args) throws Exception { + asyncGetExclusion(); + } + + public static void asyncGetExclusion() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + GetExclusionRequest request = + GetExclusionRequest.newBuilder() + .setName( + LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString()) + .build(); + ApiFuture future = configClient.getExclusionCallable().futureCall(request); + // Do something. + LogExclusion response = future.get(); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_GetExclusion_async] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getexclusion/SyncGetExclusion.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getexclusion/SyncGetExclusion.java new file mode 100644 index 000000000000..fde15f8d3980 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getexclusion/SyncGetExclusion.java @@ -0,0 +1,47 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_GetExclusion_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.GetExclusionRequest; +import com.google.logging.v2.LogExclusion; +import com.google.logging.v2.LogExclusionName; + +public class SyncGetExclusion { + + public static void main(String[] args) throws Exception { + syncGetExclusion(); + } + + public static void syncGetExclusion() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + GetExclusionRequest request = + GetExclusionRequest.newBuilder() + .setName( + LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString()) + .build(); + LogExclusion response = configClient.getExclusion(request); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_GetExclusion_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getexclusion/SyncGetExclusionLogexclusionname.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getexclusion/SyncGetExclusionLogexclusionname.java new file mode 100644 index 000000000000..df857d85769e --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getexclusion/SyncGetExclusionLogexclusionname.java @@ -0,0 +1,42 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_GetExclusion_Logexclusionname_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogExclusion; +import com.google.logging.v2.LogExclusionName; + +public class SyncGetExclusionLogexclusionname { + + public static void main(String[] args) throws Exception { + syncGetExclusionLogexclusionname(); + } + + public static void syncGetExclusionLogexclusionname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + LogExclusionName name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]"); + LogExclusion response = configClient.getExclusion(name); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_GetExclusion_Logexclusionname_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getexclusion/SyncGetExclusionString.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getexclusion/SyncGetExclusionString.java new file mode 100644 index 000000000000..7e19cc395bc2 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getexclusion/SyncGetExclusionString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_GetExclusion_String_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogExclusion; +import com.google.logging.v2.LogExclusionName; + +public class SyncGetExclusionString { + + public static void main(String[] args) throws Exception { + syncGetExclusionString(); + } + + public static void syncGetExclusionString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + String name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString(); + LogExclusion response = configClient.getExclusion(name); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_GetExclusion_String_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getlink/AsyncGetLink.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getlink/AsyncGetLink.java new file mode 100644 index 000000000000..8f89500bb375 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getlink/AsyncGetLink.java @@ -0,0 +1,52 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_GetLink_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.GetLinkRequest; +import com.google.logging.v2.Link; +import com.google.logging.v2.LinkName; + +public class AsyncGetLink { + + public static void main(String[] args) throws Exception { + asyncGetLink(); + } + + public static void asyncGetLink() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + GetLinkRequest request = + GetLinkRequest.newBuilder() + .setName( + LinkName.ofProjectLocationBucketLinkName( + "[PROJECT]", "[LOCATION]", "[BUCKET]", "[LINK]") + .toString()) + .build(); + ApiFuture future = configClient.getLinkCallable().futureCall(request); + // Do something. + Link response = future.get(); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_GetLink_async] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getlink/SyncGetLink.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getlink/SyncGetLink.java new file mode 100644 index 000000000000..983f8da7e0fc --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getlink/SyncGetLink.java @@ -0,0 +1,49 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_GetLink_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.GetLinkRequest; +import com.google.logging.v2.Link; +import com.google.logging.v2.LinkName; + +public class SyncGetLink { + + public static void main(String[] args) throws Exception { + syncGetLink(); + } + + public static void syncGetLink() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + GetLinkRequest request = + GetLinkRequest.newBuilder() + .setName( + LinkName.ofProjectLocationBucketLinkName( + "[PROJECT]", "[LOCATION]", "[BUCKET]", "[LINK]") + .toString()) + .build(); + Link response = configClient.getLink(request); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_GetLink_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getlink/SyncGetLinkLinkname.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getlink/SyncGetLinkLinkname.java new file mode 100644 index 000000000000..45c75ebb4e83 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getlink/SyncGetLinkLinkname.java @@ -0,0 +1,43 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_GetLink_Linkname_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.Link; +import com.google.logging.v2.LinkName; + +public class SyncGetLinkLinkname { + + public static void main(String[] args) throws Exception { + syncGetLinkLinkname(); + } + + public static void syncGetLinkLinkname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + LinkName name = + LinkName.ofProjectLocationBucketLinkName("[PROJECT]", "[LOCATION]", "[BUCKET]", "[LINK]"); + Link response = configClient.getLink(name); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_GetLink_Linkname_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getlink/SyncGetLinkString.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getlink/SyncGetLinkString.java new file mode 100644 index 000000000000..d9ab72c5aa0d --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getlink/SyncGetLinkString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_GetLink_String_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.Link; +import com.google.logging.v2.LinkName; + +public class SyncGetLinkString { + + public static void main(String[] args) throws Exception { + syncGetLinkString(); + } + + public static void syncGetLinkString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + String name = + LinkName.ofProjectLocationBucketLinkName("[PROJECT]", "[LOCATION]", "[BUCKET]", "[LINK]") + .toString(); + Link response = configClient.getLink(name); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_GetLink_String_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getsettings/AsyncGetSettings.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getsettings/AsyncGetSettings.java new file mode 100644 index 000000000000..acef876b8935 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getsettings/AsyncGetSettings.java @@ -0,0 +1,49 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_GetSettings_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.GetSettingsRequest; +import com.google.logging.v2.Settings; +import com.google.logging.v2.SettingsName; + +public class AsyncGetSettings { + + public static void main(String[] args) throws Exception { + asyncGetSettings(); + } + + public static void asyncGetSettings() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + GetSettingsRequest request = + GetSettingsRequest.newBuilder() + .setName(SettingsName.ofProjectName("[PROJECT]").toString()) + .build(); + ApiFuture future = configClient.getSettingsCallable().futureCall(request); + // Do something. + Settings response = future.get(); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_GetSettings_async] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getsettings/SyncGetSettings.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getsettings/SyncGetSettings.java new file mode 100644 index 000000000000..7a2c3c1a337a --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getsettings/SyncGetSettings.java @@ -0,0 +1,46 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_GetSettings_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.GetSettingsRequest; +import com.google.logging.v2.Settings; +import com.google.logging.v2.SettingsName; + +public class SyncGetSettings { + + public static void main(String[] args) throws Exception { + syncGetSettings(); + } + + public static void syncGetSettings() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + GetSettingsRequest request = + GetSettingsRequest.newBuilder() + .setName(SettingsName.ofProjectName("[PROJECT]").toString()) + .build(); + Settings response = configClient.getSettings(request); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_GetSettings_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getsettings/SyncGetSettingsSettingsname.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getsettings/SyncGetSettingsSettingsname.java new file mode 100644 index 000000000000..816ae426731e --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getsettings/SyncGetSettingsSettingsname.java @@ -0,0 +1,42 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_GetSettings_Settingsname_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.Settings; +import com.google.logging.v2.SettingsName; + +public class SyncGetSettingsSettingsname { + + public static void main(String[] args) throws Exception { + syncGetSettingsSettingsname(); + } + + public static void syncGetSettingsSettingsname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + SettingsName name = SettingsName.ofProjectName("[PROJECT]"); + Settings response = configClient.getSettings(name); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_GetSettings_Settingsname_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getsettings/SyncGetSettingsString.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getsettings/SyncGetSettingsString.java new file mode 100644 index 000000000000..abdd76df98e1 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getsettings/SyncGetSettingsString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_GetSettings_String_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.Settings; +import com.google.logging.v2.SettingsName; + +public class SyncGetSettingsString { + + public static void main(String[] args) throws Exception { + syncGetSettingsString(); + } + + public static void syncGetSettingsString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + String name = SettingsName.ofProjectName("[PROJECT]").toString(); + Settings response = configClient.getSettings(name); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_GetSettings_String_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getsink/AsyncGetSink.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getsink/AsyncGetSink.java new file mode 100644 index 000000000000..f9b3e041a50d --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getsink/AsyncGetSink.java @@ -0,0 +1,49 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_GetSink_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.GetSinkRequest; +import com.google.logging.v2.LogSink; +import com.google.logging.v2.LogSinkName; + +public class AsyncGetSink { + + public static void main(String[] args) throws Exception { + asyncGetSink(); + } + + public static void asyncGetSink() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + GetSinkRequest request = + GetSinkRequest.newBuilder() + .setSinkName(LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString()) + .build(); + ApiFuture future = configClient.getSinkCallable().futureCall(request); + // Do something. + LogSink response = future.get(); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_GetSink_async] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getsink/SyncGetSink.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getsink/SyncGetSink.java new file mode 100644 index 000000000000..6499eb837f99 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getsink/SyncGetSink.java @@ -0,0 +1,46 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_GetSink_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.GetSinkRequest; +import com.google.logging.v2.LogSink; +import com.google.logging.v2.LogSinkName; + +public class SyncGetSink { + + public static void main(String[] args) throws Exception { + syncGetSink(); + } + + public static void syncGetSink() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + GetSinkRequest request = + GetSinkRequest.newBuilder() + .setSinkName(LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString()) + .build(); + LogSink response = configClient.getSink(request); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_GetSink_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getsink/SyncGetSinkLogsinkname.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getsink/SyncGetSinkLogsinkname.java new file mode 100644 index 000000000000..035774624b5b --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getsink/SyncGetSinkLogsinkname.java @@ -0,0 +1,42 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_GetSink_Logsinkname_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogSink; +import com.google.logging.v2.LogSinkName; + +public class SyncGetSinkLogsinkname { + + public static void main(String[] args) throws Exception { + syncGetSinkLogsinkname(); + } + + public static void syncGetSinkLogsinkname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]"); + LogSink response = configClient.getSink(sinkName); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_GetSink_Logsinkname_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getsink/SyncGetSinkString.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getsink/SyncGetSinkString.java new file mode 100644 index 000000000000..1c116f7179a9 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getsink/SyncGetSinkString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_GetSink_String_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogSink; +import com.google.logging.v2.LogSinkName; + +public class SyncGetSinkString { + + public static void main(String[] args) throws Exception { + syncGetSinkString(); + } + + public static void syncGetSinkString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + String sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString(); + LogSink response = configClient.getSink(sinkName); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_GetSink_String_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getview/AsyncGetView.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getview/AsyncGetView.java new file mode 100644 index 000000000000..a4a9b7f0e770 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getview/AsyncGetView.java @@ -0,0 +1,52 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_GetView_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.GetViewRequest; +import com.google.logging.v2.LogView; +import com.google.logging.v2.LogViewName; + +public class AsyncGetView { + + public static void main(String[] args) throws Exception { + asyncGetView(); + } + + public static void asyncGetView() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + GetViewRequest request = + GetViewRequest.newBuilder() + .setName( + LogViewName.ofProjectLocationBucketViewName( + "[PROJECT]", "[LOCATION]", "[BUCKET]", "[VIEW]") + .toString()) + .build(); + ApiFuture future = configClient.getViewCallable().futureCall(request); + // Do something. + LogView response = future.get(); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_GetView_async] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getview/SyncGetView.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getview/SyncGetView.java new file mode 100644 index 000000000000..0de122fec548 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/getview/SyncGetView.java @@ -0,0 +1,49 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_GetView_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.GetViewRequest; +import com.google.logging.v2.LogView; +import com.google.logging.v2.LogViewName; + +public class SyncGetView { + + public static void main(String[] args) throws Exception { + syncGetView(); + } + + public static void syncGetView() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + GetViewRequest request = + GetViewRequest.newBuilder() + .setName( + LogViewName.ofProjectLocationBucketViewName( + "[PROJECT]", "[LOCATION]", "[BUCKET]", "[VIEW]") + .toString()) + .build(); + LogView response = configClient.getView(request); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_GetView_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listbuckets/AsyncListBuckets.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listbuckets/AsyncListBuckets.java new file mode 100644 index 000000000000..a2ee7b01badd --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listbuckets/AsyncListBuckets.java @@ -0,0 +1,53 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_ListBuckets_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.ListBucketsRequest; +import com.google.logging.v2.LocationName; +import com.google.logging.v2.LogBucket; + +public class AsyncListBuckets { + + public static void main(String[] args) throws Exception { + asyncListBuckets(); + } + + public static void asyncListBuckets() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + ListBucketsRequest request = + ListBucketsRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageToken("pageToken873572522") + .setPageSize(883849137) + .build(); + ApiFuture future = configClient.listBucketsPagedCallable().futureCall(request); + // Do something. + for (LogBucket element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_ConfigServiceV2_ListBuckets_async] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listbuckets/AsyncListBucketsPaged.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listbuckets/AsyncListBucketsPaged.java new file mode 100644 index 000000000000..2d07514e75ab --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listbuckets/AsyncListBucketsPaged.java @@ -0,0 +1,61 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_ListBuckets_Paged_async] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.common.base.Strings; +import com.google.logging.v2.ListBucketsRequest; +import com.google.logging.v2.ListBucketsResponse; +import com.google.logging.v2.LocationName; +import com.google.logging.v2.LogBucket; + +public class AsyncListBucketsPaged { + + public static void main(String[] args) throws Exception { + asyncListBucketsPaged(); + } + + public static void asyncListBucketsPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + ListBucketsRequest request = + ListBucketsRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageToken("pageToken873572522") + .setPageSize(883849137) + .build(); + while (true) { + ListBucketsResponse response = configClient.listBucketsCallable().call(request); + for (LogBucket element : response.getBucketsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END logging_v2_generated_ConfigServiceV2_ListBuckets_Paged_async] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listbuckets/SyncListBuckets.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listbuckets/SyncListBuckets.java new file mode 100644 index 000000000000..a47bedf8f0f7 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listbuckets/SyncListBuckets.java @@ -0,0 +1,50 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_ListBuckets_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.ListBucketsRequest; +import com.google.logging.v2.LocationName; +import com.google.logging.v2.LogBucket; + +public class SyncListBuckets { + + public static void main(String[] args) throws Exception { + syncListBuckets(); + } + + public static void syncListBuckets() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + ListBucketsRequest request = + ListBucketsRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageToken("pageToken873572522") + .setPageSize(883849137) + .build(); + for (LogBucket element : configClient.listBuckets(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_ConfigServiceV2_ListBuckets_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listbuckets/SyncListBucketsBillingaccountlocationname.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listbuckets/SyncListBucketsBillingaccountlocationname.java new file mode 100644 index 000000000000..8d8ac7a4154e --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listbuckets/SyncListBucketsBillingaccountlocationname.java @@ -0,0 +1,45 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_ListBuckets_Billingaccountlocationname_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.BillingAccountLocationName; +import com.google.logging.v2.LogBucket; + +public class SyncListBucketsBillingaccountlocationname { + + public static void main(String[] args) throws Exception { + syncListBucketsBillingaccountlocationname(); + } + + public static void syncListBucketsBillingaccountlocationname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + BillingAccountLocationName parent = + BillingAccountLocationName.of("[BILLING_ACCOUNT]", "[LOCATION]"); + for (LogBucket element : configClient.listBuckets(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_ConfigServiceV2_ListBuckets_Billingaccountlocationname_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listbuckets/SyncListBucketsFolderlocationname.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listbuckets/SyncListBucketsFolderlocationname.java new file mode 100644 index 000000000000..617a9c7a0fe8 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listbuckets/SyncListBucketsFolderlocationname.java @@ -0,0 +1,44 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_ListBuckets_Folderlocationname_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.FolderLocationName; +import com.google.logging.v2.LogBucket; + +public class SyncListBucketsFolderlocationname { + + public static void main(String[] args) throws Exception { + syncListBucketsFolderlocationname(); + } + + public static void syncListBucketsFolderlocationname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + FolderLocationName parent = FolderLocationName.of("[FOLDER]", "[LOCATION]"); + for (LogBucket element : configClient.listBuckets(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_ConfigServiceV2_ListBuckets_Folderlocationname_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listbuckets/SyncListBucketsLocationname.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listbuckets/SyncListBucketsLocationname.java new file mode 100644 index 000000000000..e31722afd23e --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listbuckets/SyncListBucketsLocationname.java @@ -0,0 +1,44 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_ListBuckets_Locationname_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LocationName; +import com.google.logging.v2.LogBucket; + +public class SyncListBucketsLocationname { + + public static void main(String[] args) throws Exception { + syncListBucketsLocationname(); + } + + public static void syncListBucketsLocationname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + for (LogBucket element : configClient.listBuckets(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_ConfigServiceV2_ListBuckets_Locationname_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listbuckets/SyncListBucketsOrganizationlocationname.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listbuckets/SyncListBucketsOrganizationlocationname.java new file mode 100644 index 000000000000..78336ebf8b9b --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listbuckets/SyncListBucketsOrganizationlocationname.java @@ -0,0 +1,44 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_ListBuckets_Organizationlocationname_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogBucket; +import com.google.logging.v2.OrganizationLocationName; + +public class SyncListBucketsOrganizationlocationname { + + public static void main(String[] args) throws Exception { + syncListBucketsOrganizationlocationname(); + } + + public static void syncListBucketsOrganizationlocationname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]"); + for (LogBucket element : configClient.listBuckets(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_ConfigServiceV2_ListBuckets_Organizationlocationname_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listbuckets/SyncListBucketsString.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listbuckets/SyncListBucketsString.java new file mode 100644 index 000000000000..7432cd5c2b70 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listbuckets/SyncListBucketsString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_ListBuckets_String_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LocationName; +import com.google.logging.v2.LogBucket; + +public class SyncListBucketsString { + + public static void main(String[] args) throws Exception { + syncListBucketsString(); + } + + public static void syncListBucketsString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + for (LogBucket element : configClient.listBuckets(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_ConfigServiceV2_ListBuckets_String_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listexclusions/AsyncListExclusions.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listexclusions/AsyncListExclusions.java new file mode 100644 index 000000000000..1d3e28001104 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listexclusions/AsyncListExclusions.java @@ -0,0 +1,54 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_ListExclusions_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.ListExclusionsRequest; +import com.google.logging.v2.LogExclusion; +import com.google.logging.v2.ProjectName; + +public class AsyncListExclusions { + + public static void main(String[] args) throws Exception { + asyncListExclusions(); + } + + public static void asyncListExclusions() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + ListExclusionsRequest request = + ListExclusionsRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setPageToken("pageToken873572522") + .setPageSize(883849137) + .build(); + ApiFuture future = + configClient.listExclusionsPagedCallable().futureCall(request); + // Do something. + for (LogExclusion element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_ConfigServiceV2_ListExclusions_async] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listexclusions/AsyncListExclusionsPaged.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listexclusions/AsyncListExclusionsPaged.java new file mode 100644 index 000000000000..de87200bfa18 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listexclusions/AsyncListExclusionsPaged.java @@ -0,0 +1,61 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_ListExclusions_Paged_async] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.common.base.Strings; +import com.google.logging.v2.ListExclusionsRequest; +import com.google.logging.v2.ListExclusionsResponse; +import com.google.logging.v2.LogExclusion; +import com.google.logging.v2.ProjectName; + +public class AsyncListExclusionsPaged { + + public static void main(String[] args) throws Exception { + asyncListExclusionsPaged(); + } + + public static void asyncListExclusionsPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + ListExclusionsRequest request = + ListExclusionsRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setPageToken("pageToken873572522") + .setPageSize(883849137) + .build(); + while (true) { + ListExclusionsResponse response = configClient.listExclusionsCallable().call(request); + for (LogExclusion element : response.getExclusionsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END logging_v2_generated_ConfigServiceV2_ListExclusions_Paged_async] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listexclusions/SyncListExclusions.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listexclusions/SyncListExclusions.java new file mode 100644 index 000000000000..32c63582aace --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listexclusions/SyncListExclusions.java @@ -0,0 +1,50 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_ListExclusions_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.ListExclusionsRequest; +import com.google.logging.v2.LogExclusion; +import com.google.logging.v2.ProjectName; + +public class SyncListExclusions { + + public static void main(String[] args) throws Exception { + syncListExclusions(); + } + + public static void syncListExclusions() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + ListExclusionsRequest request = + ListExclusionsRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setPageToken("pageToken873572522") + .setPageSize(883849137) + .build(); + for (LogExclusion element : configClient.listExclusions(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_ConfigServiceV2_ListExclusions_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listexclusions/SyncListExclusionsBillingaccountname.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listexclusions/SyncListExclusionsBillingaccountname.java new file mode 100644 index 000000000000..1715a51da5f5 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listexclusions/SyncListExclusionsBillingaccountname.java @@ -0,0 +1,44 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_ListExclusions_Billingaccountname_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.BillingAccountName; +import com.google.logging.v2.LogExclusion; + +public class SyncListExclusionsBillingaccountname { + + public static void main(String[] args) throws Exception { + syncListExclusionsBillingaccountname(); + } + + public static void syncListExclusionsBillingaccountname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]"); + for (LogExclusion element : configClient.listExclusions(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_ConfigServiceV2_ListExclusions_Billingaccountname_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listexclusions/SyncListExclusionsFoldername.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listexclusions/SyncListExclusionsFoldername.java new file mode 100644 index 000000000000..0f4787c24ff9 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listexclusions/SyncListExclusionsFoldername.java @@ -0,0 +1,44 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_ListExclusions_Foldername_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.FolderName; +import com.google.logging.v2.LogExclusion; + +public class SyncListExclusionsFoldername { + + public static void main(String[] args) throws Exception { + syncListExclusionsFoldername(); + } + + public static void syncListExclusionsFoldername() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + FolderName parent = FolderName.of("[FOLDER]"); + for (LogExclusion element : configClient.listExclusions(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_ConfigServiceV2_ListExclusions_Foldername_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listexclusions/SyncListExclusionsOrganizationname.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listexclusions/SyncListExclusionsOrganizationname.java new file mode 100644 index 000000000000..b04987678a3a --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listexclusions/SyncListExclusionsOrganizationname.java @@ -0,0 +1,44 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_ListExclusions_Organizationname_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogExclusion; +import com.google.logging.v2.OrganizationName; + +public class SyncListExclusionsOrganizationname { + + public static void main(String[] args) throws Exception { + syncListExclusionsOrganizationname(); + } + + public static void syncListExclusionsOrganizationname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + for (LogExclusion element : configClient.listExclusions(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_ConfigServiceV2_ListExclusions_Organizationname_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listexclusions/SyncListExclusionsProjectname.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listexclusions/SyncListExclusionsProjectname.java new file mode 100644 index 000000000000..e4168315954a --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listexclusions/SyncListExclusionsProjectname.java @@ -0,0 +1,44 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_ListExclusions_Projectname_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogExclusion; +import com.google.logging.v2.ProjectName; + +public class SyncListExclusionsProjectname { + + public static void main(String[] args) throws Exception { + syncListExclusionsProjectname(); + } + + public static void syncListExclusionsProjectname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + ProjectName parent = ProjectName.of("[PROJECT]"); + for (LogExclusion element : configClient.listExclusions(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_ConfigServiceV2_ListExclusions_Projectname_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listexclusions/SyncListExclusionsString.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listexclusions/SyncListExclusionsString.java new file mode 100644 index 000000000000..8bd600e2e773 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listexclusions/SyncListExclusionsString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_ListExclusions_String_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogExclusion; +import com.google.logging.v2.ProjectName; + +public class SyncListExclusionsString { + + public static void main(String[] args) throws Exception { + syncListExclusionsString(); + } + + public static void syncListExclusionsString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + String parent = ProjectName.of("[PROJECT]").toString(); + for (LogExclusion element : configClient.listExclusions(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_ConfigServiceV2_ListExclusions_String_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listlinks/AsyncListLinks.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listlinks/AsyncListLinks.java new file mode 100644 index 000000000000..0a350caea7ea --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listlinks/AsyncListLinks.java @@ -0,0 +1,55 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_ListLinks_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.Link; +import com.google.logging.v2.ListLinksRequest; +import com.google.logging.v2.LogBucketName; + +public class AsyncListLinks { + + public static void main(String[] args) throws Exception { + asyncListLinks(); + } + + public static void asyncListLinks() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + ListLinksRequest request = + ListLinksRequest.newBuilder() + .setParent( + LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]") + .toString()) + .setPageToken("pageToken873572522") + .setPageSize(883849137) + .build(); + ApiFuture future = configClient.listLinksPagedCallable().futureCall(request); + // Do something. + for (Link element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_ConfigServiceV2_ListLinks_async] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listlinks/AsyncListLinksPaged.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listlinks/AsyncListLinksPaged.java new file mode 100644 index 000000000000..b789c209ddcc --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listlinks/AsyncListLinksPaged.java @@ -0,0 +1,63 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_ListLinks_Paged_async] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.common.base.Strings; +import com.google.logging.v2.Link; +import com.google.logging.v2.ListLinksRequest; +import com.google.logging.v2.ListLinksResponse; +import com.google.logging.v2.LogBucketName; + +public class AsyncListLinksPaged { + + public static void main(String[] args) throws Exception { + asyncListLinksPaged(); + } + + public static void asyncListLinksPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + ListLinksRequest request = + ListLinksRequest.newBuilder() + .setParent( + LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]") + .toString()) + .setPageToken("pageToken873572522") + .setPageSize(883849137) + .build(); + while (true) { + ListLinksResponse response = configClient.listLinksCallable().call(request); + for (Link element : response.getLinksList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END logging_v2_generated_ConfigServiceV2_ListLinks_Paged_async] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listlinks/SyncListLinks.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listlinks/SyncListLinks.java new file mode 100644 index 000000000000..43df29530261 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listlinks/SyncListLinks.java @@ -0,0 +1,52 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_ListLinks_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.Link; +import com.google.logging.v2.ListLinksRequest; +import com.google.logging.v2.LogBucketName; + +public class SyncListLinks { + + public static void main(String[] args) throws Exception { + syncListLinks(); + } + + public static void syncListLinks() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + ListLinksRequest request = + ListLinksRequest.newBuilder() + .setParent( + LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]") + .toString()) + .setPageToken("pageToken873572522") + .setPageSize(883849137) + .build(); + for (Link element : configClient.listLinks(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_ConfigServiceV2_ListLinks_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listlinks/SyncListLinksLogbucketname.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listlinks/SyncListLinksLogbucketname.java new file mode 100644 index 000000000000..d0c9d1112b72 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listlinks/SyncListLinksLogbucketname.java @@ -0,0 +1,45 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_ListLinks_Logbucketname_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.Link; +import com.google.logging.v2.LogBucketName; + +public class SyncListLinksLogbucketname { + + public static void main(String[] args) throws Exception { + syncListLinksLogbucketname(); + } + + public static void syncListLinksLogbucketname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + LogBucketName parent = + LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]"); + for (Link element : configClient.listLinks(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_ConfigServiceV2_ListLinks_Logbucketname_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listlinks/SyncListLinksString.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listlinks/SyncListLinksString.java new file mode 100644 index 000000000000..5733ecc03930 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listlinks/SyncListLinksString.java @@ -0,0 +1,46 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_ListLinks_String_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.Link; +import com.google.logging.v2.LogBucketName; + +public class SyncListLinksString { + + public static void main(String[] args) throws Exception { + syncListLinksString(); + } + + public static void syncListLinksString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + String parent = + LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]") + .toString(); + for (Link element : configClient.listLinks(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_ConfigServiceV2_ListLinks_String_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listsinks/AsyncListSinks.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listsinks/AsyncListSinks.java new file mode 100644 index 000000000000..3d2ff71cb08c --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listsinks/AsyncListSinks.java @@ -0,0 +1,53 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_ListSinks_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.ListSinksRequest; +import com.google.logging.v2.LogSink; +import com.google.logging.v2.ProjectName; + +public class AsyncListSinks { + + public static void main(String[] args) throws Exception { + asyncListSinks(); + } + + public static void asyncListSinks() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + ListSinksRequest request = + ListSinksRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setPageToken("pageToken873572522") + .setPageSize(883849137) + .build(); + ApiFuture future = configClient.listSinksPagedCallable().futureCall(request); + // Do something. + for (LogSink element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_ConfigServiceV2_ListSinks_async] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listsinks/AsyncListSinksPaged.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listsinks/AsyncListSinksPaged.java new file mode 100644 index 000000000000..e05d8c5e7b6c --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listsinks/AsyncListSinksPaged.java @@ -0,0 +1,61 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_ListSinks_Paged_async] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.common.base.Strings; +import com.google.logging.v2.ListSinksRequest; +import com.google.logging.v2.ListSinksResponse; +import com.google.logging.v2.LogSink; +import com.google.logging.v2.ProjectName; + +public class AsyncListSinksPaged { + + public static void main(String[] args) throws Exception { + asyncListSinksPaged(); + } + + public static void asyncListSinksPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + ListSinksRequest request = + ListSinksRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setPageToken("pageToken873572522") + .setPageSize(883849137) + .build(); + while (true) { + ListSinksResponse response = configClient.listSinksCallable().call(request); + for (LogSink element : response.getSinksList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END logging_v2_generated_ConfigServiceV2_ListSinks_Paged_async] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listsinks/SyncListSinks.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listsinks/SyncListSinks.java new file mode 100644 index 000000000000..47d4b972e004 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listsinks/SyncListSinks.java @@ -0,0 +1,50 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_ListSinks_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.ListSinksRequest; +import com.google.logging.v2.LogSink; +import com.google.logging.v2.ProjectName; + +public class SyncListSinks { + + public static void main(String[] args) throws Exception { + syncListSinks(); + } + + public static void syncListSinks() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + ListSinksRequest request = + ListSinksRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setPageToken("pageToken873572522") + .setPageSize(883849137) + .build(); + for (LogSink element : configClient.listSinks(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_ConfigServiceV2_ListSinks_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listsinks/SyncListSinksBillingaccountname.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listsinks/SyncListSinksBillingaccountname.java new file mode 100644 index 000000000000..6bb1f099993e --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listsinks/SyncListSinksBillingaccountname.java @@ -0,0 +1,44 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_ListSinks_Billingaccountname_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.BillingAccountName; +import com.google.logging.v2.LogSink; + +public class SyncListSinksBillingaccountname { + + public static void main(String[] args) throws Exception { + syncListSinksBillingaccountname(); + } + + public static void syncListSinksBillingaccountname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]"); + for (LogSink element : configClient.listSinks(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_ConfigServiceV2_ListSinks_Billingaccountname_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listsinks/SyncListSinksFoldername.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listsinks/SyncListSinksFoldername.java new file mode 100644 index 000000000000..5bce16257728 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listsinks/SyncListSinksFoldername.java @@ -0,0 +1,44 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_ListSinks_Foldername_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.FolderName; +import com.google.logging.v2.LogSink; + +public class SyncListSinksFoldername { + + public static void main(String[] args) throws Exception { + syncListSinksFoldername(); + } + + public static void syncListSinksFoldername() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + FolderName parent = FolderName.of("[FOLDER]"); + for (LogSink element : configClient.listSinks(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_ConfigServiceV2_ListSinks_Foldername_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listsinks/SyncListSinksOrganizationname.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listsinks/SyncListSinksOrganizationname.java new file mode 100644 index 000000000000..2203c9c9369f --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listsinks/SyncListSinksOrganizationname.java @@ -0,0 +1,44 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_ListSinks_Organizationname_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogSink; +import com.google.logging.v2.OrganizationName; + +public class SyncListSinksOrganizationname { + + public static void main(String[] args) throws Exception { + syncListSinksOrganizationname(); + } + + public static void syncListSinksOrganizationname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + for (LogSink element : configClient.listSinks(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_ConfigServiceV2_ListSinks_Organizationname_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listsinks/SyncListSinksProjectname.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listsinks/SyncListSinksProjectname.java new file mode 100644 index 000000000000..d3987920f506 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listsinks/SyncListSinksProjectname.java @@ -0,0 +1,44 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_ListSinks_Projectname_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogSink; +import com.google.logging.v2.ProjectName; + +public class SyncListSinksProjectname { + + public static void main(String[] args) throws Exception { + syncListSinksProjectname(); + } + + public static void syncListSinksProjectname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + ProjectName parent = ProjectName.of("[PROJECT]"); + for (LogSink element : configClient.listSinks(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_ConfigServiceV2_ListSinks_Projectname_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listsinks/SyncListSinksString.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listsinks/SyncListSinksString.java new file mode 100644 index 000000000000..072459661e60 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listsinks/SyncListSinksString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_ListSinks_String_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogSink; +import com.google.logging.v2.ProjectName; + +public class SyncListSinksString { + + public static void main(String[] args) throws Exception { + syncListSinksString(); + } + + public static void syncListSinksString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + String parent = ProjectName.of("[PROJECT]").toString(); + for (LogSink element : configClient.listSinks(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_ConfigServiceV2_ListSinks_String_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listviews/AsyncListViews.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listviews/AsyncListViews.java new file mode 100644 index 000000000000..b0a7c32317fc --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listviews/AsyncListViews.java @@ -0,0 +1,52 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_ListViews_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.ListViewsRequest; +import com.google.logging.v2.LogView; + +public class AsyncListViews { + + public static void main(String[] args) throws Exception { + asyncListViews(); + } + + public static void asyncListViews() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + ListViewsRequest request = + ListViewsRequest.newBuilder() + .setParent("parent-995424086") + .setPageToken("pageToken873572522") + .setPageSize(883849137) + .build(); + ApiFuture future = configClient.listViewsPagedCallable().futureCall(request); + // Do something. + for (LogView element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_ConfigServiceV2_ListViews_async] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listviews/AsyncListViewsPaged.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listviews/AsyncListViewsPaged.java new file mode 100644 index 000000000000..17a17d8cbf76 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listviews/AsyncListViewsPaged.java @@ -0,0 +1,60 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_ListViews_Paged_async] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.common.base.Strings; +import com.google.logging.v2.ListViewsRequest; +import com.google.logging.v2.ListViewsResponse; +import com.google.logging.v2.LogView; + +public class AsyncListViewsPaged { + + public static void main(String[] args) throws Exception { + asyncListViewsPaged(); + } + + public static void asyncListViewsPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + ListViewsRequest request = + ListViewsRequest.newBuilder() + .setParent("parent-995424086") + .setPageToken("pageToken873572522") + .setPageSize(883849137) + .build(); + while (true) { + ListViewsResponse response = configClient.listViewsCallable().call(request); + for (LogView element : response.getViewsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END logging_v2_generated_ConfigServiceV2_ListViews_Paged_async] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listviews/SyncListViews.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listviews/SyncListViews.java new file mode 100644 index 000000000000..3e8382aa3ac5 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listviews/SyncListViews.java @@ -0,0 +1,49 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_ListViews_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.ListViewsRequest; +import com.google.logging.v2.LogView; + +public class SyncListViews { + + public static void main(String[] args) throws Exception { + syncListViews(); + } + + public static void syncListViews() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + ListViewsRequest request = + ListViewsRequest.newBuilder() + .setParent("parent-995424086") + .setPageToken("pageToken873572522") + .setPageSize(883849137) + .build(); + for (LogView element : configClient.listViews(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_ConfigServiceV2_ListViews_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listviews/SyncListViewsString.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listviews/SyncListViewsString.java new file mode 100644 index 000000000000..7cf38a3e7564 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/listviews/SyncListViewsString.java @@ -0,0 +1,43 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_ListViews_String_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogView; + +public class SyncListViewsString { + + public static void main(String[] args) throws Exception { + syncListViewsString(); + } + + public static void syncListViewsString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + String parent = "parent-995424086"; + for (LogView element : configClient.listViews(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_ConfigServiceV2_ListViews_String_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/undeletebucket/AsyncUndeleteBucket.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/undeletebucket/AsyncUndeleteBucket.java new file mode 100644 index 000000000000..d05ccecd0b92 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/undeletebucket/AsyncUndeleteBucket.java @@ -0,0 +1,51 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_UndeleteBucket_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogBucketName; +import com.google.logging.v2.UndeleteBucketRequest; +import com.google.protobuf.Empty; + +public class AsyncUndeleteBucket { + + public static void main(String[] args) throws Exception { + asyncUndeleteBucket(); + } + + public static void asyncUndeleteBucket() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + UndeleteBucketRequest request = + UndeleteBucketRequest.newBuilder() + .setName( + LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]") + .toString()) + .build(); + ApiFuture future = configClient.undeleteBucketCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_UndeleteBucket_async] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/undeletebucket/SyncUndeleteBucket.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/undeletebucket/SyncUndeleteBucket.java new file mode 100644 index 000000000000..1c47940d784c --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/undeletebucket/SyncUndeleteBucket.java @@ -0,0 +1,48 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_UndeleteBucket_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogBucketName; +import com.google.logging.v2.UndeleteBucketRequest; +import com.google.protobuf.Empty; + +public class SyncUndeleteBucket { + + public static void main(String[] args) throws Exception { + syncUndeleteBucket(); + } + + public static void syncUndeleteBucket() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + UndeleteBucketRequest request = + UndeleteBucketRequest.newBuilder() + .setName( + LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]") + .toString()) + .build(); + configClient.undeleteBucket(request); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_UndeleteBucket_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updatebucket/AsyncUpdateBucket.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updatebucket/AsyncUpdateBucket.java new file mode 100644 index 000000000000..1cc808d1a611 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updatebucket/AsyncUpdateBucket.java @@ -0,0 +1,54 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_UpdateBucket_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogBucket; +import com.google.logging.v2.LogBucketName; +import com.google.logging.v2.UpdateBucketRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateBucket { + + public static void main(String[] args) throws Exception { + asyncUpdateBucket(); + } + + public static void asyncUpdateBucket() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + UpdateBucketRequest request = + UpdateBucketRequest.newBuilder() + .setName( + LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]") + .toString()) + .setBucket(LogBucket.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = configClient.updateBucketCallable().futureCall(request); + // Do something. + LogBucket response = future.get(); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_UpdateBucket_async] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updatebucket/SyncUpdateBucket.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updatebucket/SyncUpdateBucket.java new file mode 100644 index 000000000000..96db52b5d153 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updatebucket/SyncUpdateBucket.java @@ -0,0 +1,51 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_UpdateBucket_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogBucket; +import com.google.logging.v2.LogBucketName; +import com.google.logging.v2.UpdateBucketRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateBucket { + + public static void main(String[] args) throws Exception { + syncUpdateBucket(); + } + + public static void syncUpdateBucket() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + UpdateBucketRequest request = + UpdateBucketRequest.newBuilder() + .setName( + LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]") + .toString()) + .setBucket(LogBucket.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + LogBucket response = configClient.updateBucket(request); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_UpdateBucket_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updatebucketasync/AsyncUpdateBucketAsync.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updatebucketasync/AsyncUpdateBucketAsync.java new file mode 100644 index 000000000000..200d44c55d41 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updatebucketasync/AsyncUpdateBucketAsync.java @@ -0,0 +1,55 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_UpdateBucketAsync_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogBucket; +import com.google.logging.v2.LogBucketName; +import com.google.logging.v2.UpdateBucketRequest; +import com.google.longrunning.Operation; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateBucketAsync { + + public static void main(String[] args) throws Exception { + asyncUpdateBucketAsync(); + } + + public static void asyncUpdateBucketAsync() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + UpdateBucketRequest request = + UpdateBucketRequest.newBuilder() + .setName( + LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]") + .toString()) + .setBucket(LogBucket.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = configClient.updateBucketAsyncCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_UpdateBucketAsync_async] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updatebucketasync/AsyncUpdateBucketAsyncLRO.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updatebucketasync/AsyncUpdateBucketAsyncLRO.java new file mode 100644 index 000000000000..b62097cb9e1a --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updatebucketasync/AsyncUpdateBucketAsyncLRO.java @@ -0,0 +1,56 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_UpdateBucketAsync_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.BucketMetadata; +import com.google.logging.v2.LogBucket; +import com.google.logging.v2.LogBucketName; +import com.google.logging.v2.UpdateBucketRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateBucketAsyncLRO { + + public static void main(String[] args) throws Exception { + asyncUpdateBucketAsyncLRO(); + } + + public static void asyncUpdateBucketAsyncLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + UpdateBucketRequest request = + UpdateBucketRequest.newBuilder() + .setName( + LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]") + .toString()) + .setBucket(LogBucket.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + OperationFuture future = + configClient.updateBucketAsyncOperationCallable().futureCall(request); + // Do something. + LogBucket response = future.get(); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_UpdateBucketAsync_LRO_async] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updatebucketasync/SyncUpdateBucketAsync.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updatebucketasync/SyncUpdateBucketAsync.java new file mode 100644 index 000000000000..0bb616cd4a93 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updatebucketasync/SyncUpdateBucketAsync.java @@ -0,0 +1,51 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_UpdateBucketAsync_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogBucket; +import com.google.logging.v2.LogBucketName; +import com.google.logging.v2.UpdateBucketRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateBucketAsync { + + public static void main(String[] args) throws Exception { + syncUpdateBucketAsync(); + } + + public static void syncUpdateBucketAsync() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + UpdateBucketRequest request = + UpdateBucketRequest.newBuilder() + .setName( + LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]") + .toString()) + .setBucket(LogBucket.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + LogBucket response = configClient.updateBucketAsyncAsync(request).get(); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_UpdateBucketAsync_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updatecmeksettings/AsyncUpdateCmekSettings.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updatecmeksettings/AsyncUpdateCmekSettings.java new file mode 100644 index 000000000000..a2d1c65043a5 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updatecmeksettings/AsyncUpdateCmekSettings.java @@ -0,0 +1,52 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_UpdateCmekSettings_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.CmekSettings; +import com.google.logging.v2.UpdateCmekSettingsRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateCmekSettings { + + public static void main(String[] args) throws Exception { + asyncUpdateCmekSettings(); + } + + public static void asyncUpdateCmekSettings() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + UpdateCmekSettingsRequest request = + UpdateCmekSettingsRequest.newBuilder() + .setName("name3373707") + .setCmekSettings(CmekSettings.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = + configClient.updateCmekSettingsCallable().futureCall(request); + // Do something. + CmekSettings response = future.get(); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_UpdateCmekSettings_async] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updatecmeksettings/SyncUpdateCmekSettings.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updatecmeksettings/SyncUpdateCmekSettings.java new file mode 100644 index 000000000000..9f8ae5f1d7ff --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updatecmeksettings/SyncUpdateCmekSettings.java @@ -0,0 +1,48 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_UpdateCmekSettings_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.CmekSettings; +import com.google.logging.v2.UpdateCmekSettingsRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateCmekSettings { + + public static void main(String[] args) throws Exception { + syncUpdateCmekSettings(); + } + + public static void syncUpdateCmekSettings() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + UpdateCmekSettingsRequest request = + UpdateCmekSettingsRequest.newBuilder() + .setName("name3373707") + .setCmekSettings(CmekSettings.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + CmekSettings response = configClient.updateCmekSettings(request); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_UpdateCmekSettings_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updateexclusion/AsyncUpdateExclusion.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updateexclusion/AsyncUpdateExclusion.java new file mode 100644 index 000000000000..efcf6a135595 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updateexclusion/AsyncUpdateExclusion.java @@ -0,0 +1,53 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_UpdateExclusion_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogExclusion; +import com.google.logging.v2.LogExclusionName; +import com.google.logging.v2.UpdateExclusionRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateExclusion { + + public static void main(String[] args) throws Exception { + asyncUpdateExclusion(); + } + + public static void asyncUpdateExclusion() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + UpdateExclusionRequest request = + UpdateExclusionRequest.newBuilder() + .setName( + LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString()) + .setExclusion(LogExclusion.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = configClient.updateExclusionCallable().futureCall(request); + // Do something. + LogExclusion response = future.get(); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_UpdateExclusion_async] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updateexclusion/SyncUpdateExclusion.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updateexclusion/SyncUpdateExclusion.java new file mode 100644 index 000000000000..1d61c3b23b1f --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updateexclusion/SyncUpdateExclusion.java @@ -0,0 +1,50 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_UpdateExclusion_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogExclusion; +import com.google.logging.v2.LogExclusionName; +import com.google.logging.v2.UpdateExclusionRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateExclusion { + + public static void main(String[] args) throws Exception { + syncUpdateExclusion(); + } + + public static void syncUpdateExclusion() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + UpdateExclusionRequest request = + UpdateExclusionRequest.newBuilder() + .setName( + LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString()) + .setExclusion(LogExclusion.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + LogExclusion response = configClient.updateExclusion(request); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_UpdateExclusion_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updateexclusion/SyncUpdateExclusionLogexclusionnameLogexclusionFieldmask.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updateexclusion/SyncUpdateExclusionLogexclusionnameLogexclusionFieldmask.java new file mode 100644 index 000000000000..7807b0215213 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updateexclusion/SyncUpdateExclusionLogexclusionnameLogexclusionFieldmask.java @@ -0,0 +1,45 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_UpdateExclusion_LogexclusionnameLogexclusionFieldmask_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogExclusion; +import com.google.logging.v2.LogExclusionName; +import com.google.protobuf.FieldMask; + +public class SyncUpdateExclusionLogexclusionnameLogexclusionFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateExclusionLogexclusionnameLogexclusionFieldmask(); + } + + public static void syncUpdateExclusionLogexclusionnameLogexclusionFieldmask() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + LogExclusionName name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]"); + LogExclusion exclusion = LogExclusion.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + LogExclusion response = configClient.updateExclusion(name, exclusion, updateMask); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_UpdateExclusion_LogexclusionnameLogexclusionFieldmask_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updateexclusion/SyncUpdateExclusionStringLogexclusionFieldmask.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updateexclusion/SyncUpdateExclusionStringLogexclusionFieldmask.java new file mode 100644 index 000000000000..e476135129fa --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updateexclusion/SyncUpdateExclusionStringLogexclusionFieldmask.java @@ -0,0 +1,45 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_UpdateExclusion_StringLogexclusionFieldmask_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogExclusion; +import com.google.logging.v2.LogExclusionName; +import com.google.protobuf.FieldMask; + +public class SyncUpdateExclusionStringLogexclusionFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateExclusionStringLogexclusionFieldmask(); + } + + public static void syncUpdateExclusionStringLogexclusionFieldmask() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + String name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString(); + LogExclusion exclusion = LogExclusion.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + LogExclusion response = configClient.updateExclusion(name, exclusion, updateMask); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_UpdateExclusion_StringLogexclusionFieldmask_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updatesettings/AsyncUpdateSettings.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updatesettings/AsyncUpdateSettings.java new file mode 100644 index 000000000000..8135a9a45b17 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updatesettings/AsyncUpdateSettings.java @@ -0,0 +1,51 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_UpdateSettings_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.Settings; +import com.google.logging.v2.UpdateSettingsRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateSettings { + + public static void main(String[] args) throws Exception { + asyncUpdateSettings(); + } + + public static void asyncUpdateSettings() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + UpdateSettingsRequest request = + UpdateSettingsRequest.newBuilder() + .setName("name3373707") + .setSettings(Settings.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = configClient.updateSettingsCallable().futureCall(request); + // Do something. + Settings response = future.get(); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_UpdateSettings_async] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updatesettings/SyncUpdateSettings.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updatesettings/SyncUpdateSettings.java new file mode 100644 index 000000000000..9e4bf264dc3c --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updatesettings/SyncUpdateSettings.java @@ -0,0 +1,48 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_UpdateSettings_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.Settings; +import com.google.logging.v2.UpdateSettingsRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateSettings { + + public static void main(String[] args) throws Exception { + syncUpdateSettings(); + } + + public static void syncUpdateSettings() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + UpdateSettingsRequest request = + UpdateSettingsRequest.newBuilder() + .setName("name3373707") + .setSettings(Settings.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + Settings response = configClient.updateSettings(request); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_UpdateSettings_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updatesettings/SyncUpdateSettingsSettingsFieldmask.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updatesettings/SyncUpdateSettingsSettingsFieldmask.java new file mode 100644 index 000000000000..47660e3e9642 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updatesettings/SyncUpdateSettingsSettingsFieldmask.java @@ -0,0 +1,43 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_UpdateSettings_SettingsFieldmask_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.Settings; +import com.google.protobuf.FieldMask; + +public class SyncUpdateSettingsSettingsFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateSettingsSettingsFieldmask(); + } + + public static void syncUpdateSettingsSettingsFieldmask() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + Settings settings = Settings.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + Settings response = configClient.updateSettings(settings, updateMask); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_UpdateSettings_SettingsFieldmask_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updatesink/AsyncUpdateSink.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updatesink/AsyncUpdateSink.java new file mode 100644 index 000000000000..b46167889059 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updatesink/AsyncUpdateSink.java @@ -0,0 +1,53 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_UpdateSink_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogSink; +import com.google.logging.v2.LogSinkName; +import com.google.logging.v2.UpdateSinkRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateSink { + + public static void main(String[] args) throws Exception { + asyncUpdateSink(); + } + + public static void asyncUpdateSink() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + UpdateSinkRequest request = + UpdateSinkRequest.newBuilder() + .setSinkName(LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString()) + .setSink(LogSink.newBuilder().build()) + .setUniqueWriterIdentity(true) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = configClient.updateSinkCallable().futureCall(request); + // Do something. + LogSink response = future.get(); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_UpdateSink_async] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updatesink/SyncUpdateSink.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updatesink/SyncUpdateSink.java new file mode 100644 index 000000000000..f71e1717390b --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updatesink/SyncUpdateSink.java @@ -0,0 +1,50 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_UpdateSink_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogSink; +import com.google.logging.v2.LogSinkName; +import com.google.logging.v2.UpdateSinkRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateSink { + + public static void main(String[] args) throws Exception { + syncUpdateSink(); + } + + public static void syncUpdateSink() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + UpdateSinkRequest request = + UpdateSinkRequest.newBuilder() + .setSinkName(LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString()) + .setSink(LogSink.newBuilder().build()) + .setUniqueWriterIdentity(true) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + LogSink response = configClient.updateSink(request); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_UpdateSink_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updatesink/SyncUpdateSinkLogsinknameLogsink.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updatesink/SyncUpdateSinkLogsinknameLogsink.java new file mode 100644 index 000000000000..276df9e5f4ad --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updatesink/SyncUpdateSinkLogsinknameLogsink.java @@ -0,0 +1,43 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_UpdateSink_LogsinknameLogsink_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogSink; +import com.google.logging.v2.LogSinkName; + +public class SyncUpdateSinkLogsinknameLogsink { + + public static void main(String[] args) throws Exception { + syncUpdateSinkLogsinknameLogsink(); + } + + public static void syncUpdateSinkLogsinknameLogsink() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]"); + LogSink sink = LogSink.newBuilder().build(); + LogSink response = configClient.updateSink(sinkName, sink); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_UpdateSink_LogsinknameLogsink_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updatesink/SyncUpdateSinkLogsinknameLogsinkFieldmask.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updatesink/SyncUpdateSinkLogsinknameLogsinkFieldmask.java new file mode 100644 index 000000000000..b81b733cebed --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updatesink/SyncUpdateSinkLogsinknameLogsinkFieldmask.java @@ -0,0 +1,45 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_UpdateSink_LogsinknameLogsinkFieldmask_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogSink; +import com.google.logging.v2.LogSinkName; +import com.google.protobuf.FieldMask; + +public class SyncUpdateSinkLogsinknameLogsinkFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateSinkLogsinknameLogsinkFieldmask(); + } + + public static void syncUpdateSinkLogsinknameLogsinkFieldmask() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]"); + LogSink sink = LogSink.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + LogSink response = configClient.updateSink(sinkName, sink, updateMask); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_UpdateSink_LogsinknameLogsinkFieldmask_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updatesink/SyncUpdateSinkStringLogsink.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updatesink/SyncUpdateSinkStringLogsink.java new file mode 100644 index 000000000000..9e018b2adf4e --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updatesink/SyncUpdateSinkStringLogsink.java @@ -0,0 +1,43 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_UpdateSink_StringLogsink_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogSink; +import com.google.logging.v2.LogSinkName; + +public class SyncUpdateSinkStringLogsink { + + public static void main(String[] args) throws Exception { + syncUpdateSinkStringLogsink(); + } + + public static void syncUpdateSinkStringLogsink() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + String sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString(); + LogSink sink = LogSink.newBuilder().build(); + LogSink response = configClient.updateSink(sinkName, sink); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_UpdateSink_StringLogsink_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updatesink/SyncUpdateSinkStringLogsinkFieldmask.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updatesink/SyncUpdateSinkStringLogsinkFieldmask.java new file mode 100644 index 000000000000..12efef5e1a82 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updatesink/SyncUpdateSinkStringLogsinkFieldmask.java @@ -0,0 +1,45 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_UpdateSink_StringLogsinkFieldmask_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogSink; +import com.google.logging.v2.LogSinkName; +import com.google.protobuf.FieldMask; + +public class SyncUpdateSinkStringLogsinkFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateSinkStringLogsinkFieldmask(); + } + + public static void syncUpdateSinkStringLogsinkFieldmask() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + String sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString(); + LogSink sink = LogSink.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + LogSink response = configClient.updateSink(sinkName, sink, updateMask); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_UpdateSink_StringLogsinkFieldmask_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updateview/AsyncUpdateView.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updateview/AsyncUpdateView.java new file mode 100644 index 000000000000..16e460c87599 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updateview/AsyncUpdateView.java @@ -0,0 +1,51 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_UpdateView_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogView; +import com.google.logging.v2.UpdateViewRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateView { + + public static void main(String[] args) throws Exception { + asyncUpdateView(); + } + + public static void asyncUpdateView() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + UpdateViewRequest request = + UpdateViewRequest.newBuilder() + .setName("name3373707") + .setView(LogView.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = configClient.updateViewCallable().futureCall(request); + // Do something. + LogView response = future.get(); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_UpdateView_async] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updateview/SyncUpdateView.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updateview/SyncUpdateView.java new file mode 100644 index 000000000000..cf949a092584 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configservicev2/updateview/SyncUpdateView.java @@ -0,0 +1,48 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigServiceV2_UpdateView_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogView; +import com.google.logging.v2.UpdateViewRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateView { + + public static void main(String[] args) throws Exception { + syncUpdateView(); + } + + public static void syncUpdateView() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ConfigClient configClient = ConfigClient.create()) { + UpdateViewRequest request = + UpdateViewRequest.newBuilder() + .setName("name3373707") + .setView(LogView.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + LogView response = configClient.updateView(request); + } + } +} +// [END logging_v2_generated_ConfigServiceV2_UpdateView_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configsettings/createbucketasync/SyncCreateBucketAsync.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configsettings/createbucketasync/SyncCreateBucketAsync.java new file mode 100644 index 000000000000..55336f302128 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configsettings/createbucketasync/SyncCreateBucketAsync.java @@ -0,0 +1,53 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigSettings_CreateBucketAsync_sync] +import com.google.api.gax.longrunning.OperationalTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.retrying.TimedRetryAlgorithm; +import com.google.cloud.logging.v2.ConfigSettings; +import java.time.Duration; + +public class SyncCreateBucketAsync { + + public static void main(String[] args) throws Exception { + syncCreateBucketAsync(); + } + + public static void syncCreateBucketAsync() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + ConfigSettings.Builder configSettingsBuilder = ConfigSettings.newBuilder(); + TimedRetryAlgorithm timedRetryAlgorithm = + OperationalTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(500)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelayDuration(Duration.ofMillis(5000)) + .setTotalTimeoutDuration(Duration.ofHours(24)) + .build()); + configSettingsBuilder + .createClusterOperationSettings() + .setPollingAlgorithm(timedRetryAlgorithm) + .build(); + } +} +// [END logging_v2_generated_ConfigSettings_CreateBucketAsync_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configsettings/getbucket/SyncGetBucket.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configsettings/getbucket/SyncGetBucket.java new file mode 100644 index 000000000000..1d2f991041a5 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/configsettings/getbucket/SyncGetBucket.java @@ -0,0 +1,55 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_ConfigSettings_GetBucket_sync] +import com.google.cloud.logging.v2.ConfigSettings; +import java.time.Duration; + +public class SyncGetBucket { + + public static void main(String[] args) throws Exception { + syncGetBucket(); + } + + public static void syncGetBucket() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + ConfigSettings.Builder configSettingsBuilder = ConfigSettings.newBuilder(); + configSettingsBuilder + .getBucketSettings() + .setRetrySettings( + configSettingsBuilder + .getBucketSettings() + .getRetrySettings() + .toBuilder() + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) + .build()); + ConfigSettings configSettings = configSettingsBuilder.build(); + } +} +// [END logging_v2_generated_ConfigSettings_GetBucket_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/create/SyncCreateSetCredentialsProvider.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..9aa127313fff --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,44 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_LoggingServiceV2_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.logging.v2.LoggingClient; +import com.google.cloud.logging.v2.LoggingSettings; +import com.google.cloud.logging.v2.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + LoggingSettings loggingSettings = + LoggingSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + LoggingClient loggingClient = LoggingClient.create(loggingSettings); + } +} +// [END logging_v2_generated_LoggingServiceV2_Create_SetCredentialsProvider_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/create/SyncCreateSetEndpoint.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..40398e0dbf1a --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/create/SyncCreateSetEndpoint.java @@ -0,0 +1,40 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_LoggingServiceV2_Create_SetEndpoint_sync] +import com.google.cloud.logging.v2.LoggingClient; +import com.google.cloud.logging.v2.LoggingSettings; +import com.google.cloud.logging.v2.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + LoggingSettings loggingSettings = LoggingSettings.newBuilder().setEndpoint(myEndpoint).build(); + LoggingClient loggingClient = LoggingClient.create(loggingSettings); + } +} +// [END logging_v2_generated_LoggingServiceV2_Create_SetEndpoint_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/deletelog/AsyncDeleteLog.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/deletelog/AsyncDeleteLog.java new file mode 100644 index 000000000000..9aeb013ef771 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/deletelog/AsyncDeleteLog.java @@ -0,0 +1,49 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_LoggingServiceV2_DeleteLog_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.LoggingClient; +import com.google.logging.v2.DeleteLogRequest; +import com.google.logging.v2.LogName; +import com.google.protobuf.Empty; + +public class AsyncDeleteLog { + + public static void main(String[] args) throws Exception { + asyncDeleteLog(); + } + + public static void asyncDeleteLog() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (LoggingClient loggingClient = LoggingClient.create()) { + DeleteLogRequest request = + DeleteLogRequest.newBuilder() + .setLogName(LogName.ofProjectLogName("[PROJECT]", "[LOG]").toString()) + .build(); + ApiFuture future = loggingClient.deleteLogCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END logging_v2_generated_LoggingServiceV2_DeleteLog_async] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/deletelog/SyncDeleteLog.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/deletelog/SyncDeleteLog.java new file mode 100644 index 000000000000..d537f42e49cd --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/deletelog/SyncDeleteLog.java @@ -0,0 +1,46 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_LoggingServiceV2_DeleteLog_sync] +import com.google.cloud.logging.v2.LoggingClient; +import com.google.logging.v2.DeleteLogRequest; +import com.google.logging.v2.LogName; +import com.google.protobuf.Empty; + +public class SyncDeleteLog { + + public static void main(String[] args) throws Exception { + syncDeleteLog(); + } + + public static void syncDeleteLog() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (LoggingClient loggingClient = LoggingClient.create()) { + DeleteLogRequest request = + DeleteLogRequest.newBuilder() + .setLogName(LogName.ofProjectLogName("[PROJECT]", "[LOG]").toString()) + .build(); + loggingClient.deleteLog(request); + } + } +} +// [END logging_v2_generated_LoggingServiceV2_DeleteLog_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/deletelog/SyncDeleteLogLogname.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/deletelog/SyncDeleteLogLogname.java new file mode 100644 index 000000000000..3fa331c05460 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/deletelog/SyncDeleteLogLogname.java @@ -0,0 +1,42 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_LoggingServiceV2_DeleteLog_Logname_sync] +import com.google.cloud.logging.v2.LoggingClient; +import com.google.logging.v2.LogName; +import com.google.protobuf.Empty; + +public class SyncDeleteLogLogname { + + public static void main(String[] args) throws Exception { + syncDeleteLogLogname(); + } + + public static void syncDeleteLogLogname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (LoggingClient loggingClient = LoggingClient.create()) { + LogName logName = LogName.ofProjectLogName("[PROJECT]", "[LOG]"); + loggingClient.deleteLog(logName); + } + } +} +// [END logging_v2_generated_LoggingServiceV2_DeleteLog_Logname_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/deletelog/SyncDeleteLogString.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/deletelog/SyncDeleteLogString.java new file mode 100644 index 000000000000..02183ddcad31 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/deletelog/SyncDeleteLogString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_LoggingServiceV2_DeleteLog_String_sync] +import com.google.cloud.logging.v2.LoggingClient; +import com.google.logging.v2.LogName; +import com.google.protobuf.Empty; + +public class SyncDeleteLogString { + + public static void main(String[] args) throws Exception { + syncDeleteLogString(); + } + + public static void syncDeleteLogString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (LoggingClient loggingClient = LoggingClient.create()) { + String logName = LogName.ofProjectLogName("[PROJECT]", "[LOG]").toString(); + loggingClient.deleteLog(logName); + } + } +} +// [END logging_v2_generated_LoggingServiceV2_DeleteLog_String_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/listlogentries/AsyncListLogEntries.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/listlogentries/AsyncListLogEntries.java new file mode 100644 index 000000000000..5d29072892e5 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/listlogentries/AsyncListLogEntries.java @@ -0,0 +1,55 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_LoggingServiceV2_ListLogEntries_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.LoggingClient; +import com.google.logging.v2.ListLogEntriesRequest; +import com.google.logging.v2.LogEntry; +import java.util.ArrayList; + +public class AsyncListLogEntries { + + public static void main(String[] args) throws Exception { + asyncListLogEntries(); + } + + public static void asyncListLogEntries() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (LoggingClient loggingClient = LoggingClient.create()) { + ListLogEntriesRequest request = + ListLogEntriesRequest.newBuilder() + .addAllResourceNames(new ArrayList()) + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = loggingClient.listLogEntriesPagedCallable().futureCall(request); + // Do something. + for (LogEntry element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_LoggingServiceV2_ListLogEntries_async] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/listlogentries/AsyncListLogEntriesPaged.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/listlogentries/AsyncListLogEntriesPaged.java new file mode 100644 index 000000000000..6acc770f8842 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/listlogentries/AsyncListLogEntriesPaged.java @@ -0,0 +1,63 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_LoggingServiceV2_ListLogEntries_Paged_async] +import com.google.cloud.logging.v2.LoggingClient; +import com.google.common.base.Strings; +import com.google.logging.v2.ListLogEntriesRequest; +import com.google.logging.v2.ListLogEntriesResponse; +import com.google.logging.v2.LogEntry; +import java.util.ArrayList; + +public class AsyncListLogEntriesPaged { + + public static void main(String[] args) throws Exception { + asyncListLogEntriesPaged(); + } + + public static void asyncListLogEntriesPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (LoggingClient loggingClient = LoggingClient.create()) { + ListLogEntriesRequest request = + ListLogEntriesRequest.newBuilder() + .addAllResourceNames(new ArrayList()) + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListLogEntriesResponse response = loggingClient.listLogEntriesCallable().call(request); + for (LogEntry element : response.getEntriesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END logging_v2_generated_LoggingServiceV2_ListLogEntries_Paged_async] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/listlogentries/SyncListLogEntries.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/listlogentries/SyncListLogEntries.java new file mode 100644 index 000000000000..d280a888db0d --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/listlogentries/SyncListLogEntries.java @@ -0,0 +1,52 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_LoggingServiceV2_ListLogEntries_sync] +import com.google.cloud.logging.v2.LoggingClient; +import com.google.logging.v2.ListLogEntriesRequest; +import com.google.logging.v2.LogEntry; +import java.util.ArrayList; + +public class SyncListLogEntries { + + public static void main(String[] args) throws Exception { + syncListLogEntries(); + } + + public static void syncListLogEntries() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (LoggingClient loggingClient = LoggingClient.create()) { + ListLogEntriesRequest request = + ListLogEntriesRequest.newBuilder() + .addAllResourceNames(new ArrayList()) + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (LogEntry element : loggingClient.listLogEntries(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_LoggingServiceV2_ListLogEntries_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/listlogentries/SyncListLogEntriesListstringStringString.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/listlogentries/SyncListLogEntriesListstringStringString.java new file mode 100644 index 000000000000..6680bda2d62a --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/listlogentries/SyncListLogEntriesListstringStringString.java @@ -0,0 +1,48 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_LoggingServiceV2_ListLogEntries_ListstringStringString_sync] +import com.google.cloud.logging.v2.LoggingClient; +import com.google.logging.v2.LogEntry; +import java.util.ArrayList; +import java.util.List; + +public class SyncListLogEntriesListstringStringString { + + public static void main(String[] args) throws Exception { + syncListLogEntriesListstringStringString(); + } + + public static void syncListLogEntriesListstringStringString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (LoggingClient loggingClient = LoggingClient.create()) { + List resourceNames = new ArrayList<>(); + String filter = "filter-1274492040"; + String orderBy = "orderBy-1207110587"; + for (LogEntry element : + loggingClient.listLogEntries(resourceNames, filter, orderBy).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_LoggingServiceV2_ListLogEntries_ListstringStringString_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/listlogs/AsyncListLogs.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/listlogs/AsyncListLogs.java new file mode 100644 index 000000000000..4526eb6e8941 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/listlogs/AsyncListLogs.java @@ -0,0 +1,54 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_LoggingServiceV2_ListLogs_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.LoggingClient; +import com.google.logging.v2.ListLogsRequest; +import com.google.logging.v2.ProjectName; +import java.util.ArrayList; + +public class AsyncListLogs { + + public static void main(String[] args) throws Exception { + asyncListLogs(); + } + + public static void asyncListLogs() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (LoggingClient loggingClient = LoggingClient.create()) { + ListLogsRequest request = + ListLogsRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .addAllResourceNames(new ArrayList()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = loggingClient.listLogsPagedCallable().futureCall(request); + // Do something. + for (String element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_LoggingServiceV2_ListLogs_async] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/listlogs/AsyncListLogsPaged.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/listlogs/AsyncListLogsPaged.java new file mode 100644 index 000000000000..f22bfd7a055e --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/listlogs/AsyncListLogsPaged.java @@ -0,0 +1,62 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_LoggingServiceV2_ListLogs_Paged_async] +import com.google.cloud.logging.v2.LoggingClient; +import com.google.common.base.Strings; +import com.google.logging.v2.ListLogsRequest; +import com.google.logging.v2.ListLogsResponse; +import com.google.logging.v2.ProjectName; +import java.util.ArrayList; + +public class AsyncListLogsPaged { + + public static void main(String[] args) throws Exception { + asyncListLogsPaged(); + } + + public static void asyncListLogsPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (LoggingClient loggingClient = LoggingClient.create()) { + ListLogsRequest request = + ListLogsRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .addAllResourceNames(new ArrayList()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListLogsResponse response = loggingClient.listLogsCallable().call(request); + for (String element : response.getLogNamesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END logging_v2_generated_LoggingServiceV2_ListLogs_Paged_async] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/listlogs/SyncListLogs.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/listlogs/SyncListLogs.java new file mode 100644 index 000000000000..db952c43b7ea --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/listlogs/SyncListLogs.java @@ -0,0 +1,51 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_LoggingServiceV2_ListLogs_sync] +import com.google.cloud.logging.v2.LoggingClient; +import com.google.logging.v2.ListLogsRequest; +import com.google.logging.v2.ProjectName; +import java.util.ArrayList; + +public class SyncListLogs { + + public static void main(String[] args) throws Exception { + syncListLogs(); + } + + public static void syncListLogs() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (LoggingClient loggingClient = LoggingClient.create()) { + ListLogsRequest request = + ListLogsRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .addAllResourceNames(new ArrayList()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (String element : loggingClient.listLogs(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_LoggingServiceV2_ListLogs_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/listlogs/SyncListLogsBillingaccountname.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/listlogs/SyncListLogsBillingaccountname.java new file mode 100644 index 000000000000..825931daadab --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/listlogs/SyncListLogsBillingaccountname.java @@ -0,0 +1,43 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_LoggingServiceV2_ListLogs_Billingaccountname_sync] +import com.google.cloud.logging.v2.LoggingClient; +import com.google.logging.v2.BillingAccountName; + +public class SyncListLogsBillingaccountname { + + public static void main(String[] args) throws Exception { + syncListLogsBillingaccountname(); + } + + public static void syncListLogsBillingaccountname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (LoggingClient loggingClient = LoggingClient.create()) { + BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]"); + for (String element : loggingClient.listLogs(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_LoggingServiceV2_ListLogs_Billingaccountname_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/listlogs/SyncListLogsFoldername.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/listlogs/SyncListLogsFoldername.java new file mode 100644 index 000000000000..201f7b9be4b5 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/listlogs/SyncListLogsFoldername.java @@ -0,0 +1,43 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_LoggingServiceV2_ListLogs_Foldername_sync] +import com.google.cloud.logging.v2.LoggingClient; +import com.google.logging.v2.FolderName; + +public class SyncListLogsFoldername { + + public static void main(String[] args) throws Exception { + syncListLogsFoldername(); + } + + public static void syncListLogsFoldername() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (LoggingClient loggingClient = LoggingClient.create()) { + FolderName parent = FolderName.of("[FOLDER]"); + for (String element : loggingClient.listLogs(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_LoggingServiceV2_ListLogs_Foldername_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/listlogs/SyncListLogsOrganizationname.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/listlogs/SyncListLogsOrganizationname.java new file mode 100644 index 000000000000..36422fa77f96 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/listlogs/SyncListLogsOrganizationname.java @@ -0,0 +1,43 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_LoggingServiceV2_ListLogs_Organizationname_sync] +import com.google.cloud.logging.v2.LoggingClient; +import com.google.logging.v2.OrganizationName; + +public class SyncListLogsOrganizationname { + + public static void main(String[] args) throws Exception { + syncListLogsOrganizationname(); + } + + public static void syncListLogsOrganizationname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (LoggingClient loggingClient = LoggingClient.create()) { + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + for (String element : loggingClient.listLogs(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_LoggingServiceV2_ListLogs_Organizationname_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/listlogs/SyncListLogsProjectname.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/listlogs/SyncListLogsProjectname.java new file mode 100644 index 000000000000..1969b1521053 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/listlogs/SyncListLogsProjectname.java @@ -0,0 +1,43 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_LoggingServiceV2_ListLogs_Projectname_sync] +import com.google.cloud.logging.v2.LoggingClient; +import com.google.logging.v2.ProjectName; + +public class SyncListLogsProjectname { + + public static void main(String[] args) throws Exception { + syncListLogsProjectname(); + } + + public static void syncListLogsProjectname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (LoggingClient loggingClient = LoggingClient.create()) { + ProjectName parent = ProjectName.of("[PROJECT]"); + for (String element : loggingClient.listLogs(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_LoggingServiceV2_ListLogs_Projectname_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/listlogs/SyncListLogsString.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/listlogs/SyncListLogsString.java new file mode 100644 index 000000000000..83ce095a44ed --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/listlogs/SyncListLogsString.java @@ -0,0 +1,43 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_LoggingServiceV2_ListLogs_String_sync] +import com.google.cloud.logging.v2.LoggingClient; +import com.google.logging.v2.ProjectName; + +public class SyncListLogsString { + + public static void main(String[] args) throws Exception { + syncListLogsString(); + } + + public static void syncListLogsString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (LoggingClient loggingClient = LoggingClient.create()) { + String parent = ProjectName.of("[PROJECT]").toString(); + for (String element : loggingClient.listLogs(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_LoggingServiceV2_ListLogs_String_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/listmonitoredresourcedescriptors/AsyncListMonitoredResourceDescriptors.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/listmonitoredresourcedescriptors/AsyncListMonitoredResourceDescriptors.java new file mode 100644 index 000000000000..4739e7e24add --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/listmonitoredresourcedescriptors/AsyncListMonitoredResourceDescriptors.java @@ -0,0 +1,52 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_LoggingServiceV2_ListMonitoredResourceDescriptors_async] +import com.google.api.MonitoredResourceDescriptor; +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.LoggingClient; +import com.google.logging.v2.ListMonitoredResourceDescriptorsRequest; + +public class AsyncListMonitoredResourceDescriptors { + + public static void main(String[] args) throws Exception { + asyncListMonitoredResourceDescriptors(); + } + + public static void asyncListMonitoredResourceDescriptors() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (LoggingClient loggingClient = LoggingClient.create()) { + ListMonitoredResourceDescriptorsRequest request = + ListMonitoredResourceDescriptorsRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + loggingClient.listMonitoredResourceDescriptorsPagedCallable().futureCall(request); + // Do something. + for (MonitoredResourceDescriptor element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_LoggingServiceV2_ListMonitoredResourceDescriptors_async] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/listmonitoredresourcedescriptors/AsyncListMonitoredResourceDescriptorsPaged.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/listmonitoredresourcedescriptors/AsyncListMonitoredResourceDescriptorsPaged.java new file mode 100644 index 000000000000..49025029b8b2 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/listmonitoredresourcedescriptors/AsyncListMonitoredResourceDescriptorsPaged.java @@ -0,0 +1,60 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_LoggingServiceV2_ListMonitoredResourceDescriptors_Paged_async] +import com.google.api.MonitoredResourceDescriptor; +import com.google.cloud.logging.v2.LoggingClient; +import com.google.common.base.Strings; +import com.google.logging.v2.ListMonitoredResourceDescriptorsRequest; +import com.google.logging.v2.ListMonitoredResourceDescriptorsResponse; + +public class AsyncListMonitoredResourceDescriptorsPaged { + + public static void main(String[] args) throws Exception { + asyncListMonitoredResourceDescriptorsPaged(); + } + + public static void asyncListMonitoredResourceDescriptorsPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (LoggingClient loggingClient = LoggingClient.create()) { + ListMonitoredResourceDescriptorsRequest request = + ListMonitoredResourceDescriptorsRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListMonitoredResourceDescriptorsResponse response = + loggingClient.listMonitoredResourceDescriptorsCallable().call(request); + for (MonitoredResourceDescriptor element : response.getResourceDescriptorsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END logging_v2_generated_LoggingServiceV2_ListMonitoredResourceDescriptors_Paged_async] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/listmonitoredresourcedescriptors/SyncListMonitoredResourceDescriptors.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/listmonitoredresourcedescriptors/SyncListMonitoredResourceDescriptors.java new file mode 100644 index 000000000000..fb5cdc085b84 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/listmonitoredresourcedescriptors/SyncListMonitoredResourceDescriptors.java @@ -0,0 +1,49 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_LoggingServiceV2_ListMonitoredResourceDescriptors_sync] +import com.google.api.MonitoredResourceDescriptor; +import com.google.cloud.logging.v2.LoggingClient; +import com.google.logging.v2.ListMonitoredResourceDescriptorsRequest; + +public class SyncListMonitoredResourceDescriptors { + + public static void main(String[] args) throws Exception { + syncListMonitoredResourceDescriptors(); + } + + public static void syncListMonitoredResourceDescriptors() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (LoggingClient loggingClient = LoggingClient.create()) { + ListMonitoredResourceDescriptorsRequest request = + ListMonitoredResourceDescriptorsRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (MonitoredResourceDescriptor element : + loggingClient.listMonitoredResourceDescriptors(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_LoggingServiceV2_ListMonitoredResourceDescriptors_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/taillogentries/AsyncTailLogEntries.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/taillogentries/AsyncTailLogEntries.java new file mode 100644 index 000000000000..c437a8bb794c --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/taillogentries/AsyncTailLogEntries.java @@ -0,0 +1,55 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_LoggingServiceV2_TailLogEntries_async] +import com.google.api.gax.rpc.BidiStream; +import com.google.cloud.logging.v2.LoggingClient; +import com.google.logging.v2.TailLogEntriesRequest; +import com.google.logging.v2.TailLogEntriesResponse; +import com.google.protobuf.Duration; +import java.util.ArrayList; + +public class AsyncTailLogEntries { + + public static void main(String[] args) throws Exception { + asyncTailLogEntries(); + } + + public static void asyncTailLogEntries() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (LoggingClient loggingClient = LoggingClient.create()) { + BidiStream bidiStream = + loggingClient.tailLogEntriesCallable().call(); + TailLogEntriesRequest request = + TailLogEntriesRequest.newBuilder() + .addAllResourceNames(new ArrayList()) + .setFilter("filter-1274492040") + .setBufferWindow(Duration.newBuilder().build()) + .build(); + bidiStream.send(request); + for (TailLogEntriesResponse response : bidiStream) { + // Do something when a response is received. + } + } + } +} +// [END logging_v2_generated_LoggingServiceV2_TailLogEntries_async] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/writelogentries/AsyncWriteLogEntries.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/writelogentries/AsyncWriteLogEntries.java new file mode 100644 index 000000000000..75d7b4585c38 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/writelogentries/AsyncWriteLogEntries.java @@ -0,0 +1,59 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_LoggingServiceV2_WriteLogEntries_async] +import com.google.api.MonitoredResource; +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.LoggingClient; +import com.google.logging.v2.LogEntry; +import com.google.logging.v2.LogName; +import com.google.logging.v2.WriteLogEntriesRequest; +import com.google.logging.v2.WriteLogEntriesResponse; +import java.util.ArrayList; +import java.util.HashMap; + +public class AsyncWriteLogEntries { + + public static void main(String[] args) throws Exception { + asyncWriteLogEntries(); + } + + public static void asyncWriteLogEntries() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (LoggingClient loggingClient = LoggingClient.create()) { + WriteLogEntriesRequest request = + WriteLogEntriesRequest.newBuilder() + .setLogName(LogName.ofProjectLogName("[PROJECT]", "[LOG]").toString()) + .setResource(MonitoredResource.newBuilder().build()) + .putAllLabels(new HashMap()) + .addAllEntries(new ArrayList()) + .setPartialSuccess(true) + .setDryRun(true) + .build(); + ApiFuture future = + loggingClient.writeLogEntriesCallable().futureCall(request); + // Do something. + WriteLogEntriesResponse response = future.get(); + } + } +} +// [END logging_v2_generated_LoggingServiceV2_WriteLogEntries_async] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/writelogentries/SyncWriteLogEntries.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/writelogentries/SyncWriteLogEntries.java new file mode 100644 index 000000000000..2aaf32ab69da --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/writelogentries/SyncWriteLogEntries.java @@ -0,0 +1,55 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_LoggingServiceV2_WriteLogEntries_sync] +import com.google.api.MonitoredResource; +import com.google.cloud.logging.v2.LoggingClient; +import com.google.logging.v2.LogEntry; +import com.google.logging.v2.LogName; +import com.google.logging.v2.WriteLogEntriesRequest; +import com.google.logging.v2.WriteLogEntriesResponse; +import java.util.ArrayList; +import java.util.HashMap; + +public class SyncWriteLogEntries { + + public static void main(String[] args) throws Exception { + syncWriteLogEntries(); + } + + public static void syncWriteLogEntries() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (LoggingClient loggingClient = LoggingClient.create()) { + WriteLogEntriesRequest request = + WriteLogEntriesRequest.newBuilder() + .setLogName(LogName.ofProjectLogName("[PROJECT]", "[LOG]").toString()) + .setResource(MonitoredResource.newBuilder().build()) + .putAllLabels(new HashMap()) + .addAllEntries(new ArrayList()) + .setPartialSuccess(true) + .setDryRun(true) + .build(); + WriteLogEntriesResponse response = loggingClient.writeLogEntries(request); + } + } +} +// [END logging_v2_generated_LoggingServiceV2_WriteLogEntries_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/writelogentries/SyncWriteLogEntriesLognameMonitoredresourceMapstringstringListlogentry.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/writelogentries/SyncWriteLogEntriesLognameMonitoredresourceMapstringstringListlogentry.java new file mode 100644 index 000000000000..a4d5e7c465c4 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/writelogentries/SyncWriteLogEntriesLognameMonitoredresourceMapstringstringListlogentry.java @@ -0,0 +1,53 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_LoggingServiceV2_WriteLogEntries_LognameMonitoredresourceMapstringstringListlogentry_sync] +import com.google.api.MonitoredResource; +import com.google.cloud.logging.v2.LoggingClient; +import com.google.logging.v2.LogEntry; +import com.google.logging.v2.LogName; +import com.google.logging.v2.WriteLogEntriesResponse; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class SyncWriteLogEntriesLognameMonitoredresourceMapstringstringListlogentry { + + public static void main(String[] args) throws Exception { + syncWriteLogEntriesLognameMonitoredresourceMapstringstringListlogentry(); + } + + public static void syncWriteLogEntriesLognameMonitoredresourceMapstringstringListlogentry() + throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (LoggingClient loggingClient = LoggingClient.create()) { + LogName logName = LogName.ofProjectLogName("[PROJECT]", "[LOG]"); + MonitoredResource resource = MonitoredResource.newBuilder().build(); + Map labels = new HashMap<>(); + List entries = new ArrayList<>(); + WriteLogEntriesResponse response = + loggingClient.writeLogEntries(logName, resource, labels, entries); + } + } +} +// [END logging_v2_generated_LoggingServiceV2_WriteLogEntries_LognameMonitoredresourceMapstringstringListlogentry_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/writelogentries/SyncWriteLogEntriesStringMonitoredresourceMapstringstringListlogentry.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/writelogentries/SyncWriteLogEntriesStringMonitoredresourceMapstringstringListlogentry.java new file mode 100644 index 000000000000..0e523aabf1f4 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingservicev2/writelogentries/SyncWriteLogEntriesStringMonitoredresourceMapstringstringListlogentry.java @@ -0,0 +1,53 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_LoggingServiceV2_WriteLogEntries_StringMonitoredresourceMapstringstringListlogentry_sync] +import com.google.api.MonitoredResource; +import com.google.cloud.logging.v2.LoggingClient; +import com.google.logging.v2.LogEntry; +import com.google.logging.v2.LogName; +import com.google.logging.v2.WriteLogEntriesResponse; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class SyncWriteLogEntriesStringMonitoredresourceMapstringstringListlogentry { + + public static void main(String[] args) throws Exception { + syncWriteLogEntriesStringMonitoredresourceMapstringstringListlogentry(); + } + + public static void syncWriteLogEntriesStringMonitoredresourceMapstringstringListlogentry() + throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (LoggingClient loggingClient = LoggingClient.create()) { + String logName = LogName.ofProjectLogName("[PROJECT]", "[LOG]").toString(); + MonitoredResource resource = MonitoredResource.newBuilder().build(); + Map labels = new HashMap<>(); + List entries = new ArrayList<>(); + WriteLogEntriesResponse response = + loggingClient.writeLogEntries(logName, resource, labels, entries); + } + } +} +// [END logging_v2_generated_LoggingServiceV2_WriteLogEntries_StringMonitoredresourceMapstringstringListlogentry_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingsettings/deletelog/SyncDeleteLog.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingsettings/deletelog/SyncDeleteLog.java new file mode 100644 index 000000000000..92a73d6b1410 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/loggingsettings/deletelog/SyncDeleteLog.java @@ -0,0 +1,55 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_LoggingSettings_DeleteLog_sync] +import com.google.cloud.logging.v2.LoggingSettings; +import java.time.Duration; + +public class SyncDeleteLog { + + public static void main(String[] args) throws Exception { + syncDeleteLog(); + } + + public static void syncDeleteLog() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + LoggingSettings.Builder loggingSettingsBuilder = LoggingSettings.newBuilder(); + loggingSettingsBuilder + .deleteLogSettings() + .setRetrySettings( + loggingSettingsBuilder + .deleteLogSettings() + .getRetrySettings() + .toBuilder() + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) + .build()); + LoggingSettings loggingSettings = loggingSettingsBuilder.build(); + } +} +// [END logging_v2_generated_LoggingSettings_DeleteLog_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/create/SyncCreateSetCredentialsProvider.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..43e699302871 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,44 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_MetricsServiceV2_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.logging.v2.MetricsClient; +import com.google.cloud.logging.v2.MetricsSettings; +import com.google.cloud.logging.v2.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + MetricsSettings metricsSettings = + MetricsSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + MetricsClient metricsClient = MetricsClient.create(metricsSettings); + } +} +// [END logging_v2_generated_MetricsServiceV2_Create_SetCredentialsProvider_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/create/SyncCreateSetEndpoint.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..6b54a2d25339 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/create/SyncCreateSetEndpoint.java @@ -0,0 +1,40 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_MetricsServiceV2_Create_SetEndpoint_sync] +import com.google.cloud.logging.v2.MetricsClient; +import com.google.cloud.logging.v2.MetricsSettings; +import com.google.cloud.logging.v2.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + MetricsSettings metricsSettings = MetricsSettings.newBuilder().setEndpoint(myEndpoint).build(); + MetricsClient metricsClient = MetricsClient.create(metricsSettings); + } +} +// [END logging_v2_generated_MetricsServiceV2_Create_SetEndpoint_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/createlogmetric/AsyncCreateLogMetric.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/createlogmetric/AsyncCreateLogMetric.java new file mode 100644 index 000000000000..3d453101c266 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/createlogmetric/AsyncCreateLogMetric.java @@ -0,0 +1,50 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_MetricsServiceV2_CreateLogMetric_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.MetricsClient; +import com.google.logging.v2.CreateLogMetricRequest; +import com.google.logging.v2.LogMetric; +import com.google.logging.v2.ProjectName; + +public class AsyncCreateLogMetric { + + public static void main(String[] args) throws Exception { + asyncCreateLogMetric(); + } + + public static void asyncCreateLogMetric() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MetricsClient metricsClient = MetricsClient.create()) { + CreateLogMetricRequest request = + CreateLogMetricRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setMetric(LogMetric.newBuilder().build()) + .build(); + ApiFuture future = metricsClient.createLogMetricCallable().futureCall(request); + // Do something. + LogMetric response = future.get(); + } + } +} +// [END logging_v2_generated_MetricsServiceV2_CreateLogMetric_async] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/createlogmetric/SyncCreateLogMetric.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/createlogmetric/SyncCreateLogMetric.java new file mode 100644 index 000000000000..001568718b04 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/createlogmetric/SyncCreateLogMetric.java @@ -0,0 +1,47 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_MetricsServiceV2_CreateLogMetric_sync] +import com.google.cloud.logging.v2.MetricsClient; +import com.google.logging.v2.CreateLogMetricRequest; +import com.google.logging.v2.LogMetric; +import com.google.logging.v2.ProjectName; + +public class SyncCreateLogMetric { + + public static void main(String[] args) throws Exception { + syncCreateLogMetric(); + } + + public static void syncCreateLogMetric() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MetricsClient metricsClient = MetricsClient.create()) { + CreateLogMetricRequest request = + CreateLogMetricRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setMetric(LogMetric.newBuilder().build()) + .build(); + LogMetric response = metricsClient.createLogMetric(request); + } + } +} +// [END logging_v2_generated_MetricsServiceV2_CreateLogMetric_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/createlogmetric/SyncCreateLogMetricProjectnameLogmetric.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/createlogmetric/SyncCreateLogMetricProjectnameLogmetric.java new file mode 100644 index 000000000000..0452ba78693e --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/createlogmetric/SyncCreateLogMetricProjectnameLogmetric.java @@ -0,0 +1,43 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_MetricsServiceV2_CreateLogMetric_ProjectnameLogmetric_sync] +import com.google.cloud.logging.v2.MetricsClient; +import com.google.logging.v2.LogMetric; +import com.google.logging.v2.ProjectName; + +public class SyncCreateLogMetricProjectnameLogmetric { + + public static void main(String[] args) throws Exception { + syncCreateLogMetricProjectnameLogmetric(); + } + + public static void syncCreateLogMetricProjectnameLogmetric() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MetricsClient metricsClient = MetricsClient.create()) { + ProjectName parent = ProjectName.of("[PROJECT]"); + LogMetric metric = LogMetric.newBuilder().build(); + LogMetric response = metricsClient.createLogMetric(parent, metric); + } + } +} +// [END logging_v2_generated_MetricsServiceV2_CreateLogMetric_ProjectnameLogmetric_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/createlogmetric/SyncCreateLogMetricStringLogmetric.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/createlogmetric/SyncCreateLogMetricStringLogmetric.java new file mode 100644 index 000000000000..dde2410d79b3 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/createlogmetric/SyncCreateLogMetricStringLogmetric.java @@ -0,0 +1,43 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_MetricsServiceV2_CreateLogMetric_StringLogmetric_sync] +import com.google.cloud.logging.v2.MetricsClient; +import com.google.logging.v2.LogMetric; +import com.google.logging.v2.ProjectName; + +public class SyncCreateLogMetricStringLogmetric { + + public static void main(String[] args) throws Exception { + syncCreateLogMetricStringLogmetric(); + } + + public static void syncCreateLogMetricStringLogmetric() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MetricsClient metricsClient = MetricsClient.create()) { + String parent = ProjectName.of("[PROJECT]").toString(); + LogMetric metric = LogMetric.newBuilder().build(); + LogMetric response = metricsClient.createLogMetric(parent, metric); + } + } +} +// [END logging_v2_generated_MetricsServiceV2_CreateLogMetric_StringLogmetric_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/deletelogmetric/AsyncDeleteLogMetric.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/deletelogmetric/AsyncDeleteLogMetric.java new file mode 100644 index 000000000000..bba1fbb21e04 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/deletelogmetric/AsyncDeleteLogMetric.java @@ -0,0 +1,49 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_MetricsServiceV2_DeleteLogMetric_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.MetricsClient; +import com.google.logging.v2.DeleteLogMetricRequest; +import com.google.logging.v2.LogMetricName; +import com.google.protobuf.Empty; + +public class AsyncDeleteLogMetric { + + public static void main(String[] args) throws Exception { + asyncDeleteLogMetric(); + } + + public static void asyncDeleteLogMetric() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MetricsClient metricsClient = MetricsClient.create()) { + DeleteLogMetricRequest request = + DeleteLogMetricRequest.newBuilder() + .setMetricName(LogMetricName.of("[PROJECT]", "[METRIC]").toString()) + .build(); + ApiFuture future = metricsClient.deleteLogMetricCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END logging_v2_generated_MetricsServiceV2_DeleteLogMetric_async] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/deletelogmetric/SyncDeleteLogMetric.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/deletelogmetric/SyncDeleteLogMetric.java new file mode 100644 index 000000000000..5f7e7df720e5 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/deletelogmetric/SyncDeleteLogMetric.java @@ -0,0 +1,46 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_MetricsServiceV2_DeleteLogMetric_sync] +import com.google.cloud.logging.v2.MetricsClient; +import com.google.logging.v2.DeleteLogMetricRequest; +import com.google.logging.v2.LogMetricName; +import com.google.protobuf.Empty; + +public class SyncDeleteLogMetric { + + public static void main(String[] args) throws Exception { + syncDeleteLogMetric(); + } + + public static void syncDeleteLogMetric() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MetricsClient metricsClient = MetricsClient.create()) { + DeleteLogMetricRequest request = + DeleteLogMetricRequest.newBuilder() + .setMetricName(LogMetricName.of("[PROJECT]", "[METRIC]").toString()) + .build(); + metricsClient.deleteLogMetric(request); + } + } +} +// [END logging_v2_generated_MetricsServiceV2_DeleteLogMetric_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/deletelogmetric/SyncDeleteLogMetricLogmetricname.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/deletelogmetric/SyncDeleteLogMetricLogmetricname.java new file mode 100644 index 000000000000..ab8a13054f05 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/deletelogmetric/SyncDeleteLogMetricLogmetricname.java @@ -0,0 +1,42 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_MetricsServiceV2_DeleteLogMetric_Logmetricname_sync] +import com.google.cloud.logging.v2.MetricsClient; +import com.google.logging.v2.LogMetricName; +import com.google.protobuf.Empty; + +public class SyncDeleteLogMetricLogmetricname { + + public static void main(String[] args) throws Exception { + syncDeleteLogMetricLogmetricname(); + } + + public static void syncDeleteLogMetricLogmetricname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MetricsClient metricsClient = MetricsClient.create()) { + LogMetricName metricName = LogMetricName.of("[PROJECT]", "[METRIC]"); + metricsClient.deleteLogMetric(metricName); + } + } +} +// [END logging_v2_generated_MetricsServiceV2_DeleteLogMetric_Logmetricname_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/deletelogmetric/SyncDeleteLogMetricString.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/deletelogmetric/SyncDeleteLogMetricString.java new file mode 100644 index 000000000000..98edaf9a3ea1 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/deletelogmetric/SyncDeleteLogMetricString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_MetricsServiceV2_DeleteLogMetric_String_sync] +import com.google.cloud.logging.v2.MetricsClient; +import com.google.logging.v2.LogMetricName; +import com.google.protobuf.Empty; + +public class SyncDeleteLogMetricString { + + public static void main(String[] args) throws Exception { + syncDeleteLogMetricString(); + } + + public static void syncDeleteLogMetricString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MetricsClient metricsClient = MetricsClient.create()) { + String metricName = LogMetricName.of("[PROJECT]", "[METRIC]").toString(); + metricsClient.deleteLogMetric(metricName); + } + } +} +// [END logging_v2_generated_MetricsServiceV2_DeleteLogMetric_String_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/getlogmetric/AsyncGetLogMetric.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/getlogmetric/AsyncGetLogMetric.java new file mode 100644 index 000000000000..8542101ecc76 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/getlogmetric/AsyncGetLogMetric.java @@ -0,0 +1,49 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_MetricsServiceV2_GetLogMetric_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.MetricsClient; +import com.google.logging.v2.GetLogMetricRequest; +import com.google.logging.v2.LogMetric; +import com.google.logging.v2.LogMetricName; + +public class AsyncGetLogMetric { + + public static void main(String[] args) throws Exception { + asyncGetLogMetric(); + } + + public static void asyncGetLogMetric() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MetricsClient metricsClient = MetricsClient.create()) { + GetLogMetricRequest request = + GetLogMetricRequest.newBuilder() + .setMetricName(LogMetricName.of("[PROJECT]", "[METRIC]").toString()) + .build(); + ApiFuture future = metricsClient.getLogMetricCallable().futureCall(request); + // Do something. + LogMetric response = future.get(); + } + } +} +// [END logging_v2_generated_MetricsServiceV2_GetLogMetric_async] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/getlogmetric/SyncGetLogMetric.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/getlogmetric/SyncGetLogMetric.java new file mode 100644 index 000000000000..8b68e57456c5 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/getlogmetric/SyncGetLogMetric.java @@ -0,0 +1,46 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_MetricsServiceV2_GetLogMetric_sync] +import com.google.cloud.logging.v2.MetricsClient; +import com.google.logging.v2.GetLogMetricRequest; +import com.google.logging.v2.LogMetric; +import com.google.logging.v2.LogMetricName; + +public class SyncGetLogMetric { + + public static void main(String[] args) throws Exception { + syncGetLogMetric(); + } + + public static void syncGetLogMetric() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MetricsClient metricsClient = MetricsClient.create()) { + GetLogMetricRequest request = + GetLogMetricRequest.newBuilder() + .setMetricName(LogMetricName.of("[PROJECT]", "[METRIC]").toString()) + .build(); + LogMetric response = metricsClient.getLogMetric(request); + } + } +} +// [END logging_v2_generated_MetricsServiceV2_GetLogMetric_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/getlogmetric/SyncGetLogMetricLogmetricname.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/getlogmetric/SyncGetLogMetricLogmetricname.java new file mode 100644 index 000000000000..a28a2f4e0875 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/getlogmetric/SyncGetLogMetricLogmetricname.java @@ -0,0 +1,42 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_MetricsServiceV2_GetLogMetric_Logmetricname_sync] +import com.google.cloud.logging.v2.MetricsClient; +import com.google.logging.v2.LogMetric; +import com.google.logging.v2.LogMetricName; + +public class SyncGetLogMetricLogmetricname { + + public static void main(String[] args) throws Exception { + syncGetLogMetricLogmetricname(); + } + + public static void syncGetLogMetricLogmetricname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MetricsClient metricsClient = MetricsClient.create()) { + LogMetricName metricName = LogMetricName.of("[PROJECT]", "[METRIC]"); + LogMetric response = metricsClient.getLogMetric(metricName); + } + } +} +// [END logging_v2_generated_MetricsServiceV2_GetLogMetric_Logmetricname_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/getlogmetric/SyncGetLogMetricString.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/getlogmetric/SyncGetLogMetricString.java new file mode 100644 index 000000000000..60c1d56c62b3 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/getlogmetric/SyncGetLogMetricString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_MetricsServiceV2_GetLogMetric_String_sync] +import com.google.cloud.logging.v2.MetricsClient; +import com.google.logging.v2.LogMetric; +import com.google.logging.v2.LogMetricName; + +public class SyncGetLogMetricString { + + public static void main(String[] args) throws Exception { + syncGetLogMetricString(); + } + + public static void syncGetLogMetricString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MetricsClient metricsClient = MetricsClient.create()) { + String metricName = LogMetricName.of("[PROJECT]", "[METRIC]").toString(); + LogMetric response = metricsClient.getLogMetric(metricName); + } + } +} +// [END logging_v2_generated_MetricsServiceV2_GetLogMetric_String_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/listlogmetrics/AsyncListLogMetrics.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/listlogmetrics/AsyncListLogMetrics.java new file mode 100644 index 000000000000..7f1658bea667 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/listlogmetrics/AsyncListLogMetrics.java @@ -0,0 +1,53 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_MetricsServiceV2_ListLogMetrics_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.MetricsClient; +import com.google.logging.v2.ListLogMetricsRequest; +import com.google.logging.v2.LogMetric; +import com.google.logging.v2.ProjectName; + +public class AsyncListLogMetrics { + + public static void main(String[] args) throws Exception { + asyncListLogMetrics(); + } + + public static void asyncListLogMetrics() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MetricsClient metricsClient = MetricsClient.create()) { + ListLogMetricsRequest request = + ListLogMetricsRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setPageToken("pageToken873572522") + .setPageSize(883849137) + .build(); + ApiFuture future = metricsClient.listLogMetricsPagedCallable().futureCall(request); + // Do something. + for (LogMetric element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_MetricsServiceV2_ListLogMetrics_async] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/listlogmetrics/AsyncListLogMetricsPaged.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/listlogmetrics/AsyncListLogMetricsPaged.java new file mode 100644 index 000000000000..8f3cbd1a89c9 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/listlogmetrics/AsyncListLogMetricsPaged.java @@ -0,0 +1,61 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_MetricsServiceV2_ListLogMetrics_Paged_async] +import com.google.cloud.logging.v2.MetricsClient; +import com.google.common.base.Strings; +import com.google.logging.v2.ListLogMetricsRequest; +import com.google.logging.v2.ListLogMetricsResponse; +import com.google.logging.v2.LogMetric; +import com.google.logging.v2.ProjectName; + +public class AsyncListLogMetricsPaged { + + public static void main(String[] args) throws Exception { + asyncListLogMetricsPaged(); + } + + public static void asyncListLogMetricsPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MetricsClient metricsClient = MetricsClient.create()) { + ListLogMetricsRequest request = + ListLogMetricsRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setPageToken("pageToken873572522") + .setPageSize(883849137) + .build(); + while (true) { + ListLogMetricsResponse response = metricsClient.listLogMetricsCallable().call(request); + for (LogMetric element : response.getMetricsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END logging_v2_generated_MetricsServiceV2_ListLogMetrics_Paged_async] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/listlogmetrics/SyncListLogMetrics.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/listlogmetrics/SyncListLogMetrics.java new file mode 100644 index 000000000000..7269e78b6453 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/listlogmetrics/SyncListLogMetrics.java @@ -0,0 +1,50 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_MetricsServiceV2_ListLogMetrics_sync] +import com.google.cloud.logging.v2.MetricsClient; +import com.google.logging.v2.ListLogMetricsRequest; +import com.google.logging.v2.LogMetric; +import com.google.logging.v2.ProjectName; + +public class SyncListLogMetrics { + + public static void main(String[] args) throws Exception { + syncListLogMetrics(); + } + + public static void syncListLogMetrics() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MetricsClient metricsClient = MetricsClient.create()) { + ListLogMetricsRequest request = + ListLogMetricsRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setPageToken("pageToken873572522") + .setPageSize(883849137) + .build(); + for (LogMetric element : metricsClient.listLogMetrics(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_MetricsServiceV2_ListLogMetrics_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/listlogmetrics/SyncListLogMetricsProjectname.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/listlogmetrics/SyncListLogMetricsProjectname.java new file mode 100644 index 000000000000..a36131b89663 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/listlogmetrics/SyncListLogMetricsProjectname.java @@ -0,0 +1,44 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_MetricsServiceV2_ListLogMetrics_Projectname_sync] +import com.google.cloud.logging.v2.MetricsClient; +import com.google.logging.v2.LogMetric; +import com.google.logging.v2.ProjectName; + +public class SyncListLogMetricsProjectname { + + public static void main(String[] args) throws Exception { + syncListLogMetricsProjectname(); + } + + public static void syncListLogMetricsProjectname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MetricsClient metricsClient = MetricsClient.create()) { + ProjectName parent = ProjectName.of("[PROJECT]"); + for (LogMetric element : metricsClient.listLogMetrics(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_MetricsServiceV2_ListLogMetrics_Projectname_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/listlogmetrics/SyncListLogMetricsString.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/listlogmetrics/SyncListLogMetricsString.java new file mode 100644 index 000000000000..75f9beaa67b1 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/listlogmetrics/SyncListLogMetricsString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_MetricsServiceV2_ListLogMetrics_String_sync] +import com.google.cloud.logging.v2.MetricsClient; +import com.google.logging.v2.LogMetric; +import com.google.logging.v2.ProjectName; + +public class SyncListLogMetricsString { + + public static void main(String[] args) throws Exception { + syncListLogMetricsString(); + } + + public static void syncListLogMetricsString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MetricsClient metricsClient = MetricsClient.create()) { + String parent = ProjectName.of("[PROJECT]").toString(); + for (LogMetric element : metricsClient.listLogMetrics(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_MetricsServiceV2_ListLogMetrics_String_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/updatelogmetric/AsyncUpdateLogMetric.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/updatelogmetric/AsyncUpdateLogMetric.java new file mode 100644 index 000000000000..6f7f22a84f4d --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/updatelogmetric/AsyncUpdateLogMetric.java @@ -0,0 +1,50 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_MetricsServiceV2_UpdateLogMetric_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.MetricsClient; +import com.google.logging.v2.LogMetric; +import com.google.logging.v2.LogMetricName; +import com.google.logging.v2.UpdateLogMetricRequest; + +public class AsyncUpdateLogMetric { + + public static void main(String[] args) throws Exception { + asyncUpdateLogMetric(); + } + + public static void asyncUpdateLogMetric() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MetricsClient metricsClient = MetricsClient.create()) { + UpdateLogMetricRequest request = + UpdateLogMetricRequest.newBuilder() + .setMetricName(LogMetricName.of("[PROJECT]", "[METRIC]").toString()) + .setMetric(LogMetric.newBuilder().build()) + .build(); + ApiFuture future = metricsClient.updateLogMetricCallable().futureCall(request); + // Do something. + LogMetric response = future.get(); + } + } +} +// [END logging_v2_generated_MetricsServiceV2_UpdateLogMetric_async] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/updatelogmetric/SyncUpdateLogMetric.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/updatelogmetric/SyncUpdateLogMetric.java new file mode 100644 index 000000000000..285efefca45e --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/updatelogmetric/SyncUpdateLogMetric.java @@ -0,0 +1,47 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_MetricsServiceV2_UpdateLogMetric_sync] +import com.google.cloud.logging.v2.MetricsClient; +import com.google.logging.v2.LogMetric; +import com.google.logging.v2.LogMetricName; +import com.google.logging.v2.UpdateLogMetricRequest; + +public class SyncUpdateLogMetric { + + public static void main(String[] args) throws Exception { + syncUpdateLogMetric(); + } + + public static void syncUpdateLogMetric() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MetricsClient metricsClient = MetricsClient.create()) { + UpdateLogMetricRequest request = + UpdateLogMetricRequest.newBuilder() + .setMetricName(LogMetricName.of("[PROJECT]", "[METRIC]").toString()) + .setMetric(LogMetric.newBuilder().build()) + .build(); + LogMetric response = metricsClient.updateLogMetric(request); + } + } +} +// [END logging_v2_generated_MetricsServiceV2_UpdateLogMetric_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/updatelogmetric/SyncUpdateLogMetricLogmetricnameLogmetric.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/updatelogmetric/SyncUpdateLogMetricLogmetricnameLogmetric.java new file mode 100644 index 000000000000..c7a8e3f4dd9f --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/updatelogmetric/SyncUpdateLogMetricLogmetricnameLogmetric.java @@ -0,0 +1,43 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_MetricsServiceV2_UpdateLogMetric_LogmetricnameLogmetric_sync] +import com.google.cloud.logging.v2.MetricsClient; +import com.google.logging.v2.LogMetric; +import com.google.logging.v2.LogMetricName; + +public class SyncUpdateLogMetricLogmetricnameLogmetric { + + public static void main(String[] args) throws Exception { + syncUpdateLogMetricLogmetricnameLogmetric(); + } + + public static void syncUpdateLogMetricLogmetricnameLogmetric() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MetricsClient metricsClient = MetricsClient.create()) { + LogMetricName metricName = LogMetricName.of("[PROJECT]", "[METRIC]"); + LogMetric metric = LogMetric.newBuilder().build(); + LogMetric response = metricsClient.updateLogMetric(metricName, metric); + } + } +} +// [END logging_v2_generated_MetricsServiceV2_UpdateLogMetric_LogmetricnameLogmetric_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/updatelogmetric/SyncUpdateLogMetricStringLogmetric.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/updatelogmetric/SyncUpdateLogMetricStringLogmetric.java new file mode 100644 index 000000000000..d03274ef5fc3 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricsservicev2/updatelogmetric/SyncUpdateLogMetricStringLogmetric.java @@ -0,0 +1,43 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_MetricsServiceV2_UpdateLogMetric_StringLogmetric_sync] +import com.google.cloud.logging.v2.MetricsClient; +import com.google.logging.v2.LogMetric; +import com.google.logging.v2.LogMetricName; + +public class SyncUpdateLogMetricStringLogmetric { + + public static void main(String[] args) throws Exception { + syncUpdateLogMetricStringLogmetric(); + } + + public static void syncUpdateLogMetricStringLogmetric() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MetricsClient metricsClient = MetricsClient.create()) { + String metricName = LogMetricName.of("[PROJECT]", "[METRIC]").toString(); + LogMetric metric = LogMetric.newBuilder().build(); + LogMetric response = metricsClient.updateLogMetric(metricName, metric); + } + } +} +// [END logging_v2_generated_MetricsServiceV2_UpdateLogMetric_StringLogmetric_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricssettings/getlogmetric/SyncGetLogMetric.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricssettings/getlogmetric/SyncGetLogMetric.java new file mode 100644 index 000000000000..96e36da98ed8 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/metricssettings/getlogmetric/SyncGetLogMetric.java @@ -0,0 +1,55 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.samples; + +// [START logging_v2_generated_MetricsSettings_GetLogMetric_sync] +import com.google.cloud.logging.v2.MetricsSettings; +import java.time.Duration; + +public class SyncGetLogMetric { + + public static void main(String[] args) throws Exception { + syncGetLogMetric(); + } + + public static void syncGetLogMetric() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + MetricsSettings.Builder metricsSettingsBuilder = MetricsSettings.newBuilder(); + metricsSettingsBuilder + .getLogMetricSettings() + .setRetrySettings( + metricsSettingsBuilder + .getLogMetricSettings() + .getRetrySettings() + .toBuilder() + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) + .build()); + MetricsSettings metricsSettings = metricsSettingsBuilder.build(); + } +} +// [END logging_v2_generated_MetricsSettings_GetLogMetric_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/stub/configservicev2stubsettings/createbucketasync/SyncCreateBucketAsync.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/stub/configservicev2stubsettings/createbucketasync/SyncCreateBucketAsync.java new file mode 100644 index 000000000000..6acd251d65fd --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/stub/configservicev2stubsettings/createbucketasync/SyncCreateBucketAsync.java @@ -0,0 +1,54 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.stub.samples; + +// [START logging_v2_generated_ConfigServiceV2StubSettings_CreateBucketAsync_sync] +import com.google.api.gax.longrunning.OperationalTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.retrying.TimedRetryAlgorithm; +import com.google.cloud.logging.v2.stub.ConfigServiceV2StubSettings; +import java.time.Duration; + +public class SyncCreateBucketAsync { + + public static void main(String[] args) throws Exception { + syncCreateBucketAsync(); + } + + public static void syncCreateBucketAsync() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + ConfigServiceV2StubSettings.Builder configSettingsBuilder = + ConfigServiceV2StubSettings.newBuilder(); + TimedRetryAlgorithm timedRetryAlgorithm = + OperationalTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(500)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelayDuration(Duration.ofMillis(5000)) + .setTotalTimeoutDuration(Duration.ofHours(24)) + .build()); + configSettingsBuilder + .createClusterOperationSettings() + .setPollingAlgorithm(timedRetryAlgorithm) + .build(); + } +} +// [END logging_v2_generated_ConfigServiceV2StubSettings_CreateBucketAsync_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/stub/configservicev2stubsettings/getbucket/SyncGetBucket.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/stub/configservicev2stubsettings/getbucket/SyncGetBucket.java new file mode 100644 index 000000000000..9f7528254be8 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/stub/configservicev2stubsettings/getbucket/SyncGetBucket.java @@ -0,0 +1,56 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.stub.samples; + +// [START logging_v2_generated_ConfigServiceV2StubSettings_GetBucket_sync] +import com.google.cloud.logging.v2.stub.ConfigServiceV2StubSettings; +import java.time.Duration; + +public class SyncGetBucket { + + public static void main(String[] args) throws Exception { + syncGetBucket(); + } + + public static void syncGetBucket() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + ConfigServiceV2StubSettings.Builder configSettingsBuilder = + ConfigServiceV2StubSettings.newBuilder(); + configSettingsBuilder + .getBucketSettings() + .setRetrySettings( + configSettingsBuilder + .getBucketSettings() + .getRetrySettings() + .toBuilder() + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) + .build()); + ConfigServiceV2StubSettings configSettings = configSettingsBuilder.build(); + } +} +// [END logging_v2_generated_ConfigServiceV2StubSettings_GetBucket_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/stub/loggingservicev2stubsettings/deletelog/SyncDeleteLog.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/stub/loggingservicev2stubsettings/deletelog/SyncDeleteLog.java new file mode 100644 index 000000000000..6e59f12acf46 --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/stub/loggingservicev2stubsettings/deletelog/SyncDeleteLog.java @@ -0,0 +1,56 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.stub.samples; + +// [START logging_v2_generated_LoggingServiceV2StubSettings_DeleteLog_sync] +import com.google.cloud.logging.v2.stub.LoggingServiceV2StubSettings; +import java.time.Duration; + +public class SyncDeleteLog { + + public static void main(String[] args) throws Exception { + syncDeleteLog(); + } + + public static void syncDeleteLog() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + LoggingServiceV2StubSettings.Builder loggingSettingsBuilder = + LoggingServiceV2StubSettings.newBuilder(); + loggingSettingsBuilder + .deleteLogSettings() + .setRetrySettings( + loggingSettingsBuilder + .deleteLogSettings() + .getRetrySettings() + .toBuilder() + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) + .build()); + LoggingServiceV2StubSettings loggingSettings = loggingSettingsBuilder.build(); + } +} +// [END logging_v2_generated_LoggingServiceV2StubSettings_DeleteLog_sync] diff --git a/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/stub/metricsservicev2stubsettings/getlogmetric/SyncGetLogMetric.java b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/stub/metricsservicev2stubsettings/getlogmetric/SyncGetLogMetric.java new file mode 100644 index 000000000000..4c4037b641ea --- /dev/null +++ b/java-logging/samples/snippets/generated/com/google/cloud/logging/v2/stub/metricsservicev2stubsettings/getlogmetric/SyncGetLogMetric.java @@ -0,0 +1,56 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.logging.v2.stub.samples; + +// [START logging_v2_generated_MetricsServiceV2StubSettings_GetLogMetric_sync] +import com.google.cloud.logging.v2.stub.MetricsServiceV2StubSettings; +import java.time.Duration; + +public class SyncGetLogMetric { + + public static void main(String[] args) throws Exception { + syncGetLogMetric(); + } + + public static void syncGetLogMetric() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + MetricsServiceV2StubSettings.Builder metricsSettingsBuilder = + MetricsServiceV2StubSettings.newBuilder(); + metricsSettingsBuilder + .getLogMetricSettings() + .setRetrySettings( + metricsSettingsBuilder + .getLogMetricSettings() + .getRetrySettings() + .toBuilder() + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) + .build()); + MetricsServiceV2StubSettings metricsSettings = metricsSettingsBuilder.build(); + } +} +// [END logging_v2_generated_MetricsServiceV2StubSettings_GetLogMetric_sync] diff --git a/java-logging/samples/snippets/pom.xml b/java-logging/samples/snippets/pom.xml new file mode 100644 index 000000000000..14433b36865e --- /dev/null +++ b/java-logging/samples/snippets/pom.xml @@ -0,0 +1,61 @@ + + + 4.0.0 + com.google.cloud + logging-snippets + jar + Google Cloud Logging Snippets + https://github.com/googleapis/java-logging + + + + com.google.cloud.samples + shared-configuration + 1.2.2 + + + + 1.8 + 1.8 + UTF-8 + + + + + + + com.google.cloud + libraries-bom + 26.55.0 + pom + import + + + + + + + com.google.cloud + google-cloud-logging + + + + + junit + junit + 4.13.2 + test + + + com.google.truth + truth + 1.4.4 + test + + + + + diff --git a/java-logging/samples/snippets/src/main/java/com/example/logging/GetSinkMetadata.java b/java-logging/samples/snippets/src/main/java/com/example/logging/GetSinkMetadata.java new file mode 100644 index 000000000000..ce1534859a7f --- /dev/null +++ b/java-logging/samples/snippets/src/main/java/com/example/logging/GetSinkMetadata.java @@ -0,0 +1,48 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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. + */ + +package com.example.logging; + +// [START logging_get_sink] +import com.google.cloud.logging.Logging; +import com.google.cloud.logging.LoggingOptions; +import com.google.cloud.logging.Sink; + +/** Retrieve Cloud Logging Sink metadata. */ +public class GetSinkMetadata { + public static void main(String[] args) throws Exception { + // TODO(developer): Replace these variables before running the sample. + // The Name of your sink + String sinkName = "sink-name"; // i.e my-sink + + getSinkMetadata(sinkName); + } + + public static void getSinkMetadata(String sinkName) throws Exception { + // Instantiates a logging client + try (Logging logging = LoggingOptions.getDefaultInstance().getService()) { + + Sink sink = logging.getSink(sinkName); + + // print sink metadata + System.out.println("Name:" + sink.getName()); + System.out.println("Version Format:" + sink.getVersionFormat()); + System.out.println("Filter:" + sink.getFilter()); + System.out.println("Destination:" + sink.getDestination()); + } + } +} +// [END logging_get_sink] diff --git a/java-logging/samples/snippets/src/main/java/com/example/logging/ListLogEntries.java b/java-logging/samples/snippets/src/main/java/com/example/logging/ListLogEntries.java new file mode 100644 index 000000000000..c197a864ac67 --- /dev/null +++ b/java-logging/samples/snippets/src/main/java/com/example/logging/ListLogEntries.java @@ -0,0 +1,68 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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. + */ + +package com.example.logging; + +// [START logging_list_log_entries] +import com.google.api.gax.paging.Page; +import com.google.cloud.logging.LogEntry; +import com.google.cloud.logging.Logging; +import com.google.cloud.logging.Logging.EntryListOption; +import com.google.cloud.logging.LoggingOptions; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.TimeZone; + +public class ListLogEntries { + + public static void main(String[] args) throws Exception { + // TODO(developer): Replace the variable value with valid log name before running the sample + // or provide it as an argument. + String logName = args.length > 0 ? args[0] : "test-log"; + + try (Logging logging = LoggingOptions.getDefaultInstance().getService()) { + + // When composing a filter, using indexed fields, such as timestamp, resource.type, logName + // and + // others can help accelerate the results + // Full list of indexed fields here: + // https://cloud.google.com/logging/docs/view/advanced-queries#finding-quickly + // This sample restrict the results to only last minute to minimize number of API calls + Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC")); + calendar.add(Calendar.MINUTE, -1); + DateFormat rfc3339 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"); + String logFilter = + "logName=projects/" + + logging.getOptions().getProjectId() + + "/logs/" + + logName + + " AND timestamp>=\"" + + rfc3339.format(calendar.getTime()) + + "\""; + + // List all log entries + Page entries = logging.listLogEntries(EntryListOption.filter(logFilter)); + while (entries != null) { + for (LogEntry logEntry : entries.iterateAll()) { + System.out.println(logEntry); + } + entries = entries.getNextPage(); + } + } + } +} +// [END logging_list_log_entries] diff --git a/java-logging/samples/snippets/src/main/java/com/example/logging/ListLogs.java b/java-logging/samples/snippets/src/main/java/com/example/logging/ListLogs.java new file mode 100644 index 000000000000..5b8850bb17e8 --- /dev/null +++ b/java-logging/samples/snippets/src/main/java/com/example/logging/ListLogs.java @@ -0,0 +1,41 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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. + */ + +package com.example.logging; + +// [START logging_list_logs] +import com.google.api.gax.paging.Page; +import com.google.cloud.logging.Logging; +import com.google.cloud.logging.LoggingOptions; + +public class ListLogs { + + public static void main(String... args) throws Exception { + + try (Logging logging = LoggingOptions.getDefaultInstance().getService()) { + + // List all log names + Page logNames = logging.listLogs(); + while (logNames != null) { + for (String logName : logNames.iterateAll()) { + System.out.println(logName); + } + logNames = logNames.getNextPage(); + } + } + } +} +// [END logging_list_logs] diff --git a/java-logging/samples/snippets/src/main/java/com/example/logging/LogEntryWriteHttpRequest.java b/java-logging/samples/snippets/src/main/java/com/example/logging/LogEntryWriteHttpRequest.java new file mode 100644 index 000000000000..fda1deb4ea99 --- /dev/null +++ b/java-logging/samples/snippets/src/main/java/com/example/logging/LogEntryWriteHttpRequest.java @@ -0,0 +1,64 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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. + */ + +package com.example.logging; + +// [START logging_write_log_entry_advanced] +import com.google.cloud.MonitoredResource; +import com.google.cloud.logging.HttpRequest; +import com.google.cloud.logging.LogEntry; +import com.google.cloud.logging.Logging; +import com.google.cloud.logging.LoggingOptions; +import com.google.cloud.logging.Payload; +import com.google.cloud.logging.Severity; +import java.util.Collections; + +/** Write LogEntry with HTTP request using the Cloud Logging API. */ +public class LogEntryWriteHttpRequest { + + public static void main(String[] args) throws Exception { + // TODO(developer): Replace these variables before running the sample. + String logName = "log-name"; // i.e "my-log" + String payLoad = "payload"; // i.e "Hello world!" + HttpRequest httpRequest = + HttpRequest.newBuilder() + .setRequestUrl("www.example.com") + .setRequestMethod(HttpRequest.RequestMethod.GET) // Supported method GET,POST,PUT,HEAD + .setStatus(200) + .build(); + createLogEntryRequest(logName, payLoad, httpRequest); + } + + public static void createLogEntryRequest(String logName, String payLoad, HttpRequest httpRequest) + throws Exception { + // Instantiates a logging client + try (Logging logging = LoggingOptions.getDefaultInstance().getService()) { + // create an instance of LogEntry with HTTP request + LogEntry logEntry = + LogEntry.newBuilder(Payload.StringPayload.of(payLoad)) + .setSeverity(Severity.ERROR) + .setLogName(logName) + .setHttpRequest(httpRequest) + .setResource(MonitoredResource.newBuilder("global").build()) + .build(); + + // Writes the log entry asynchronously + logging.write(Collections.singleton(logEntry)); + System.out.printf("Logged: %s", payLoad); + } + } +} +// [END logging_write_log_entry_advanced] diff --git a/java-logging/samples/snippets/src/main/java/com/example/logging/QuickstartSample.java b/java-logging/samples/snippets/src/main/java/com/example/logging/QuickstartSample.java new file mode 100644 index 000000000000..49424f22335c --- /dev/null +++ b/java-logging/samples/snippets/src/main/java/com/example/logging/QuickstartSample.java @@ -0,0 +1,63 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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. + */ + +package com.example.logging; + +// [START logging_quickstart] +import com.google.cloud.MonitoredResource; +import com.google.cloud.logging.LogEntry; +import com.google.cloud.logging.Logging; +import com.google.cloud.logging.LoggingOptions; +import com.google.cloud.logging.Payload.StringPayload; +import com.google.cloud.logging.Severity; +import java.util.Collections; + +/** + * This sample demonstrates writing logs using the Cloud Logging API. The library also offers a + * java.util.logging Handler `com.google.cloud.logging.LoggingHandler` Logback integration is also + * available : + * https://github.com/googleapis/google-cloud-java/tree/master/google-cloud-clients/google-cloud-contrib/google-cloud-logging-logback + * Using the java.util.logging handler / Logback appender should be preferred to using the API + * directly. + */ +public class QuickstartSample { + + /** Expects a new or existing Cloud log name as the first argument. */ + public static void main(String... args) throws Exception { + // The name of the log to write to + String logName = args[0]; // "my-log"; + String textPayload = "Hello, world!"; + + // Instantiates a client + try (Logging logging = LoggingOptions.getDefaultInstance().getService()) { + + LogEntry entry = + LogEntry.newBuilder(StringPayload.of(textPayload)) + .setSeverity(Severity.ERROR) + .setLogName(logName) + .setResource(MonitoredResource.newBuilder("global").build()) + .build(); + + // Writes the log entry asynchronously + logging.write(Collections.singleton(entry)); + + // Optional - flush any pending log entries just before Logging is closed + logging.flush(); + } + System.out.printf("Logged: %s%n", textPayload); + } +} +// [END logging_quickstart] diff --git a/java-logging/samples/snippets/src/main/java/com/example/logging/TailLogEntries.java b/java-logging/samples/snippets/src/main/java/com/example/logging/TailLogEntries.java new file mode 100644 index 000000000000..932d2c699dec --- /dev/null +++ b/java-logging/samples/snippets/src/main/java/com/example/logging/TailLogEntries.java @@ -0,0 +1,55 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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. + */ + +package com.example.logging; + +// [START logging_tail_log_entries] +import com.google.cloud.logging.LogEntry; +import com.google.cloud.logging.LogEntryServerStream; +import com.google.cloud.logging.Logging; +import com.google.cloud.logging.Logging.TailOption; +import com.google.cloud.logging.LoggingOptions; + +public class TailLogEntries { + + public static void main(String[] args) throws Exception { + // TODO(developer): Optionally provide the logname as an argument. + String logName = args.length > 0 ? args[0] : ""; + + LoggingOptions options = LoggingOptions.getDefaultInstance(); + try (Logging logging = options.getService()) { + + // Optionally compose a filter to tail log entries only from specific log + LogEntryServerStream stream; + + if (logName != "") { + stream = + logging.tailLogEntries( + TailOption.filter( + "logName=projects/" + options.getProjectId() + "/logs/" + logName)); + } else { + stream = logging.tailLogEntries(); + } + System.out.println("start streaming.."); + for (LogEntry log : stream) { + System.out.println(log); + // cancel infinite streaming after receiving first entry + stream.cancel(); + } + } + } +} +// [END logging_tail_log_entries] diff --git a/java-logging/samples/snippets/src/main/java/com/example/logging/WriteLogEntry.java b/java-logging/samples/snippets/src/main/java/com/example/logging/WriteLogEntry.java new file mode 100644 index 000000000000..7703cc59949d --- /dev/null +++ b/java-logging/samples/snippets/src/main/java/com/example/logging/WriteLogEntry.java @@ -0,0 +1,57 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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. + */ + +package com.example.logging; + +// [START logging_write_log_entry] +import com.google.cloud.MonitoredResource; +import com.google.cloud.logging.LogEntry; +import com.google.cloud.logging.Logging; +import com.google.cloud.logging.LoggingOptions; +import com.google.cloud.logging.Payload.JsonPayload; +import com.google.cloud.logging.Severity; +import com.google.common.collect.ImmutableMap; +import java.util.Collections; +import java.util.Map; + +public class WriteLogEntry { + + public static void main(String[] args) throws Exception { + // TODO(developer): Optionally provide the logname as an argument + String logName = args.length > 0 ? args[0] : "test-log"; + + // Instantiates a client + try (Logging logging = LoggingOptions.getDefaultInstance().getService()) { + Map payload = + ImmutableMap.of( + "name", "King Arthur", "quest", "Find the Holy Grail", "favorite_color", "Blue"); + LogEntry entry = + LogEntry.newBuilder(JsonPayload.of(payload)) + .setSeverity(Severity.INFO) + .setLogName(logName) + .setResource(MonitoredResource.newBuilder("global").build()) + .build(); + + // Writes the log entry asynchronously + logging.write(Collections.singleton(entry)); + + // Optional - flush any pending log entries just before Logging is closed + logging.flush(); + } + System.out.printf("Wrote to %s\n", logName); + } +} +// [END logging_write_log_entry] diff --git a/java-logging/samples/snippets/src/main/java/com/example/logging/jul/Quickstart.java b/java-logging/samples/snippets/src/main/java/com/example/logging/jul/Quickstart.java new file mode 100644 index 000000000000..3694b93a5615 --- /dev/null +++ b/java-logging/samples/snippets/src/main/java/com/example/logging/jul/Quickstart.java @@ -0,0 +1,31 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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. + */ + +package com.example.logging.jul; + +// [START logging_jul_quickstart] + +import java.util.logging.Logger; + +public class Quickstart { + private static final Logger logger = Logger.getLogger(Quickstart.class.getName()); + + public static void main(String[] args) { + logger.info("Logging INFO with java.util.logging"); + logger.severe("Logging ERROR with java.util.logging"); + } +} +// [END logging_jul_quickstart] diff --git a/java-logging/samples/snippets/src/main/java/com/example/logging/jul/enhancers/ExampleEnhancer.java b/java-logging/samples/snippets/src/main/java/com/example/logging/jul/enhancers/ExampleEnhancer.java new file mode 100644 index 000000000000..1e8cc284bda5 --- /dev/null +++ b/java-logging/samples/snippets/src/main/java/com/example/logging/jul/enhancers/ExampleEnhancer.java @@ -0,0 +1,30 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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. + */ + +package com.example.logging.jul.enhancers; + +import com.google.cloud.logging.LogEntry; +import com.google.cloud.logging.LoggingEnhancer; + +// Add / update additional fields to the log entry +public class ExampleEnhancer implements LoggingEnhancer { + + @Override + public void enhanceLogEntry(LogEntry.Builder logEntry) { + // add additional labels + logEntry.addLabel("test-label-1", "test-value-1"); + } +} diff --git a/java-logging/samples/snippets/src/main/resources/logging.properties b/java-logging/samples/snippets/src/main/resources/logging.properties new file mode 100644 index 000000000000..7b455ff1a76e --- /dev/null +++ b/java-logging/samples/snippets/src/main/resources/logging.properties @@ -0,0 +1,47 @@ +# Copyright 2015 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. +# + +# A default java.util.logging configuration. +# +# [START logging_jul_config] +# To use this configuration, add to system properties : -Djava.util.logging.config.file="/path/to/file" +# +.level = INFO + +# it is recommended that io.grpc and sun.net logging level is kept at INFO level, +# as both these packages are used by Cloud internals and can result in verbose / initialization problems. +io.grpc.netty.level=INFO +sun.net.level=INFO + +com.example.logging.jul.Quickstart.handlers=com.google.cloud.logging.LoggingHandler +# default : java.log +com.google.cloud.logging.LoggingHandler.log=custom_log + +# default : INFO +com.google.cloud.logging.LoggingHandler.level=FINE + +# default : ERROR +com.google.cloud.logging.LoggingHandler.flushLevel=ERROR + +# default : auto-detected, fallback "global" +com.google.cloud.logging.LoggingHandler.resourceType=container + +# custom formatter +com.google.cloud.logging.LoggingHandler.formatter=java.util.logging.SimpleFormatter +java.util.logging.SimpleFormatter.format=%3$s: %5$s%6$s + +#optional enhancers (to add additional fields, labels) +com.google.cloud.logging.LoggingHandler.enhancers=com.example.logging.jul.enhancers.ExampleEnhancer +# [END logging_jul_config] diff --git a/java-logging/samples/snippets/src/test/java/com/example/logging/LoggingIT.java b/java-logging/samples/snippets/src/test/java/com/example/logging/LoggingIT.java new file mode 100644 index 000000000000..0c82f51a10cb --- /dev/null +++ b/java-logging/samples/snippets/src/test/java/com/example/logging/LoggingIT.java @@ -0,0 +1,192 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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. + */ + +package com.example.logging; + +import static com.google.cloud.logging.testing.RemoteLoggingHelper.formatForTest; +import static com.google.common.truth.Truth.assertThat; + +import com.google.cloud.MonitoredResource; +import com.google.cloud.logging.HttpRequest; +import com.google.cloud.logging.LogEntry; +import com.google.cloud.logging.Logging; +import com.google.cloud.logging.LoggingOptions; +import com.google.cloud.logging.Payload.StringPayload; +import com.google.cloud.logging.Synchronicity; +import java.io.ByteArrayOutputStream; +import java.io.PrintStream; +import java.util.Collections; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +/** Tests for quickstart sample. */ +@RunWith(JUnit4.class) +@SuppressWarnings("checkstyle:abbreviationaswordinname") +public class LoggingIT { + + private static final String TEST_LOG = formatForTest("test-log"); + private static final String STRING_PAYLOAD = "Hello, world!"; + private static final String STRING_PAYLOAD2 = "Hello world again"; + + private ByteArrayOutputStream bout; + private PrintStream out; + private static Logging logging; + + private void deleteLog(String logName) throws InterruptedException { + int deleteAttempts = 0; + int allowedDeleteAttempts = 5; + boolean deleted = false; + while (!deleted && deleteAttempts < allowedDeleteAttempts) { + deleted = logging.deleteLog(logName); + deleteAttempts++; + if (!deleted) { + Thread.sleep(1000); + } + } + if (!deleted) { + System.err.println( + "Failed to clean up log entries after 5 attempts. Following tests may be flaky..."); + } + } + + @BeforeClass + public static void startup() { + logging = LoggingOptions.getDefaultInstance().getService(); + } + + @AfterClass + public static void shutDown() throws Exception { + logging.close(); + } + + @Before + public void setUp() { + bout = new ByteArrayOutputStream(); + out = new PrintStream(bout); + System.setOut(out); + } + + @After + public void tearDown() throws Exception { + // Clean up created logs + deleteLog(TEST_LOG); + System.setOut(null); + } + + @Test(timeout = 60000) + public void testQuickstartSample() throws Exception { + QuickstartSample.main(TEST_LOG); + String got = bout.toString(); + assertThat(got).contains(String.format("Logged: %s", STRING_PAYLOAD)); + } + + @Test(timeout = 60000) + public void testListLogEntriesSample() throws Exception { + // write a log entry + LogEntry entry = + LogEntry.newBuilder(StringPayload.of(STRING_PAYLOAD2)) + .setLogName(TEST_LOG) + .setResource(MonitoredResource.newBuilder("global").build()) + .build(); + logging.setWriteSynchronicity(Synchronicity.SYNC); + logging.write(Collections.singleton(entry)); + // flush out log immediately + logging.flush(); + bout.reset(); + + // Check for mocked STDOUT for having STRING_PAYLOAD2 substring + String[] args = new String[] {TEST_LOG}; + while (!bout.toString().contains(STRING_PAYLOAD2)) { + ListLogEntries.main(args); + Thread.sleep(5000); + } + // although the following assertion is formal + // the line is left to emphasis the validation that is done by the test + assertThat(bout.toString().contains(STRING_PAYLOAD2)).isTrue(); + } + + @Test(timeout = 60000) + public void testWriteLogHttpRequestSample() throws Exception { + HttpRequest request = + HttpRequest.newBuilder() + .setRequestUrl("www.example.com") + .setRequestMethod(HttpRequest.RequestMethod.GET) + .setStatus(200) + .build(); + LogEntryWriteHttpRequest.createLogEntryRequest(TEST_LOG, STRING_PAYLOAD, request); + String got = bout.toString(); + + // Check weather log entry is logged or not + assertThat(got).contains(String.format("Logged: %s", STRING_PAYLOAD)); + bout.reset(); + + // Check for mocked STDOUT having data + String[] args = new String[] {TEST_LOG}; + while (bout.toString().isEmpty()) { + ListLogEntries.main(args); + Thread.sleep(1000); + } + + // check log entry contain request data + assertThat(bout.toString().contains(STRING_PAYLOAD)).isTrue(); + assertThat(bout.toString().contains(request.toString())).isTrue(); + } + + @Test(timeout = 60000) + public void testWriteLogEntrySample() throws Exception { + WriteLogEntry.main(new String[] {TEST_LOG}); + String got = bout.toString(); + assertThat(got).contains(String.format("Wrote to %s", TEST_LOG)); + } + + @Test(timeout = 60000) + public void testTailLogEntriesSample() throws Exception { + Runnable task = + () -> { + // wait 10 seconds to allow establishing tail stream in the sample + try { + Thread.sleep(10_000); + try (Logging logging = LoggingOptions.getDefaultInstance().getService()) { + // create an instance of LogEntry with HTTP request + LogEntry logEntry = + LogEntry.newBuilder(StringPayload.of(STRING_PAYLOAD)) + .setLogName(TEST_LOG) + .setResource(MonitoredResource.newBuilder("global").build()) + .build(); + // Writes the log entry asynchronously + logging.write(Collections.singleton(logEntry)); + } + } catch (Exception t) { + System.err.println("Failed to write log entry:\n" + t); + } + }; + Thread thread = new Thread(task); + thread.start(); + + TailLogEntries.main(new String[] {TEST_LOG}); + + // Check for mocked STDOUT having data + while (bout.toString().isEmpty()) { + Thread.sleep(1000); + } + assertThat(bout.toString().contains(STRING_PAYLOAD)).isTrue(); + } +} diff --git a/java-logging/samples/snippets/src/test/java/com/example/logging/LogsIT.java b/java-logging/samples/snippets/src/test/java/com/example/logging/LogsIT.java new file mode 100644 index 000000000000..26051ec549fb --- /dev/null +++ b/java-logging/samples/snippets/src/test/java/com/example/logging/LogsIT.java @@ -0,0 +1,54 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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. + */ + +package com.example.logging; + +import static com.google.common.truth.Truth.assertThat; + +import java.io.ByteArrayOutputStream; +import java.io.PrintStream; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +public class LogsIT { + private static final String GOOGLEAPIS_AUDIT_LOGNAME = "cloudaudit.googleapis.com%2Factivity"; + + private ByteArrayOutputStream bout; + private PrintStream out; + + @Before + public void setUp() { + bout = new ByteArrayOutputStream(); + out = new PrintStream(bout); + System.setOut(out); + } + + @After + public void tearDown() { + System.setOut(null); + } + + @Test(timeout = 60000) + public void testListLogNamesSample() throws Exception { + ListLogs.main(); + // Check for mocked STDOUT having data + while (bout.toString().isEmpty()) { + Thread.sleep(1000); + } + assertThat(bout.toString().contains(GOOGLEAPIS_AUDIT_LOGNAME)).isTrue(); + } +} diff --git a/java-logging/samples/snippets/src/test/java/com/example/logging/SinkIT.java b/java-logging/samples/snippets/src/test/java/com/example/logging/SinkIT.java new file mode 100644 index 000000000000..782b301cfbdd --- /dev/null +++ b/java-logging/samples/snippets/src/test/java/com/example/logging/SinkIT.java @@ -0,0 +1,74 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.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. + */ + +package com.example.logging; + +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import com.google.cloud.logging.Logging; +import com.google.cloud.logging.LoggingOptions; +import com.google.cloud.logging.Sink; +import com.google.cloud.logging.SinkInfo; +import java.io.ByteArrayOutputStream; +import java.io.PrintStream; +import java.util.UUID; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +/** Tests for sink sample. */ +@RunWith(JUnit4.class) +public class SinkIT { + + private Logging logging = LoggingOptions.getDefaultInstance().getService(); + private static final String SINK_NAME = "test-sink" + UUID.randomUUID().toString(); + + @Before + public void setUp() { + // Create sink + logging.create( + SinkInfo.newBuilder(SINK_NAME, SinkInfo.Destination.DatasetDestination.of("dataset")) + .setFilter("severity>=ERROR") + .setVersionFormat(SinkInfo.VersionFormat.V2) + .build()); + } + + @After + public void tearDown() throws Exception { + // Delete sink + logging.deleteSink(SINK_NAME); + logging.close(); + } + + @Test + public void testGetSinkMetadata() throws Exception { + Sink sink = logging.getSink(SINK_NAME); + assertNotNull(sink); + PrintStream standardOut = System.out; + ByteArrayOutputStream snippetOutputCapture = new ByteArrayOutputStream(); + System.setOut(new PrintStream(snippetOutputCapture)); + GetSinkMetadata.getSinkMetadata(SINK_NAME); + String snippetOutput = snippetOutputCapture.toString(); + System.setOut(standardOut); + assertTrue(snippetOutput.contains(("Name:" + sink.getName()))); + assertTrue(snippetOutput.contains(("Version Format:" + sink.getVersionFormat()))); + assertTrue(snippetOutput.contains(("Filter:" + sink.getFilter()))); + assertTrue(snippetOutput.contains(("Destination:" + sink.getDestination()))); + } +} diff --git a/java-logging/synth.metadata b/java-logging/synth.metadata new file mode 100644 index 000000000000..92e9b1627132 --- /dev/null +++ b/java-logging/synth.metadata @@ -0,0 +1,276 @@ +{ + "sources": [ + { + "git": { + "name": ".", + "remote": "https://github.com/googleapis/java-logging.git", + "sha": "bcc7c71aaa525dc5a79160b9064600adb94a5f22" + } + }, + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "e1738ee972b49fd0c4d4718b035444495142b781", + "internalRef": "391407209" + } + }, + { + "git": { + "name": "synthtool", + "remote": "https://github.com/googleapis/synthtool.git", + "sha": "396d9b84a1e93880f5bf88b59ecd38a0a6dffc5e" + } + } + ], + "destinations": [ + { + "client": { + "source": "googleapis", + "apiName": "logging", + "apiVersion": "v2", + "language": "java", + "generator": "bazel" + } + } + ], + "generatedFiles": [ + ".github/ISSUE_TEMPLATE/bug_report.md", + ".github/ISSUE_TEMPLATE/feature_request.md", + ".github/ISSUE_TEMPLATE/support_request.md", + ".github/PULL_REQUEST_TEMPLATE.md", + ".github/generated-files-bot.yml", + ".github/release-please.yml", + ".github/release-trigger.yml", + ".github/snippet-bot.yml", + ".github/sync-repo-settings.yaml", + ".github/trusted-contribution.yml", + ".github/workflows/approve-readme.yaml", + ".github/workflows/auto-release.yaml", + ".github/workflows/ci.yaml", + ".github/workflows/samples.yaml", + ".kokoro/build.bat", + ".kokoro/build.sh", + ".kokoro/coerce_logs.sh", + ".kokoro/common.cfg", + ".kokoro/common.sh", + ".kokoro/continuous/common.cfg", + ".kokoro/continuous/java8.cfg", + ".kokoro/dependencies.sh", + ".kokoro/nightly/common.cfg", + ".kokoro/nightly/integration.cfg", + ".kokoro/nightly/java11.cfg", + ".kokoro/nightly/java7.cfg", + ".kokoro/nightly/java8-osx.cfg", + ".kokoro/nightly/java8-win.cfg", + ".kokoro/nightly/java8.cfg", + ".kokoro/nightly/samples.cfg", + ".kokoro/populate-secrets.sh", + ".kokoro/presubmit/clirr.cfg", + ".kokoro/presubmit/common.cfg", + ".kokoro/presubmit/dependencies.cfg", + ".kokoro/presubmit/integration.cfg", + ".kokoro/presubmit/java11.cfg", + ".kokoro/presubmit/java7.cfg", + ".kokoro/presubmit/java8-osx.cfg", + ".kokoro/presubmit/java8-win.cfg", + ".kokoro/presubmit/java8.cfg", + ".kokoro/presubmit/linkage-monitor.cfg", + ".kokoro/presubmit/lint.cfg", + ".kokoro/presubmit/samples.cfg", + ".kokoro/readme.sh", + ".kokoro/release/bump_snapshot.cfg", + ".kokoro/release/common.cfg", + ".kokoro/release/common.sh", + ".kokoro/release/drop.cfg", + ".kokoro/release/drop.sh", + ".kokoro/release/promote.cfg", + ".kokoro/release/promote.sh", + ".kokoro/release/publish_javadoc.cfg", + ".kokoro/release/publish_javadoc.sh", + ".kokoro/release/publish_javadoc11.cfg", + ".kokoro/release/publish_javadoc11.sh", + ".kokoro/release/snapshot.cfg", + ".kokoro/release/snapshot.sh", + ".kokoro/release/stage.cfg", + ".kokoro/release/stage.sh", + ".kokoro/trampoline.sh", + "CODE_OF_CONDUCT.md", + "LICENSE", + "SECURITY.md", + "codecov.yaml", + "google-cloud-logging/src/main/java/com/google/cloud/logging/v2/ConfigClient.java", + "google-cloud-logging/src/main/java/com/google/cloud/logging/v2/ConfigSettings.java", + "google-cloud-logging/src/main/java/com/google/cloud/logging/v2/LoggingClient.java", + "google-cloud-logging/src/main/java/com/google/cloud/logging/v2/LoggingSettings.java", + "google-cloud-logging/src/main/java/com/google/cloud/logging/v2/MetricsClient.java", + "google-cloud-logging/src/main/java/com/google/cloud/logging/v2/MetricsSettings.java", + "google-cloud-logging/src/main/java/com/google/cloud/logging/v2/gapic_metadata.json", + "google-cloud-logging/src/main/java/com/google/cloud/logging/v2/package-info.java", + "google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/ConfigServiceV2Stub.java", + "google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/ConfigServiceV2StubSettings.java", + "google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/GrpcConfigServiceV2CallableFactory.java", + "google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/GrpcConfigServiceV2Stub.java", + "google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/GrpcLoggingServiceV2CallableFactory.java", + "google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/GrpcLoggingServiceV2Stub.java", + "google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/GrpcMetricsServiceV2CallableFactory.java", + "google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/GrpcMetricsServiceV2Stub.java", + "google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/LoggingServiceV2Stub.java", + "google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/LoggingServiceV2StubSettings.java", + "google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/MetricsServiceV2Stub.java", + "google-cloud-logging/src/main/java/com/google/cloud/logging/v2/stub/MetricsServiceV2StubSettings.java", + "google-cloud-logging/src/test/java/com/google/cloud/logging/v2/ConfigClientTest.java", + "google-cloud-logging/src/test/java/com/google/cloud/logging/v2/LoggingClientTest.java", + "google-cloud-logging/src/test/java/com/google/cloud/logging/v2/MetricsClientTest.java", + "google-cloud-logging/src/test/java/com/google/cloud/logging/v2/MockConfigServiceV2.java", + "google-cloud-logging/src/test/java/com/google/cloud/logging/v2/MockConfigServiceV2Impl.java", + "google-cloud-logging/src/test/java/com/google/cloud/logging/v2/MockLoggingServiceV2.java", + "google-cloud-logging/src/test/java/com/google/cloud/logging/v2/MockLoggingServiceV2Impl.java", + "google-cloud-logging/src/test/java/com/google/cloud/logging/v2/MockMetricsServiceV2.java", + "google-cloud-logging/src/test/java/com/google/cloud/logging/v2/MockMetricsServiceV2Impl.java", + "grpc-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ConfigServiceV2Grpc.java", + "grpc-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LoggingServiceV2Grpc.java", + "grpc-google-cloud-logging-v2/src/main/java/com/google/logging/v2/MetricsServiceV2Grpc.java", + "java.header", + "license-checks.xml", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/BigQueryOptions.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/BigQueryOptionsOrBuilder.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/BillingAccountLocationName.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/BillingAccountName.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettings.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsName.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CmekSettingsOrBuilder.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateBucketRequest.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateBucketRequestOrBuilder.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateExclusionRequest.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateExclusionRequestOrBuilder.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateLogMetricRequest.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateLogMetricRequestOrBuilder.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateSinkRequest.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateSinkRequestOrBuilder.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateViewRequest.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/CreateViewRequestOrBuilder.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteBucketRequest.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteBucketRequestOrBuilder.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteExclusionRequest.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteExclusionRequestOrBuilder.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteLogMetricRequest.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteLogMetricRequestOrBuilder.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteLogRequest.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteLogRequestOrBuilder.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteSinkRequest.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteSinkRequestOrBuilder.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteViewRequest.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/DeleteViewRequestOrBuilder.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/FolderLocationName.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/FolderName.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetBucketRequest.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetBucketRequestOrBuilder.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetCmekSettingsRequest.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetCmekSettingsRequestOrBuilder.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetExclusionRequest.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetExclusionRequestOrBuilder.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetLogMetricRequest.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetLogMetricRequestOrBuilder.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetSinkRequest.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetSinkRequestOrBuilder.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetViewRequest.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/GetViewRequestOrBuilder.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LifecycleState.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListBucketsRequest.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListBucketsRequestOrBuilder.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListBucketsResponse.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListBucketsResponseOrBuilder.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListExclusionsRequest.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListExclusionsRequestOrBuilder.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListExclusionsResponse.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListExclusionsResponseOrBuilder.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogEntriesRequest.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogEntriesRequestOrBuilder.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogEntriesResponse.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogEntriesResponseOrBuilder.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogMetricsRequest.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogMetricsRequestOrBuilder.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogMetricsResponse.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogMetricsResponseOrBuilder.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogsRequest.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogsRequestOrBuilder.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogsResponse.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListLogsResponseOrBuilder.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListMonitoredResourceDescriptorsRequest.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListMonitoredResourceDescriptorsRequestOrBuilder.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListMonitoredResourceDescriptorsResponse.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListMonitoredResourceDescriptorsResponseOrBuilder.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListSinksRequest.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListSinksRequestOrBuilder.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListSinksResponse.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListSinksResponseOrBuilder.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListViewsRequest.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListViewsRequestOrBuilder.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListViewsResponse.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ListViewsResponseOrBuilder.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LocationName.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogBucket.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogBucketName.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogBucketOrBuilder.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntry.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntryOperation.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntryOperationOrBuilder.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntryOrBuilder.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntryProto.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntrySourceLocation.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogEntrySourceLocationOrBuilder.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogExclusion.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogExclusionName.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogExclusionOrBuilder.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogMetric.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogMetricName.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogMetricOrBuilder.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogName.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogSink.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogSinkName.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogSinkOrBuilder.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogView.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogViewName.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LogViewOrBuilder.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LoggingConfigProto.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LoggingMetricsProto.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/LoggingProto.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/OrganizationLocationName.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/OrganizationName.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/ProjectName.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/TailLogEntriesRequest.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/TailLogEntriesRequestOrBuilder.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/TailLogEntriesResponse.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/TailLogEntriesResponseOrBuilder.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UndeleteBucketRequest.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UndeleteBucketRequestOrBuilder.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateBucketRequest.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateBucketRequestOrBuilder.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateCmekSettingsRequest.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateCmekSettingsRequestOrBuilder.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateExclusionRequest.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateExclusionRequestOrBuilder.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateLogMetricRequest.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateLogMetricRequestOrBuilder.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateSinkRequest.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateSinkRequestOrBuilder.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateViewRequest.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/UpdateViewRequestOrBuilder.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/WriteLogEntriesPartialErrors.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/WriteLogEntriesPartialErrorsOrBuilder.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/WriteLogEntriesRequest.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/WriteLogEntriesRequestOrBuilder.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/WriteLogEntriesResponse.java", + "proto-google-cloud-logging-v2/src/main/java/com/google/logging/v2/WriteLogEntriesResponseOrBuilder.java", + "proto-google-cloud-logging-v2/src/main/proto/google/logging/v2/log_entry.proto", + "proto-google-cloud-logging-v2/src/main/proto/google/logging/v2/logging.proto", + "proto-google-cloud-logging-v2/src/main/proto/google/logging/v2/logging_config.proto", + "proto-google-cloud-logging-v2/src/main/proto/google/logging/v2/logging_metrics.proto", + "renovate.json", + "samples/install-without-bom/pom.xml", + "samples/pom.xml", + "samples/snapshot/pom.xml", + "samples/snippets/pom.xml" + ] +} \ No newline at end of file diff --git a/pom.xml b/pom.xml index d61b4c18e4c6..fc4dad8be445 100644 --- a/pom.xml +++ b/pom.xml @@ -131,6 +131,7 @@ java-licensemanager java-life-sciences java-locationfinder + java-logging java-lustre java-maintenance java-managed-identities diff --git a/versions.txt b/versions.txt index 9cbe2eb77f5d..f538110dbeef 100644 --- a/versions.txt +++ b/versions.txt @@ -934,3 +934,6 @@ grpc-google-cloud-maintenance-v1:0.15.0:0.16.0-SNAPSHOT google-cloud-gkerecommender:0.1.0:0.2.0-SNAPSHOT proto-google-cloud-gkerecommender-v1:0.1.0:0.2.0-SNAPSHOT grpc-google-cloud-gkerecommender-v1:0.1.0:0.2.0-SNAPSHOT +google-cloud-logging:3.23.9:3.23.10-SNAPSHOT +grpc-google-cloud-logging-v2:0.112.9:0.112.10-SNAPSHOT +proto-google-cloud-logging-v2:0.112.9:0.112.10-SNAPSHOT